Skip to content

Commit eff2ee5

Browse files
Merge pull request #4200 from huynhsontung/rsb-metadata
Add design metadata for RichSuggestBox
2 parents 2b84917 + 02bbc4d commit eff2ee5

File tree

3 files changed

+88
-1
lines changed

3 files changed

+88
-1
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 RichSuggestBoxMetadata : AttributeTableBuilder
15+
{
16+
public RichSuggestBoxMetadata()
17+
: base()
18+
{
19+
AddCallback(ControlTypes.RichSuggestBox,
20+
b =>
21+
{
22+
b.AddCustomAttributes(nameof(RichSuggestBox.ClipboardCopyFormat), new CategoryAttribute(Resources.CategoryCommon));
23+
b.AddCustomAttributes(nameof(RichSuggestBox.ClipboardPasteFormat), new CategoryAttribute(Resources.CategoryCommon));
24+
b.AddCustomAttributes(nameof(RichSuggestBox.Description), new CategoryAttribute(Resources.CategoryCommon));
25+
b.AddCustomAttributes(nameof(RichSuggestBox.DisabledFormattingAccelerators), new CategoryAttribute(Resources.CategoryCommon));
26+
b.AddCustomAttributes(nameof(RichSuggestBox.Header), new CategoryAttribute(Resources.CategoryCommon));
27+
b.AddCustomAttributes(nameof(RichSuggestBox.HeaderTemplate),
28+
new CategoryAttribute(Resources.CategoryAppearance),
29+
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
30+
);
31+
b.AddCustomAttributes(nameof(RichSuggestBox.PlaceholderText), new CategoryAttribute(Resources.CategoryAppearance));
32+
b.AddCustomAttributes(nameof(RichSuggestBox.PopupCornerRadius), new CategoryAttribute(Resources.CategoryAppearance));
33+
b.AddCustomAttributes(nameof(RichSuggestBox.PopupFooter), new CategoryAttribute(Resources.CategoryCommon));
34+
b.AddCustomAttributes(nameof(RichSuggestBox.PopupFooterTemplate),
35+
new CategoryAttribute(Resources.CategoryAppearance),
36+
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
37+
);
38+
b.AddCustomAttributes(nameof(RichSuggestBox.PopupHeader), new CategoryAttribute(Resources.CategoryCommon));
39+
b.AddCustomAttributes(nameof(RichSuggestBox.PopupHeaderTemplate),
40+
new CategoryAttribute(Resources.CategoryAppearance),
41+
new EditorBrowsableAttribute(EditorBrowsableState.Advanced)
42+
);
43+
b.AddCustomAttributes(nameof(RichSuggestBox.PopupPlacement), new CategoryAttribute(Resources.CategoryCommon));
44+
b.AddCustomAttributes(nameof(RichSuggestBox.Prefixes), new CategoryAttribute(Resources.CategoryCommon));
45+
b.AddCustomAttributes(nameof(RichSuggestBox.RichEditBoxStyle), new CategoryAttribute(Resources.CategoryAppearance));
46+
b.AddCustomAttributes(nameof(RichSuggestBox.TokenBackground), new CategoryAttribute(Resources.CategoryBrush));
47+
b.AddCustomAttributes(nameof(RichSuggestBox.TokenForeground), new CategoryAttribute(Resources.CategoryBrush));
48+
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Toolkit, false));
49+
}
50+
);
51+
}
52+
}
53+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
namespace Microsoft.Toolkit.Uwp.UI.Controls.Design
6+
{
7+
internal static partial class ControlTypes
8+
{
9+
internal const string RichSuggestBox = RootNamespace + "." + nameof(RichSuggestBox);
10+
}
11+
12+
internal static class RichSuggestBox
13+
{
14+
internal const string PlaceholderText = nameof(PlaceholderText);
15+
internal const string RichEditBoxStyle = nameof(RichEditBoxStyle);
16+
internal const string Header = nameof(Header);
17+
internal const string HeaderTemplate = nameof(HeaderTemplate);
18+
internal const string Description = nameof(Description);
19+
internal const string PopupPlacement = nameof(PopupPlacement);
20+
internal const string PopupCornerRadius = nameof(PopupCornerRadius);
21+
internal const string PopupHeader = nameof(PopupHeader);
22+
internal const string PopupHeaderTemplate = nameof(PopupHeaderTemplate);
23+
internal const string PopupFooter = nameof(PopupFooter);
24+
internal const string PopupFooterTemplate = nameof(PopupFooterTemplate);
25+
internal const string TokenBackground = nameof(TokenBackground);
26+
internal const string TokenForeground = nameof(TokenForeground);
27+
internal const string Prefixes = nameof(Prefixes);
28+
internal const string ClipboardPasteFormat = nameof(ClipboardPasteFormat);
29+
internal const string ClipboardCopyFormat = nameof(ClipboardCopyFormat);
30+
internal const string DisabledFormattingAccelerators = nameof(DisabledFormattingAccelerators);
31+
}
32+
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -84,6 +84,8 @@
8484
<Compile Include="Controls\RadialGauge.Typedata.cs" />
8585
<Compile Include="Controls\RangeSelector.Metadata.cs" />
8686
<Compile Include="Controls\RangeSelector.Typedata.cs" />
87+
<Compile Include="Controls\RichSuggestBox.Typedata.cs" />
88+
<Compile Include="Controls\RichSuggestBox.Metadata.cs" />
8789
<Compile Include="Properties\AssemblyInfo.cs">
8890
<SubType>Code</SubType>
8991
</Compile>

0 commit comments

Comments
 (0)