Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iconograpy page tag buttons #1693

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions WinUIGallery/ControlPages/DesignGuidance/IconographyPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<Setter Property="SampleType" Value="Inline" />
<Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Margin" Value="0,4,0,16" />
<Setter Property="Margin" Value="0,4,0,4" />
</Style>

<DataTemplate x:Key="IconTemplate">
Expand Down Expand Up @@ -140,7 +140,7 @@
MinWidth="304"
MaxWidth="320"
HorizontalAlignment="Left"
PlaceholderText="Search icons"
PlaceholderText="Search icons by name, code, tags..."
AndrewKeepCoding marked this conversation as resolved.
Show resolved Hide resolved
QueryIcon="Find"
TextChanged="SearchTextBox_TextChanged" />
</StackPanel>
Expand Down Expand Up @@ -187,15 +187,13 @@
Style="{StaticResource SubtitleTextBlockStyle}"
Text="{Binding SelectedItem.Name, Mode=OneWay}" />
<FontIcon
Margin="0,12,0,32"
Margin="0,12,0,12"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="{x:Bind (x:Double)FontsizeComboBox.SelectedValue, Mode=OneWay}"
Glyph="{Binding SelectedItem.Character, Mode=OneWay}" />

<TextBlock Text="Icon name" />
<controls:SampleCodePresenter Code="{Binding SelectedItem.Name, Mode=OneWay}" Style="{StaticResource CodeValuePresenterStyle}" />
<TextBlock Text="Unicode point" />
<controls:SampleCodePresenter Code="{Binding SelectedItem.Code, Mode=OneWay}" Style="{StaticResource CodeValuePresenterStyle}" />
<TextBlock Text="Text glyph" />
Expand All @@ -206,6 +204,19 @@
<controls:SampleCodePresenter x:Name="XAMLCodePresenter" Style="{StaticResource CodeValuePresenterStyle}" />
<TextBlock Text="C#" />
<controls:SampleCodePresenter x:Name="CSharpCodePresenter" Style="{StaticResource CodeValuePresenterStyle}" />
<TextBlock Text="Tags" />
<ItemsControl ItemsSource="{Binding SelectedItem.Tags, Mode=OneWay}" Margin="0,4,0,4">
AndrewKeepCoding marked this conversation as resolved.
Show resolved Hide resolved
<ItemsControl.ItemsPanel>
AndrewKeepCoding marked this conversation as resolved.
Show resolved Hide resolved
<ItemsPanelTemplate>
<toolkit:WrapPanel Orientation="Horizontal" HorizontalSpacing="4" VerticalSpacing="4" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="x:String">
<Button Content="{x:Bind Mode=OneWay}" Click="TagButton_Click" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

<StackPanel Orientation="Vertical" Visibility="Collapsed">
<TextBlock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,13 @@ private void IconsItemsView_SelectionChanged(ItemsView sender, ItemsViewSelectio

}
}

private void TagButton_Click(object sender, RoutedEventArgs e)
{
if ((sender as Button).Content is string tag)
{
IconsAutoSuggestBox.Text = tag;
}
}
}
}
9 changes: 7 additions & 2 deletions WinUIGallery/DataModel/IconsData.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
{
"Code": "E700",
"Name": "GlobalNavButton",
"Tags": []
"Tags": [
"menu",
"humberger"
AndrewKeepCoding marked this conversation as resolved.
Show resolved Hide resolved
]
},
{
"Code": "E701",
Expand Down Expand Up @@ -5495,7 +5498,9 @@
{
"Code": "EDE3",
"Name": "ButtonMenu",
"Tags": []
"Tags": [
"humberger"
AndrewKeepCoding marked this conversation as resolved.
Show resolved Hide resolved
]
},
{
"Code": "EDE4",
Expand Down
2 changes: 2 additions & 0 deletions WinUIGallery/WinUIGallery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<PackageReference Include="ColorCode.Core" />
<PackageReference Include="Microsoft.Graphics.Win2D" />
<PackageReference Include="Microsoft.Windows.CsWinRT" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" />
AndrewKeepCoding marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" />
<PackageReference Include="CommunityToolkit.WinUI.Converters" />
Expand All @@ -121,6 +122,7 @@
<PackageReference Update="Microsoft.WindowsAppSDK" Version="$(WindowsAppSdkPackageVersion)" />
<PackageReference Remove="ColorCode.Core" />
<PackageReference Include="ColorCode.WinUI" Version="$(ColorCodeVersion)" />
<PackageReference Update="CommunityToolkit.WinUI.Controls.Primitives" Version="$(CommunityToolkitWinUIVersion)" />
<PackageReference Update="CommunityToolkit.WinUI.Controls.Segmented" Version="$(CommunityToolkitWinUIVersion)" />
<PackageReference Update="CommunityToolkit.WinUI.Controls.SettingsControls" Version="$(CommunityToolkitWinUIVersion)" />
<PackageReference Update="CommunityToolkit.WinUI.Converters" Version="$(CommunityToolkitWinUIVersion)" />
Expand Down