|
1 |
| -<Window x:Class="MaterialDesignColors.WpfExample.CardsWindow" |
2 |
| - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 |
| - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 |
| - xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf" |
5 |
| - TextElement.Foreground="{DynamicResource MaterialDesignBody}" |
6 |
| - Background="{DynamicResource MaterialDesignPaper}" |
7 |
| - FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto" |
8 |
| - Title="Cards" Height="320" Width="400"> |
9 |
| - <Window.Resources> |
| 1 | +<UserControl x:Class="MaterialDesignColors.WpfExample.Cards" |
| 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:local="clr-namespace:MaterialDesignColors.WpfExample" |
| 7 | + xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf" |
| 8 | + mc:Ignorable="d" |
| 9 | + d:DesignHeight="300" d:DesignWidth="300"> |
| 10 | + <UserControl.Resources> |
10 | 11 | <ResourceDictionary>
|
11 | 12 | <ResourceDictionary.MergedDictionaries>
|
12 | 13 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
|
13 | 14 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.CheckBox.xaml" />
|
14 | 15 | </ResourceDictionary.MergedDictionaries>
|
15 | 16 | </ResourceDictionary>
|
16 |
| - |
17 |
| - </Window.Resources> |
| 17 | + </UserControl.Resources> |
18 | 18 | <WrapPanel Margin="0 0 8 8" ItemWidth="200" Orientation="Vertical">
|
19 | 19 | <wpf:Card Margin="4 4 0 0">
|
20 | 20 | <Grid>
|
21 | 21 | <Grid.RowDefinitions>
|
22 | 22 | <RowDefinition Height="140" />
|
23 | 23 | <RowDefinition Height="*" />
|
24 | 24 | <RowDefinition Height="Auto" />
|
25 |
| - </Grid.RowDefinitions> |
26 |
| - <Image Source="Resources/Chartridge046_small.jpg" Height="140" Width="196" Stretch="UniformToFill" /> |
| 25 | + </Grid.RowDefinitions> |
| 26 | + <Image Source="Resources/Chartridge046_small.jpg" Height="140" Width="196" Stretch="UniformToFill" /> |
27 | 27 | <Button Grid.Row="1" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" HorizontalAlignment="Right" Margin="0 -68 16 0">
|
28 | 28 | <Viewbox Width="16" Height="16">
|
29 | 29 | <Canvas Width="24" Height="24">
|
30 | 30 | <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"
|
31 | 31 | Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" />
|
32 | 32 | </Canvas>
|
33 |
| - </Viewbox> |
| 33 | + </Viewbox> |
34 | 34 | </Button>
|
35 | 35 | <StackPanel Grid.Row="1" Margin="8 24 8 0" >
|
36 | 36 | <TextBlock FontWeight="Bold">Cycling</TextBlock>
|
37 |
| - <TextBlock TextWrapping="Wrap" VerticalAlignment="Center">A great way to keep fit and forget about the constant grind of IT.</TextBlock> |
38 |
| - </StackPanel> |
| 37 | + <TextBlock TextWrapping="Wrap" VerticalAlignment="Center">A great way to keep fit and forget about the constant grind of IT.</TextBlock> |
| 38 | + </StackPanel> |
39 | 39 | <StackPanel HorizontalAlignment="Right" Grid.Row="2" Orientation="Horizontal" Margin="8">
|
40 | 40 | <Button Style="{StaticResource MaterialDesignToolButton}" Width="30" Padding="2 0 2 0">
|
41 | 41 | <Viewbox Width="16" Height="16">
|
|
54 | 54 | </Viewbox>
|
55 | 55 | </Button>
|
56 | 56 | </StackPanel>
|
57 |
| - </Grid> |
58 |
| - </wpf:Card> |
| 57 | + </Grid> |
| 58 | + </wpf:Card> |
59 | 59 | <wpf:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueLightBrush}"
|
60 | 60 | Foreground="{DynamicResource PrimaryHueLightForegroundBrush}"
|
61 | 61 | Padding="8">
|
|
65 | 65 | Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
|
66 | 66 | Padding="8">
|
67 | 67 | <StackPanel>
|
68 |
| - <TextBlock FontSize="16">Notes</TextBlock> |
| 68 | + <TextBlock FontSize="16">Notes</TextBlock> |
69 | 69 | <CheckBox Margin="0 4 0 0" Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Do something good</CheckBox>
|
70 | 70 | <CheckBox Style="{StaticResource MaterialDesignUserForegroundCheckBox}">Take a breather</CheckBox>
|
71 | 71 | <CheckBox Style="{StaticResource MaterialDesignUserForegroundCheckBox}">And go create</CheckBox>
|
72 |
| - </StackPanel> |
| 72 | + </StackPanel> |
73 | 73 | </wpf:Card>
|
74 | 74 | <wpf:Card Margin="4 4 0 0" Background="{DynamicResource PrimaryHueDarkBrush}"
|
75 | 75 | Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
|
76 | 76 | Padding="8" UniformCornerRadius="5">
|
77 | 77 | <TextBlock>You can adjust the corner radius</TextBlock>
|
78 | 78 | </wpf:Card>
|
79 | 79 | </WrapPanel>
|
80 |
| -</Window> |
| 80 | +</UserControl> |
0 commit comments