Skip to content

Commit 3843260

Browse files
committed
get the icon base from paket/ControlzEx, migrate demo stuff to PackIcon
1 parent efbc5c9 commit 3843260

19 files changed

+222
-211
lines changed

MainDemo.Wpf/Buttons.xaml

Lines changed: 15 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -40,74 +40,42 @@
4040
<Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
4141
Margin="0 0 8 0" HorizontalAlignment="Left"
4242
ToolTip="MaterialDesignFloatingActionMiniLightButton">
43-
<Viewbox Width="24" Height="24">
44-
<Canvas Width="24" Height="24">
45-
<Path Data="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
46-
</Canvas>
47-
</Viewbox>
43+
<materialDesign:PackIcon Kind="Alarm" Height="24" Width="24" />
4844
</Button>
4945
<Button Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
5046
Margin="0 0 8 0" HorizontalAlignment="Left"
5147
ToolTip="MaterialDesignFloatingActionMiniButton">
52-
<Viewbox Width="24" Height="24">
53-
<Canvas Width="24" Height="24">
54-
<Path Data="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
55-
</Canvas>
56-
</Viewbox>
48+
<materialDesign:PackIcon Kind="Alarm" Height="24" Width="24" />
5749
</Button>
5850
<Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
5951
Margin="0 0 8 0" HorizontalAlignment="Left"
6052
ToolTip="MaterialDesignFloatingActionMiniDarkButton">
61-
<Viewbox Width="24" Height="24">
62-
<Canvas Width="24" Height="24">
63-
<Path Data="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
64-
</Canvas>
65-
</Viewbox>
53+
<materialDesign:PackIcon Kind="Alarm" Height="24" Width="24" />
6654
</Button>
6755
<Button Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
6856
Margin="0 0 8 0" HorizontalAlignment="Left"
6957
ToolTip="MaterialDesignFloatingActionMiniAccentButton">
70-
<Viewbox Width="24" Height="24">
71-
<Canvas Width="24" Height="24">
72-
<Path Data="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
73-
</Canvas>
74-
</Viewbox>
58+
<materialDesign:PackIcon Kind="Alarm" Height="24" Width="24" />
7559
</Button>
7660
<Button Style="{StaticResource MaterialDesignFloatingActionLightButton}"
7761
Margin="0 0 8 0" HorizontalAlignment="Left"
7862
ToolTip="MaterialDesignFloatingActionLightButton">
79-
<Viewbox Width="24" Height="24">
80-
<Canvas Width="24" Height="24">
81-
<Path Data="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
82-
</Canvas>
83-
</Viewbox>
63+
<materialDesign:PackIcon Kind="Alarm" Height="24" Width="24" />
8464
</Button>
8565
<Button Style="{StaticResource MaterialDesignFloatingActionButton}"
8666
Margin="0 0 8 0" HorizontalAlignment="Left"
8767
ToolTip="MaterialDesignFloatingActionButton">
88-
<Viewbox Width="24" Height="24">
89-
<Canvas Width="24" Height="24">
90-
<Path Data="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
91-
</Canvas>
92-
</Viewbox>
68+
<materialDesign:PackIcon Kind="Alarm" Height="24" Width="24" />
9369
</Button>
9470
<Button Style="{StaticResource MaterialDesignFloatingActionDarkButton}"
9571
Margin="0 0 8 0" HorizontalAlignment="Left"
9672
ToolTip="MaterialDesignFloatingActionDarkButton">
97-
<Viewbox Width="24" Height="24">
98-
<Canvas Width="24" Height="24">
99-
<Path Data="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
100-
</Canvas>
101-
</Viewbox>
73+
<materialDesign:PackIcon Kind="Alarm" Height="24" Width="24" />
10274
</Button>
10375
<Button Style="{StaticResource MaterialDesignFloatingActionAccentButton}"
10476
Margin="0 0 8 0" HorizontalAlignment="Left"
10577
ToolTip="MaterialDesignFloatingActionAccentButton">
106-
<Viewbox Width="24" Height="24">
107-
<Canvas Width="24" Height="24">
108-
<Path Data="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground}" />
109-
</Canvas>
110-
</Viewbox>
78+
<materialDesign:PackIcon Kind="Alarm" Height="24" Width="24" />
11179
</Button>
11280
<materialDesign:PopupBox Style="{StaticResource MaterialDesignMultiFloatingActionPopupBox}"
11381
PlacementMode="BottomAndAlignCentres"
@@ -128,11 +96,7 @@
12896
Margin="0 0 48 0"
12997
ToolTip="PopupBox, Style MaterialDesignMultiFloatingActionAccentPopupBox">
13098
<materialDesign:PopupBox.ToggleCheckedContent>
131-
<Viewbox Width="24" Height="24">
132-
<Canvas Width="24" Height="24">
133-
<Path Data="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" Fill="Black" />
134-
</Canvas>
135-
</Viewbox>
99+
<materialDesign:PackIcon Kind="Pencil" Width="24" Height="24" />
136100
</materialDesign:PopupBox.ToggleCheckedContent>
137101
<StackPanel>
138102
<Button ToolTip="One">1</Button>
@@ -203,32 +167,16 @@
203167
</StackPanel>
204168
<StackPanel Grid.Row="8" Margin="0 16 0 0" Orientation="Horizontal">
205169
<ToggleButton Style="{StaticResource MaterialDesignFlatToggleButton}">
206-
<Viewbox Width="21" Height="21">
207-
<Canvas Width="24" Height="24">
208-
<Path Data="M16.5,6V17.5A4,4 0 0,1 12.5,21.5A4,4 0 0,1 8.5,17.5V5A2.5,2.5 0 0,1 11,2.5A2.5,2.5 0 0,1 13.5,5V15.5A1,1 0 0,1 12.5,16.5A1,1 0 0,1 11.5,15.5V6H10V15.5A2.5,2.5 0 0,0 12.5,18A2.5,2.5 0 0,0 15,15.5V5A4,4 0 0,0 11,1A4,4 0 0,0 7,5V17.5A5.5,5.5 0 0,0 12.5,23A5.5,5.5 0 0,0 18,17.5V6H16.5Z"
209-
StrokeThickness="4"
210-
Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ToggleButton}}, Path=Foreground}" />
211-
</Canvas>
212-
</Viewbox>
170+
<materialDesign:PackIcon Kind="Paperclip" Height="21" Width="21" />
213171
</ToggleButton>
214172
<ToggleButton Style="{StaticResource MaterialDesignFlatPrimaryToggleButton}"
215-
Margin="8 0 0 0"
173+
Margin="8 0 0 0"
216174
IsChecked="True">
217-
<Viewbox Width="21" Height="21">
218-
<Canvas Width="24" Height="24">
219-
<Path Data="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
220-
Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ToggleButton}}, Path=Foreground}" />
221-
</Canvas>
222-
</Viewbox>
175+
<materialDesign:PackIcon Kind="Heart" Height="21" Width="21" />
223176
</ToggleButton>
224177
<ToggleButton Style="{StaticResource MaterialDesignFlatPrimaryToggleButton}"
225-
IsEnabled="False" Margin="8 0 0 0">
226-
<Viewbox Width="21" Height="21">
227-
<Canvas Width="24" Height="24">
228-
<Path Data="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
229-
Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ToggleButton}}, Path=Foreground}" />
230-
</Canvas>
231-
</Viewbox>
178+
IsEnabled="False" Margin="8 0 0 0">
179+
<materialDesign:PackIcon Kind="Heart" Height="21" Width="21" />
232180
</ToggleButton>
233181
</StackPanel>
234182
<TextBlock Margin="0 24 0 0" Grid.Row="9">Rating bar</TextBlock>
@@ -239,12 +187,7 @@
239187
<materialDesign:RatingBar.ValueItemTemplate>
240188
<DataTemplate DataType="system:Int32">
241189
<Grid>
242-
<Viewbox Width="24" Height="24">
243-
<Canvas Width="24" Height="24">
244-
<Path Data="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
245-
Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Control}, Path=Foreground}" />
246-
</Canvas>
247-
</Viewbox>
190+
<materialDesign:PackIcon Kind="Heart" Height="24" Width="24" />
248191
<TextBlock Text="{Binding}" HorizontalAlignment="Center" VerticalAlignment="Center"
249192
FontSize="8"
250193
Foreground="{DynamicResource PrimaryHueMidForegroundBrush}"/>

MainDemo.Wpf/Cards.xaml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@
2626
<Button Grid.Row="0" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
2727
HorizontalAlignment="Right" VerticalAlignment="Bottom"
2828
Margin="0 0 16 -20">
29-
<Viewbox Width="16" Height="16">
30-
<Canvas Width="24" Height="24">
31-
<Path Data="M5,20.5A3.5,3.5 0 0,1 1.5,17A3.5,3.5 0 0,1 5,13.5A3.5,3.5 0 0,1 8.5,17A3.5,3.5 0 0,1 5,20.5M5,12A5,5 0 0,0 0,17A5,5 0 0,0 5,22A5,5 0 0,0 10,17A5,5 0 0,0 5,12M14.8,10H19V8.2H15.8L13.86,4.93C13.57,4.43 13,4.1 12.4,4.1C11.93,4.1 11.5,4.29 11.2,4.6L7.5,8.29C7.19,8.6 7,9 7,9.5C7,10.13 7.33,10.66 7.85,10.97L11.2,13V18H13V11.5L10.75,9.85L13.07,7.5M19,20.5A3.5,3.5 0 0,1 15.5,17A3.5,3.5 0 0,1 19,13.5A3.5,3.5 0 0,1 22.5,17A3.5,3.5 0 0,1 19,20.5M19,12A5,5 0 0,0 14,17A5,5 0 0,0 19,22A5,5 0 0,0 24,17A5,5 0 0,0 19,12M16,4.8C17,4.8 17.8,4 17.8,3C17.8,2 17,1.2 16,1.2C15,1.2 14.2,2 14.2,3C14.2,4 15,4.8 16,4.8Z"
32-
Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" />
33-
</Canvas>
34-
</Viewbox>
29+
<materialDesign:PackIcon Kind="Bike" />
3530
</Button>
3631
<StackPanel Grid.Row="1" Margin="8 24 8 0" >
3732
<TextBlock FontWeight="Bold">Cycling</TextBlock>
@@ -40,21 +35,11 @@
4035
<StackPanel HorizontalAlignment="Right" Grid.Row="2" Orientation="Horizontal" Margin="8">
4136
<Button Style="{StaticResource MaterialDesignToolButton}" Width="30" Padding="2 0 2 0"
4237
materialDesign:RippleAssist.IsCentered="True">
43-
<Viewbox Width="16" Height="16">
44-
<Canvas Width="24" Height="24">
45-
<Path Data="M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z"
46-
Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" />
47-
</Canvas>
48-
</Viewbox>
38+
<materialDesign:PackIcon Kind="ShareVariant" />
4939
</Button>
5040
<Button Style="{StaticResource MaterialDesignToolButton}" Width="30" Padding="2 0 2 0"
5141
materialDesign:RippleAssist.IsCentered="True">
52-
<Viewbox Width="16" Height="16">
53-
<Canvas Width="24" Height="24">
54-
<Path Data="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"
55-
Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" />
56-
</Canvas>
57-
</Viewbox>
42+
<materialDesign:PackIcon Kind="Heart" />
5843
</Button>
5944
</StackPanel>
6045
</Grid>

MainDemo.Wpf/Home.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
<Button ToolTip="Twitter" Click="TwitterButton_OnClick"
123123
Background="{DynamicResource PrimaryHueMidBrush}"
124124
Foreground="{DynamicResource PrimaryHueMidForegroundBrush}">
125-
<materialDesign:PackIcon Kind="Twitter" Height="20" Width="20" />
125+
<materialDesign:PackIcon Kind="Twitter" />
126126
</Button>
127127
<Button ToolTip="Chat" Click="ChatButton_OnClick">
128128
<!-- mix up the colours by brinking in a named palette (see merged dictionaries at top) -->
@@ -132,13 +132,13 @@
132132
<Button.Foreground>
133133
<SolidColorBrush Color="{StaticResource GreenPrimary500Foreground}"></SolidColorBrush>
134134
</Button.Foreground>
135-
<materialDesign:PackIcon Kind="Message" Height="20" Width="20" />
135+
<materialDesign:PackIcon Kind="Message" />
136136
</Button>
137137
<Button ToolTip="Email" Click="EmailButton_OnClick"
138138
Background="{DynamicResource SecondaryAccentBrush}"
139139
Foreground="{DynamicResource SecondaryAccentForegroundBrush}"
140140
>
141-
<materialDesign:PackIcon Kind="Email" Height="20" Width="20" />
141+
<materialDesign:PackIcon Kind="Email" />
142142
</Button>
143143
</StackPanel>
144144
</materialDesign:PopupBox>

MainDemo.Wpf/IconPack.xaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<UserControl x:Class="MaterialDesignDemo.IconPack"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:materialDesignDemo="clr-namespace:MaterialDesignDemo"
7+
mc:Ignorable="d"
8+
d:DesignHeight="300" d:DesignWidth="300"
9+
d:DesignData="{d:DesignInstance materialDesignDemo:IconPackViewModel, IsDesignTimeCreatable=False}">
10+
<UserControl.Resources>
11+
<ResourceDictionary>
12+
<ResourceDictionary.MergedDictionaries>
13+
<!--
14+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/"></ResourceDictionary>
15+
-->
16+
</ResourceDictionary.MergedDictionaries>
17+
</ResourceDictionary>
18+
</UserControl.Resources>
19+
<Grid>
20+
<TextBlock>Icons</TextBlock>
21+
22+
</Grid>
23+
</UserControl>

MainDemo.Wpf/IconPack.xaml.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace MaterialDesignDemo
17+
{
18+
/// <summary>
19+
/// Interaction logic for Icons.xaml
20+
/// </summary>
21+
public partial class IconPack : UserControl
22+
{
23+
public IconPack()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}

MainDemo.Wpf/IconsViewModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace MaterialDesignDemo
8+
{
9+
public class IconPackViewModel
10+
{
11+
}
12+
}

0 commit comments

Comments
 (0)