Skip to content

Commit 8199410

Browse files
committed
use pack icons
1 parent 8e912d4 commit 8199410

File tree

3 files changed

+25
-78
lines changed

3 files changed

+25
-78
lines changed

MainDemo.Wpf/ColorZones.xaml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,18 @@
4848
<ColumnDefinition Width="Auto" />
4949
</Grid.ColumnDefinitions>
5050
<Button Style="{DynamicResource MaterialDesignToolButton}">
51-
<Viewbox Width="16" Height="16" VerticalAlignment="Center" Opacity=".56">
52-
<Canvas Width="24" Height="24">
53-
<Path Data="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"
54-
Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=materialDesign:ColorZone}, Path=Foreground}" />
55-
</Canvas>
56-
</Viewbox>
51+
<materialDesign:PackIcon Kind="Magnify" Opacity=".56" />
5752
</Button>
5853
<TextBox Grid.Column="1" Margin="8 0 0 0" materialDesign:TextFieldAssist.Hint="Build a search bar"
5954
materialDesign:TextFieldAssist.DecorationVisibility="Hidden" BorderThickness="0"
6055
MinWidth="200" VerticalAlignment="Center" />
6156
<Button Style="{DynamicResource MaterialDesignToolButton}" Grid.Column="2">
62-
<Viewbox Width="16" Height="16" Margin="8 0 0 0" Opacity=".56">
63-
<Canvas Width="24" Height="24">
64-
<Path Data="M12,2A3,3 0 0,1 15,5V11A3,3 0 0,1 12,14A3,3 0 0,1 9,11V5A3,3 0 0,1 12,2M19,11C19,14.53 16.39,17.44 13,17.93V21H11V17.93C7.61,17.44 5,14.53 5,11H7A5,5 0 0,0 12,16A5,5 0 0,0 17,11H19Z"
65-
Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=materialDesign:ColorZone}, Path=Foreground}" />
66-
</Canvas>
67-
</Viewbox>
57+
<materialDesign:PackIcon Kind="Microphone" Opacity=".56" Margin="8 0 0 0" />
6858
</Button>
6959
</Grid>
7060
</materialDesign:ColorZone>
7161
<Button Style="{DynamicResource MaterialDesignToolForegroundButton}" Margin="8 0 0 0" Panel.ZIndex="0">
72-
<Viewbox Width="16" Height="16">
73-
<Canvas Width="24" Height="24">
74-
<Path Data="M2,21L23,12L2,3V10L17,12L2,14V21Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
75-
</Canvas>
76-
</Viewbox>
62+
<materialDesign:PackIcon Kind="Send" />
7763
</Button>
7864
</StackPanel>
7965
</materialDesign:ColorZone>

MainDemo.Wpf/IconPack.xaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@
5454
<materialDesign:ColorZone Mode="PrimaryLight" Grid.Row="2" Margin="0 8 0 0" CornerRadius="2" materialDesign:ShadowAssist.ShadowDepth="Depth2">
5555
<StackPanel Orientation="Horizontal" Margin="8">
5656
<TextBlock Margin="8 0 0 0" Style="{StaticResource MaterialDesignSubheadingTextBlock}" VerticalAlignment="Center">Usage:</TextBlock>
57-
<TextBox IsReadOnly="True" Margin="8 0 8 0"
58-
FontFamily="Courier New"
59-
FontWeight="Bold"
60-
GotFocus="TextBox_OnGotFocus"
61-
Text="{Binding ElementName=KindsListBox, Path=SelectedValue, StringFormat='&lt;materialDesign:PackIcon Kind=&quot;{0}&quot; \/>'}" />
57+
<materialDesign:ColorZone Mode="Standard" Margin="8" CornerRadius="2" Padding="6 2 6 2">
58+
<TextBox IsReadOnly="True"
59+
materialDesign:TextFieldAssist.DecorationVisibility="Collapsed"
60+
BorderThickness="0"
61+
FontFamily="Courier New"
62+
FontWeight="Bold"
63+
GotFocus="TextBox_OnGotFocus"
64+
Text="{Binding ElementName=KindsListBox, Path=SelectedValue, StringFormat='&lt;materialDesign:PackIcon Kind=&quot;{0}&quot; \/>'}" />
65+
</materialDesign:ColorZone>
6266
<materialDesign:PackIcon Kind="{Binding ElementName=KindsListBox, Path=SelectedValue}" VerticalAlignment="Center" />
6367
</StackPanel>
6468
</materialDesign:ColorZone>

MainDemo.Wpf/MenusAndToolBars.xaml

Lines changed: 13 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,22 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
67
mc:Ignorable="d"
78
d:DesignHeight="300" d:DesignWidth="300">
89
<DockPanel>
910
<Menu IsMainMenu="True" DockPanel.Dock="Top">
1011
<MenuItem Header="_File">
1112
<MenuItem Header="Save">
1213
<MenuItem.Icon>
13-
<Viewbox Width="16" Height="16">
14-
<Canvas Width="24" Height="24">
15-
<Path Data="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z" Fill="{DynamicResource MaterialDesignBody}" />
16-
</Canvas>
17-
</Viewbox>
14+
<materialDesign:PackIcon Kind="ContentSave" />
1815
</MenuItem.Icon>
1916
</MenuItem>
2017
<MenuItem Header="Save As.." />
2118
<MenuItem Header="Exit" InputGestureText="Ctrl+E">
2219
<MenuItem.Icon>
23-
<Viewbox Width="16" Height="16">
24-
<Canvas Width="24" Height="24">
25-
<Path Data="M19,3H5C3.89,3 3,3.89 3,5V9H5V5H19V19H5V15H3V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10.08,15.58L11.5,17L16.5,12L11.5,7L10.08,8.41L12.67,11H3V13H12.67L10.08,15.58Z" Fill="{DynamicResource MaterialDesignBody}" />
26-
</Canvas>
27-
</Viewbox>
20+
<materialDesign:PackIcon Kind="ExitToApp" />
2821
</MenuItem.Icon>
2922
</MenuItem>
3023
<Separator />
@@ -42,71 +35,39 @@
4235
<MenuItem Header="_Edit">
4336
<MenuItem Header="_Cut" Command="Cut">
4437
<MenuItem.Icon>
45-
<Viewbox Width="16" Height="16">
46-
<Canvas Width="24" Height="24">
47-
<Path Data="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z" Fill="{DynamicResource MaterialDesignBody}" />
48-
</Canvas>
49-
</Viewbox>
38+
<materialDesign:PackIcon Kind="ContentCut" />
5039
</MenuItem.Icon>
5140
</MenuItem>
5241
<MenuItem Header="_Copy" Command="Copy">
5342
<MenuItem.Icon>
54-
<Viewbox Width="16" Height="16">
55-
<Canvas Width="24" Height="24">
56-
<Path Data="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" Fill="{DynamicResource MaterialDesignBody}" />
57-
</Canvas>
58-
</Viewbox>
43+
<materialDesign:PackIcon Kind="ContentCopy" />
5944
</MenuItem.Icon>
6045
</MenuItem>
6146
<MenuItem Header="_Paste" Command="Paste">
6247
<MenuItem.Icon>
63-
<Viewbox Width="16" Height="16">
64-
<Canvas Width="24" Height="24">
65-
<Path Data="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z" Fill="{DynamicResource MaterialDesignBody}" />
66-
</Canvas>
67-
</Viewbox>
48+
<materialDesign:PackIcon Kind="ContentPaste" />
6849
</MenuItem.Icon>
6950
</MenuItem>
7051
</MenuItem>
7152
</Menu>
7253
<ToolBarTray DockPanel.Dock="Top">
7354
<ToolBar Style="{DynamicResource MaterialDesignToolBar}">
7455
<Button ToolTip="Follow me on Twitter" Click="TwitterButton_OnClick">
75-
<Viewbox Width="16" Height="16">
76-
<Canvas Width="24" Height="24">
77-
<Path Data="M17.71,9.33C17.64,13.95 14.69,17.11 10.28,17.31C8.46,17.39 7.15,16.81 6,16.08C7.34,16.29 9,15.76 9.9,15C8.58,14.86 7.81,14.19 7.44,13.12C7.82,13.18 8.22,13.16 8.58,13.09C7.39,12.69 6.54,11.95 6.5,10.41C6.83,10.57 7.18,10.71 7.64,10.74C6.75,10.23 6.1,8.38 6.85,7.16C8.17,8.61 9.76,9.79 12.37,9.95C11.71,7.15 15.42,5.63 16.97,7.5C17.63,7.38 18.16,7.14 18.68,6.86C18.47,7.5 18.06,7.97 17.56,8.33C18.1,8.26 18.59,8.13 19,7.92C18.75,8.45 18.19,8.93 17.71,9.33M20,2H4A2,2 0 0,0 2,4V20A2,2 0 0,0 4,22H20A2,2 0 0,0 22,20V4C22,2.89 21.1,2 20,2Z" Fill="{DynamicResource MaterialDesignBody}" />
78-
</Canvas>
79-
</Viewbox>
56+
<materialDesign:PackIcon Kind="TwitterBox" />
8057
</Button>
8158
<Button ToolTip="Save">
82-
<Viewbox Width="16" Height="16">
83-
<Canvas Width="24" Height="24">
84-
<Path Data="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z" Fill="{DynamicResource MaterialDesignBody}" />
85-
</Canvas>
86-
</Viewbox>
59+
<materialDesign:PackIcon Kind="ContentSave" />
8760
</Button>
8861
<Separator />
8962
<Button Command="Cut" ToolTip="Cut" ToolBar.OverflowMode="AsNeeded">
90-
<Viewbox Width="16" Height="16">
91-
<Canvas Width="24" Height="24">
92-
<Path Data="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z" Fill="{DynamicResource MaterialDesignBody}" />
93-
</Canvas>
94-
</Viewbox>
63+
<materialDesign:PackIcon Kind="ContentCut" />
9564
</Button>
9665
<Button Command="Copy" ToolTip="Copy that stuff" ToolBar.OverflowMode="AsNeeded">
97-
<Viewbox Width="16" Height="16">
98-
<Canvas Width="24" Height="24">
99-
<Path Data="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" Fill="{DynamicResource MaterialDesignBody}" />
100-
</Canvas>
101-
</Viewbox>
66+
<materialDesign:PackIcon Kind="ContentCopy" />
10267
</Button>
10368
<Separator />
10469
<Button Command="Paste" ToolTip="Paste some stuff" ToolBar.OverflowMode="AsNeeded">
105-
<Viewbox Width="16" Height="16">
106-
<Canvas Width="24" Height="24">
107-
<Path Data="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z" Fill="{DynamicResource MaterialDesignBody}" />
108-
</Canvas>
109-
</Viewbox>
70+
<materialDesign:PackIcon Kind="ContentPaste" />
11071
</Button>
11172
<Separator />
11273
<Label Content="Font size:" VerticalAlignment="Center"/>
@@ -120,11 +81,7 @@
12081
Check
12182
</CheckBox>
12283
<Button ToolTip="Take a nap" ToolBar.OverflowMode="Always">
123-
<Viewbox Width="16" Height="16">
124-
<Canvas Width="24" Height="24">
125-
<Path Data="M19,7H11V14H3V5H1V20H3V17H21V20H23V11A4,4 0 0,0 19,7M7,13A3,3 0 0,0 10,10A3,3 0 0,0 7,7A3,3 0 0,0 4,10A3,3 0 0,0 7,13Z" Fill="{DynamicResource MaterialDesignBody}" />
126-
</Canvas>
127-
</Viewbox>
84+
<materialDesign:PackIcon Kind="Hotel" />
12885
</Button>
12986
<RadioButton GroupName="XXX" Content="Radio" />
13087
<RadioButton GroupName="XXX" Content="Ga Ga" />

0 commit comments

Comments
 (0)