|
4 | 4 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
6 | 6 | xmlns:materialDesignDemo="clr-namespace:MaterialDesignDemo"
|
| 7 | + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" |
| 8 | + xmlns:virtualCollection="clr-namespace:VirtualCollection.VirtualCollection" |
7 | 9 | mc:Ignorable="d"
|
8 | 10 | d:DesignHeight="300" d:DesignWidth="300"
|
9 | 11 | d:DesignData="{d:DesignInstance materialDesignDemo:IconPackViewModel, IsDesignTimeCreatable=False}">
|
10 | 12 | <UserControl.Resources>
|
11 | 13 | <ResourceDictionary>
|
12 | 14 | <ResourceDictionary.MergedDictionaries>
|
13 |
| - <!-- |
14 |
| - <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/"></ResourceDictionary> |
15 |
| - --> |
| 15 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" /> |
16 | 16 | </ResourceDictionary.MergedDictionaries>
|
17 | 17 | </ResourceDictionary>
|
18 | 18 | </UserControl.Resources>
|
19 | 19 | <Grid>
|
20 |
| - <TextBlock>Icons</TextBlock> |
21 |
| - |
| 20 | + <Grid.RowDefinitions> |
| 21 | + <RowDefinition Height="Auto" /> |
| 22 | + <RowDefinition Height="*" /> |
| 23 | + <RowDefinition Height="Auto" /> |
| 24 | + </Grid.RowDefinitions> |
| 25 | + <StackPanel> |
| 26 | + <TextBlock Style="{StaticResource MaterialDesignDisplay2TextBlock}">Icon Pack</TextBlock> |
| 27 | + <TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}" |
| 28 | + Margin="0 8 0 0"> |
| 29 | + Material Design In XAML Toolkit includes the Material Design Icons collection. |
| 30 | + </TextBlock> |
| 31 | + <TextBlock Margin="0 8 0 0"> |
| 32 | + For more information on Material Design Icons see the official website: |
| 33 | + <Hyperlink Command="{Binding OpenDotComCommand}">materialdesignicons.com</Hyperlink> |
| 34 | + </TextBlock> |
| 35 | + </StackPanel> |
| 36 | + <ListBox ItemsSource="{Binding Kinds}" Grid.Row="1" Margin="0 8 0 0" |
| 37 | + x:Name="KindsListBox"> |
| 38 | + <ListBox.ItemsPanel> |
| 39 | + <ItemsPanelTemplate> |
| 40 | + <virtualCollection:VirtualizingWrapPanel ItemHeight="80" ItemWidth="80" /> |
| 41 | + </ItemsPanelTemplate> |
| 42 | + </ListBox.ItemsPanel> |
| 43 | + <ListBox.ItemTemplate> |
| 44 | + <DataTemplate DataType="materialDesign:PackIconKind"> |
| 45 | + <DockPanel ToolTip="{Binding }" Width="64" Height="64" Background="Transparent"> |
| 46 | + <TextBlock Text="{Binding }" DockPanel.Dock="Bottom" TextTrimming="CharacterEllipsis" HorizontalAlignment="Center" /> |
| 47 | + <materialDesign:PackIcon Kind="{Binding }" VerticalAlignment="Center" HorizontalAlignment="Center" |
| 48 | + Width="32" Height="32" |
| 49 | + /> |
| 50 | + </DockPanel> |
| 51 | + </DataTemplate> |
| 52 | + </ListBox.ItemTemplate> |
| 53 | + </ListBox> |
| 54 | + <materialDesign:ColorZone Mode="PrimaryLight" Grid.Row="2" Margin="0 8 0 0" CornerRadius="2" materialDesign:ShadowAssist.ShadowDepth="Depth2"> |
| 55 | + <StackPanel Orientation="Horizontal" Margin="8"> |
| 56 | + <TextBlock Margin="8 0 0 0" Style="{StaticResource MaterialDesignSubheadingTextBlock}" VerticalAlignment="Center">Usage:</TextBlock> |
| 57 | + <TextBox IsReadOnly="True" Margin="8 0 8 0" |
| 58 | + GotFocus="TextBox_OnGotFocus" |
| 59 | + Text="{Binding ElementName=KindsListBox, Path=SelectedValue, StringFormat='<materialDesign:PackIcon Kind="{0}" \/>'}" /> |
| 60 | + <materialDesign:PackIcon Kind="{Binding ElementName=KindsListBox, Path=SelectedValue}" VerticalAlignment="Center" /> |
| 61 | + </StackPanel> |
| 62 | + </materialDesign:ColorZone> |
22 | 63 | </Grid>
|
23 | 64 | </UserControl>
|
0 commit comments