|
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
| 7 | + xmlns:codeDisplayer="clr-namespace:CodeDisplayer;assembly=CodeDisplayer" |
7 | 8 | mc:Ignorable="d"
|
8 | 9 | d:DesignHeight="300" d:DesignWidth="300">
|
9 | 10 |
|
|
15 | 16 | </ResourceDictionary.MergedDictionaries>
|
16 | 17 | </ResourceDictionary>
|
17 | 18 | </UserControl.Resources>
|
18 |
| - |
19 |
| - <Grid> |
20 |
| - <Grid.ColumnDefinitions> |
21 |
| - <ColumnDefinition Width="Auto" /> |
22 |
| - <ColumnDefinition Width="Auto" /> |
23 |
| - <ColumnDefinition Width="*" /> |
24 |
| - </Grid.ColumnDefinitions> |
25 |
| - <Grid.RowDefinitions> |
26 |
| - <RowDefinition Height="Auto" /> |
27 |
| - <RowDefinition Height="*" /> |
28 |
| - </Grid.RowDefinitions> |
29 |
| - <!-- linear progress bars (the default style --> |
30 |
| - <ProgressBar Orientation="Vertical" Value="25" Margin="24" Grid.RowSpan="2" /> |
31 |
| - <ProgressBar Orientation="Vertical" Height="10" IsIndeterminate="True" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Margin="24" /> |
32 |
| - <StackPanel Grid.Row="0" Grid.Column="2" HorizontalAlignment="Stretch"> |
33 |
| - <ProgressBar Value="25" Margin="24" Height="10" /> |
34 |
| - <ProgressBar Value="50" Margin="24" materialDesign:TransitionAssist.DisableTransitions="True" /> <!-- should disable on 2nd transition... --> |
35 |
| - <ProgressBar Value="75" Margin="24" /> |
36 |
| - <ProgressBar IsIndeterminate="True" Margin="24" /> |
37 |
| - </StackPanel> |
38 |
| - |
39 |
| - <!-- circular progress bars.. specify the MaterialDesignCicularProgressBar resource --> |
40 |
| - <Grid VerticalAlignment="Top" Grid.Column="2" Grid.Row="1"> |
41 |
| - <Grid.RowDefinitions> |
42 |
| - <RowDefinition Height="Auto" /> |
43 |
| - <RowDefinition Height="Auto" /> |
44 |
| - <RowDefinition Height="Auto" /> |
45 |
| - <RowDefinition Height="Auto" /> |
46 |
| - <RowDefinition Height="Auto" /> |
47 |
| - <RowDefinition Height="Auto" /> |
48 |
| - <RowDefinition Height="Auto" /> |
49 |
| - </Grid.RowDefinitions> |
50 |
| - <Grid.ColumnDefinitions> |
51 |
| - <ColumnDefinition Width="Auto" /> |
52 |
| - <ColumnDefinition Width="*" /> |
53 |
| - </Grid.ColumnDefinitions> |
54 |
| - |
55 |
| - <TextBlock Grid.ColumnSpan="2" FontSize="16" TextWrapping="Wrap" TextAlignment="Center" HorizontalAlignment="Stretch" |
56 |
| - Margin="0 0 0 16"> |
57 |
| - No extra control is required for the circular style, it is purely a standard ProgressBar, with the MaterialDesignCircularProgressBar style applied. |
58 |
| - </TextBlock> |
59 |
| - |
| 19 | + <ScrollViewer> |
| 20 | + <codeDisplayer:XamlDisplayerPanel x:Name="XamlDisplayerPanel"> |
| 21 | + <ProgressBar Orientation="Vertical" Width="200" Height="10" Value="25" /> |
| 22 | + <ProgressBar Orientation="Vertical" Width="200" Height="10" IsIndeterminate="True" /> |
| 23 | + <ProgressBar Value="25" Width="200" Height="10" /> |
| 24 | + <ProgressBar Value="50" Width="200" Height="10" materialDesign:TransitionAssist.DisableTransitions="True" /> |
| 25 | + <ProgressBar Value="75" Width="200" Height="10"/> |
| 26 | + <ProgressBar IsIndeterminate="True" Width="200" Height="10"/> |
60 | 27 | <ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}"
|
61 | 28 | x:Name="DeterminateCircularProgress"
|
62 |
| - Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12" /> |
63 |
| - <TextBlock Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" TextWrapping="Wrap">Standard deterministic progress bar, running from 0 to 100%.  For the purpose of the demo, a storyboard is used to animate the .Value property.</TextBlock> |
64 |
| - |
| 29 | + VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12" /> |
65 | 30 | <ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}"
|
66 | 31 | Value="35"
|
67 | 32 | IsIndeterminate="True"
|
68 |
| - Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12"/> |
69 |
| - <TextBlock Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" TextWrapping="Wrap">Indeterminate progress bar, at 35%.</TextBlock> |
70 |
| - |
| 33 | + VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12"/> |
71 | 34 | <ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}"
|
72 | 35 | Value="0"
|
73 | 36 | IsIndeterminate="True"
|
74 |
| - Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12"/> |
75 |
| - <TextBlock Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" TextWrapping="Wrap">Fully indeterminate progress bar, using .Value=0 to inform the theme.</TextBlock> |
76 |
| - |
| 37 | + VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12"/> |
77 | 38 | <ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}"
|
78 | 39 | Value="20"
|
79 | 40 | IsIndeterminate="True"
|
80 | 41 | x:Name="IndeterminateToDeterminateCircularProgress"
|
81 |
| - Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12" /> |
82 |
| - <TextBlock Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" TextWrapping="Wrap">An indeterminate job transitioning to a determinate job, completing to 100%.  For the purpose of the demo, a storyboard is used to animate the .Value and .IsIndeterminate properties.</TextBlock> |
83 |
| - |
| 42 | + VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12" /> |
84 | 43 | <materialDesign:Card UniformCornerRadius="14" Padding="4"
|
85 |
| - Grid.Row="5" Grid.Column="0" |
| 44 | + |
86 | 45 | VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12">
|
87 | 46 | <ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}"
|
88 | 47 | Value="50"
|
89 | 48 | IsIndeterminate="True"
|
90 | 49 | />
|
91 | 50 | </materialDesign:Card>
|
92 |
| - <TextBlock Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" TextWrapping="Wrap">Wrap in a Card control to raise the material.</TextBlock> |
93 |
| - |
94 | 51 | <materialDesign:Card UniformCornerRadius="14"
|
95 | 52 | RenderTransformOrigin=".5,.5"
|
96 | 53 | Padding="4"
|
97 |
| - Grid.Row="6" Grid.Column="0" |
| 54 | + |
98 | 55 | VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12 12 12 12">
|
99 | 56 | <ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}"
|
100 | 57 | x:Name="AnimatedProgressInCard"
|
|
162 | 119 | </materialDesign:Card.Style>
|
163 | 120 |
|
164 | 121 | </materialDesign:Card>
|
165 |
| - <TextBlock Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" TextWrapping="Wrap">Apply some animations to the card to get funky!</TextBlock> |
166 |
| - |
167 |
| - </Grid> |
168 |
| - </Grid> |
169 |
| - |
170 |
| - <!-- these animations are used to control the circular progress bars' values, so we don't need |
171 |
| - code-behind or a view model to illustrate them in action |
172 |
| - --> |
| 122 | + </codeDisplayer:XamlDisplayerPanel> |
| 123 | + </ScrollViewer> |
173 | 124 | <UserControl.Triggers>
|
174 | 125 | <EventTrigger RoutedEvent="FrameworkElement.Loaded">
|
175 | 126 | <EventTrigger.Actions>
|
|
0 commit comments