Skip to content

Commit a071e03

Browse files
committed
demo niceness
1 parent 1d8a0d8 commit a071e03

File tree

10 files changed

+180
-5
lines changed

10 files changed

+180
-5
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<UserControl x:Class="MaterialDesignColors.WpfExample.Home"
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:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
7+
mc:Ignorable="d"
8+
d:DesignHeight="300" d:DesignWidth="300">
9+
<Grid>
10+
<Grid.RowDefinitions>
11+
<RowDefinition Height="Auto" />
12+
<RowDefinition Height="*" />
13+
</Grid.RowDefinitions>
14+
<Grid HorizontalAlignment="Center" VerticalAlignment="Top" Margin="16">
15+
<Grid.ColumnDefinitions>
16+
<ColumnDefinition Width="Auto" />
17+
<ColumnDefinition Width="*" />
18+
</Grid.ColumnDefinitions>
19+
<Image Source="Resources/ms-icon-310x310.png" Stretch="Uniform" Width="100" Height="100" />
20+
<StackPanel Grid.Column="1" Margin="24 0 0 0">
21+
<TextBlock FontSize="32" TextWrapping="Wrap">Welcome to Material Design In XAML Toolkit</TextBlock>
22+
<TextBlock Margin="0 8 0 0" TextWrapping="Wrap" Foreground="{DynamicResource MaterialDesignBodyLight}">Use the left-hand menu to checkout the various controls &amp; themes.</TextBlock>
23+
</StackPanel>
24+
</Grid>
25+
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
26+
HorizontalAlignment="Center"
27+
VerticalAlignment="Bottom"
28+
Margin="0 0 0 32">
29+
<StackPanel Orientation="Horizontal">
30+
<wpf:Card Width="420" VerticalAlignment="Top" Margin="4 2 8 16" Height="280">
31+
<Grid VerticalAlignment="Stretch" >
32+
<Grid.RowDefinitions>
33+
<RowDefinition Height="Auto" />
34+
<RowDefinition Height="Auto" />
35+
<RowDefinition Height="Auto" />
36+
<RowDefinition Height="Auto" />
37+
</Grid.RowDefinitions>
38+
<Grid.ColumnDefinitions>
39+
<ColumnDefinition Width="200" />
40+
<ColumnDefinition Width="*" />
41+
</Grid.ColumnDefinitions>
42+
<Image Source="Resources/Contact.png" Grid.RowSpan="4" StretchDirection="Both" VerticalAlignment="Stretch" Stretch="UniformToFill" />
43+
<TextBlock Grid.Column="1" FontSize="28" Margin="16 16 16 8" FontWeight="Light">Get In Touch</TextBlock>
44+
<TextBlock Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Margin="16 0 16 8" Foreground="{DynamicResource MaterialDesignBodyLight}"
45+
VerticalAlignment="Top">Say hello, make a feature request, or raise a bug through one of these channels:</TextBlock>
46+
<Border Grid.Column="1" Grid.Row="2" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" Margin="0 8 0 0">
47+
<Grid Margin="8">
48+
<Button Style="{DynamicResource MaterialDesignFlatButton}" HorizontalAlignment="Left">
49+
<StackPanel Orientation="Horizontal">
50+
<Viewbox Width="16" Height="16">
51+
<Canvas Width="24" Height="24">
52+
<Path Data="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z"
53+
Fill="{DynamicResource MaterialDesignBody}" />
54+
</Canvas>
55+
</Viewbox>
56+
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">GitHub</TextBlock>
57+
</StackPanel>
58+
</Button>
59+
<Button Style="{DynamicResource MaterialDesignFlatButton}" HorizontalAlignment="Right">
60+
<StackPanel Orientation="Horizontal">
61+
<Viewbox Width="16" Height="16">
62+
<Canvas Width="24" Height="24">
63+
<Path Data="M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z"
64+
Fill="{DynamicResource MaterialDesignBody}" />
65+
</Canvas>
66+
</Viewbox>
67+
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Twitter</TextBlock>
68+
</StackPanel>
69+
</Button>
70+
</Grid>
71+
</Border>
72+
<Border Grid.Column="1" Grid.Row="3" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}">
73+
<Grid Margin="8">
74+
<Button Style="{DynamicResource MaterialDesignFlatButton}" HorizontalAlignment="Left">
75+
<StackPanel Orientation="Horizontal">
76+
<Viewbox Width="16" Height="16">
77+
<Canvas Width="24" Height="24">
78+
<Path Data="M7.5,2A2,2 0 0,1 9.5,4A2,2 0 0,1 7.5,6A2,2 0 0,1 5.5,4A2,2 0 0,1 7.5,2M6,7H9A2,2 0 0,1 11,9V14.5H9.5V22H5.5V14.5H4V9A2,2 0 0,1 6,7M16.5,2A2,2 0 0,1 18.5,4A2,2 0 0,1 16.5,6A2,2 0 0,1 14.5,4A2,2 0 0,1 16.5,2M15,22V16H12L14.59,8.41C14.84,7.59 15.6,7 16.5,7C17.4,7 18.16,7.59 18.41,8.41L21,16H18V22H15Z"
79+
Fill="{DynamicResource MaterialDesignBody}" />
80+
</Canvas>
81+
</Viewbox>
82+
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Chat</TextBlock>
83+
</StackPanel>
84+
</Button>
85+
<Button Style="{DynamicResource MaterialDesignFlatButton}" HorizontalAlignment="Right">
86+
<StackPanel Orientation="Horizontal">
87+
<Viewbox Width="16" Height="16">
88+
<Canvas Width="24" Height="24">
89+
<Path Data="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"
90+
Fill="{DynamicResource MaterialDesignBody}" />
91+
</Canvas>
92+
</Viewbox>
93+
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Email</TextBlock>
94+
</StackPanel>
95+
</Button>
96+
</Grid>
97+
</Border>
98+
</Grid>
99+
</wpf:Card>
100+
<wpf:Card Width="420" VerticalAlignment="Top" Margin="8 2 4 16" Height="280">
101+
<Grid VerticalAlignment="Stretch">
102+
<Grid.RowDefinitions>
103+
<RowDefinition Height="Auto" />
104+
</Grid.RowDefinitions>
105+
<Grid.ColumnDefinitions>
106+
<ColumnDefinition Width="200" />
107+
<ColumnDefinition Width="*" />
108+
</Grid.ColumnDefinitions>
109+
<Viewbox Width="160" Height="160" HorizontalAlignment="Center" VerticalAlignment="Center">
110+
<Canvas Width="24" Height="24">
111+
<Path Data="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z" Fill="Black" />
112+
</Canvas>
113+
</Viewbox>
114+
<StackPanel Grid.Column="1">
115+
<TextBlock FontSize="28" Margin="16 16 16 8" FontWeight="Light">Open Source</TextBlock>
116+
<TextBlock TextWrapping="Wrap" Margin="16 0 16 8" Foreground="{DynamicResource MaterialDesignBodyLight}"
117+
VerticalAlignment="Top">This project is completely open source. If you like and want to say thanks you could hit the GitHub Star button, tweet or post about it, or tell your mum about it!</TextBlock>
118+
</StackPanel>
119+
</Grid>
120+
</wpf:Card>
121+
</StackPanel>
122+
</ScrollViewer>
123+
</Grid>
124+
</UserControl>
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 MaterialDesignColors.WpfExample
17+
{
18+
/// <summary>
19+
/// Interaction logic for Home.xaml
20+
/// </summary>
21+
public partial class Home : UserControl
22+
{
23+
public Home()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}

MaterialDesignColors.WpfExample/MainWindow.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:wpfExample="clr-namespace:MaterialDesignColors.WpfExample"
55
xmlns:domain="clr-namespace:MaterialDesignColors.WpfExample.Domain"
66
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
7-
Title="Material Design in XAML" Height="600" Width="980"
7+
Title="Material Design in XAML" Height="800" Width="1100"
88
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
99
TextElement.FontWeight="Medium"
1010
TextElement.FontSize="14"
@@ -38,6 +38,11 @@
3838
<TextBlock Text="{Binding Name}" />
3939
</DataTemplate>
4040
</ListBox.ItemTemplate>
41+
<domain:DemoItem Name="Home">
42+
<domain:DemoItem.Content>
43+
<wpfExample:Home />
44+
</domain:DemoItem.Content>
45+
</domain:DemoItem>
4146
<domain:DemoItem Name="Palette">
4247
<domain:DemoItem.Content>
4348
<wpfExample:PaletteSelector>

MaterialDesignColors.WpfExample/MaterialDesignColors.WpfExample.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
<Compile Include="Grids.xaml.cs">
8484
<DependentUpon>Grids.xaml</DependentUpon>
8585
</Compile>
86+
<Compile Include="Home.xaml.cs">
87+
<DependentUpon>Home.xaml</DependentUpon>
88+
</Compile>
8689
<Compile Include="Lists.xaml.cs">
8790
<DependentUpon>Lists.xaml</DependentUpon>
8891
</Compile>
@@ -119,6 +122,10 @@
119122
<SubType>Designer</SubType>
120123
<Generator>MSBuild:Compile</Generator>
121124
</Page>
125+
<Page Include="Home.xaml">
126+
<SubType>Designer</SubType>
127+
<Generator>MSBuild:Compile</Generator>
128+
</Page>
122129
<Page Include="Lists.xaml">
123130
<SubType>Designer</SubType>
124131
<Generator>MSBuild:Compile</Generator>
@@ -209,6 +216,12 @@
209216
<ItemGroup>
210217
<Resource Include="Resources\Chartridge046_small.jpg" />
211218
</ItemGroup>
219+
<ItemGroup>
220+
<Resource Include="Resources\ms-icon-310x310.png" />
221+
</ItemGroup>
222+
<ItemGroup>
223+
<Resource Include="Resources\Contact.png" />
224+
</ItemGroup>
212225
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
213226
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
214227
Other similar extension points exist, see Microsoft.Common.targets.

MaterialDesignColors.WpfExample/Palette.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
</Border>
2929
<Border Background="{DynamicResource PrimaryHueLightBrush}"
3030
Grid.Row="1">
31-
<TextBlock FontWeight="Bold" Foreground="{DynamicResource PrimaryHueLightForegroundBrush}">Primary - Light</TextBlock>
31+
<TextBlock FontWeight="Bold" Foreground="{DynamicResource PrimaryHueLightForegroundBrush}">Light</TextBlock>
3232
</Border>
3333
<Border Background="{DynamicResource PrimaryHueMidBrush}"
3434
Grid.Row="1" Grid.Column="1">
35-
<TextBlock Foreground="{DynamicResource PrimaryHueMidForegroundBrush}">Primary - Mid</TextBlock>
35+
<TextBlock Foreground="{DynamicResource PrimaryHueMidForegroundBrush}">Mid</TextBlock>
3636
</Border>
3737
<Border Background="{DynamicResource PrimaryHueDarkBrush}"
3838
Grid.Row="1" Grid.Column="2">
39-
<TextBlock Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}">Primary - Dark</TextBlock>
39+
<TextBlock Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}">Dark</TextBlock>
4040
</Border>
4141
<Border Background="{DynamicResource SecondaryAccentBrush}"
4242
Grid.Row="2" Grid.ColumnSpan="3">

MaterialDesignColors.WpfExample/PaletteSelector.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@
8080
</UserControl.Resources>
8181
<DockPanel>
8282
<wpf:Card DockPanel.Dock="Top">
83-
<local:Palette />
83+
<DockPanel>
84+
<local:Palette DockPanel.Dock="Left" Width="200" />
85+
<TextBlock Margin="16" TextWrapping="Wrap" VerticalAlignment="Center">This is your current palette. Configure your initial palette in App.xaml, but palettes can be changed at runtime.</TextBlock>
86+
</DockPanel>
8487
</wpf:Card>
8588
<Grid Margin="0 16 0 0">
8689
<Grid.RowDefinitions>
160 KB
Loading
57.1 KB
Loading

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Dark.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<SolidColorBrush x:Key="MaterialDesignBackground" Color="#FF000000"/>
88
<SolidColorBrush x:Key="MaterialDesignPaper" Color="#FF37474f"/>
99
<SolidColorBrush x:Key="MaterialDesignBody" Color="#DDFFFFFF"/>
10+
<SolidColorBrush x:Key="MaterialDesignBodyLight" Color="#89FFFFFF"/>
1011
<SolidColorBrush x:Key="MaterialDesignColumnHeader" Color="#BCFFFFFF"/><!-- 74% -->
1112

1213
<SolidColorBrush x:Key="MaterialDesignCheckBoxOff" Color="#89FFFFFF" />

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Light.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<SolidColorBrush x:Key="MaterialDesignBackground" Color="#FFFFFFFF"/>
77
<SolidColorBrush x:Key="MaterialDesignPaper" Color="#FFfafafa"/>
88
<SolidColorBrush x:Key="MaterialDesignBody" Color="#DD000000"/>
9+
<SolidColorBrush x:Key="MaterialDesignBodyLight" Color="#89000000"/>
910
<SolidColorBrush x:Key="MaterialDesignColumnHeader" Color="#BC000000"/> <!-- 74% -->
1011

1112
<SolidColorBrush x:Key="MaterialDesignCheckBoxOff" Color="#89000000" />

0 commit comments

Comments
 (0)