Skip to content

Commit 3786b84

Browse files
committed
Added basic designer metadata
1 parent 490ff9c commit 3786b84

File tree

5 files changed

+86
-16
lines changed

5 files changed

+86
-16
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Design/TabbedCommandBarMetadata.cs renamed to Microsoft.Toolkit.Uwp.UI.Controls.Design/Controls/TabbedCommandBar.Metadata.cs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,27 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Common;
6-
using Microsoft.Windows.Design;
7-
using Microsoft.Windows.Design.Features;
8-
using Microsoft.Windows.Design.Metadata;
9-
using Microsoft.Windows.Design.Model;
10-
using Microsoft.Windows.Design.PropertyEditing;
115
using System.ComponentModel;
126

7+
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
8+
9+
using Microsoft.VisualStudio.DesignTools.Extensibility;
10+
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
11+
1312
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
1413
{
15-
1614
internal class TabbedCommandBarMetadata : AttributeTableBuilder
1715
{
1816
public TabbedCommandBarMetadata()
1917
: base()
2018
{
21-
AddCallback(typeof(TabbedCommandBar),
19+
AddCallback(ControlTypes.TabbedCommandBar,
2220
b =>
2321
{
24-
//b.AddCustomAttributes(nameof(TabbedCommandBar.SomePropertyHere),
25-
// new CategoryAttribute(Properties.Resources.CategoryCommon)
26-
// );
27-
b.AddCustomAttributes(nameof(TabbedCommandBar.Background),
28-
new CategoryAttribute(Properties.Resources.CategoryBrush)
29-
);
30-
22+
b.AddCustomAttributes(nameof(TabbedCommandBar.CollapsedState), new CategoryAttribute(Resources.CategoryAppearance));
3123
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
3224
}
3325
);
3426
}
3527
}
36-
}
28+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
7+
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
8+
{
9+
internal static partial class ControlTypes
10+
{
11+
internal const string TabbedCommandBar = RootNamespace + "." + nameof(TabbedCommandBar);
12+
}
13+
14+
internal static class TabbedCommandBar
15+
{
16+
internal const string CollapsedState = nameof(CollapsedState);
17+
}
18+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System.ComponentModel;
6+
7+
using Microsoft.Toolkit.Uwp.UI.Controls.Design.Properties;
8+
9+
using Microsoft.VisualStudio.DesignTools.Extensibility;
10+
using Microsoft.VisualStudio.DesignTools.Extensibility.Metadata;
11+
12+
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
13+
{
14+
internal class TabbedCommandBarItemMetadata : AttributeTableBuilder
15+
{
16+
public TabbedCommandBarItemMetadata()
17+
: base()
18+
{
19+
AddCallback(ControlTypes.TabbedCommandBarItem,
20+
b =>
21+
{
22+
// TODO
23+
// b.AddCustomAttributes(nameof(TabbedCommandBarItem.Header), new CategoryAttribute(Resources.CategoryCommon));
24+
// b.AddCustomAttributes(nameof(TabbedCommandBarItem.Footer), new CategoryAttribute(Resources.CategoryCommon));
25+
b.AddCustomAttributes(nameof(TabbedCommandBarItem.IsContextual), new CategoryAttribute(Resources.CategoryCommon));
26+
b.AddCustomAttributes(nameof(TabbedCommandBarItem.OverflowButtonAlignment),
27+
new CategoryAttribute(Resources.CategoryLayout),
28+
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
29+
);
30+
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
31+
}
32+
);
33+
}
34+
}
35+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
7+
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
8+
{
9+
internal static partial class ControlTypes
10+
{
11+
internal const string TabbedCommandBarItem = RootNamespace + "." + nameof(TabbedCommandBarItem);
12+
}
13+
14+
internal static class TabbedCommandBarItem
15+
{
16+
internal const string Header = nameof(Header);
17+
internal const string Footer = nameof(Footer);
18+
internal const string IsContextual = nameof(IsContextual);
19+
internal const string OverflowButtonAlignment = nameof(OverflowButtonAlignment);
20+
}
21+
}

Microsoft.Toolkit.Uwp.UI.Controls.Design/Microsoft.Toolkit.Uwp.UI.Controls.DesignTools.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@
119119
<Compile Include="Controls\RotatorTile.Typedata.cs" />
120120
<Compile Include="Controls\ScrollHeader.Metadata.cs" />
121121
<Compile Include="Controls\ScrollHeader.Typedata.cs" />
122+
<Compile Include="Controls\TabbedCommandBar.Metadata.cs" />
123+
<Compile Include="Controls\TabbedCommandBar.Typedata.cs" />
124+
<Compile Include="Controls\TabbedCommandBarItem.Metadata.cs" />
125+
<Compile Include="Controls\TabbedCommandBarItem.Typedata.cs" />
122126
<Compile Include="Controls\TextToolbar.Metadata.cs" />
123127
<Compile Include="Controls\TextToolbar.Typedata.cs" />
124128
<Compile Include="Controls\TileControl.Metadata.cs" />

0 commit comments

Comments
 (0)