|
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
6 | 6 | xmlns:system="clr-namespace:System;assembly=mscorlib"
|
7 | 7 | xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
| 8 | + xmlns:materialDesignConverters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" |
8 | 9 | xmlns:wpfExample="clr-namespace:MaterialDesignColors.WpfExample"
|
9 | 10 | xmlns:domain="clr-namespace:MaterialDesignDemo.Domain"
|
10 | 11 | mc:Ignorable="d"
|
|
20 | 21 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
|
21 | 22 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
|
22 | 23 | </ResourceDictionary.MergedDictionaries>
|
| 24 | + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
| 25 | + <materialDesignConverters:BooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter" TrueValue="Collapsed" FalseValue="Visible" /> |
23 | 26 | </ResourceDictionary>
|
24 | 27 | </UserControl.Resources>
|
25 | 28 | <Grid VerticalAlignment="Top">
|
|
32 | 35 | <RowDefinition Height="Auto" />
|
33 | 36 | <RowDefinition Height="Auto" />
|
34 | 37 | <RowDefinition Height="Auto" />
|
| 38 | + <RowDefinition Height="Auto" /> |
| 39 | + <RowDefinition Height="Auto" /> |
35 | 40 | </Grid.RowDefinitions>
|
36 | 41 | <TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}">Buttons</TextBlock>
|
37 | 42 | <Grid Grid.Row="1" >
|
|
212 | 217 | <Button Style="{StaticResource MaterialDesignFlatButton}" Click="ButtonBase_OnClick" ToolTip="MaterialDesignFlatButton" Margin="200 0 0 0">ACCEPT</Button>
|
213 | 218 | <Button Style="{StaticResource MaterialDesignFlatButton}" ToolTip="MaterialDesignFlatButton">CANCEL</Button>
|
214 | 219 | </StackPanel>
|
215 |
| - |
216 | 220 | <Border Margin="0 16 0 0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" Grid.Row="4" />
|
217 |
| - <TextBlock Margin="0 32 0 24" Grid.Row="4" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Toggles</TextBlock> |
218 |
| - <Grid Grid.Row="5"> |
| 221 | + |
| 222 | + <TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}" |
| 223 | + Grid.Row="5" Margin="0 12 0 12">Buttons - With Progress</TextBlock> |
| 224 | + <StackPanel Grid.Row="6" Orientation="Horizontal"> |
| 225 | + <Grid Width="124"> |
| 226 | + <!-- raised button with progress, useful to auto dismiss/accept something --> |
| 227 | + <Button Command="{Binding DismissComand}" |
| 228 | + Style="{StaticResource MaterialDesignRaisedButton}" |
| 229 | + HorizontalAlignment="Left" |
| 230 | + materialDesign:ButtonProgressAssist.Value="{Binding DismissButtonProgress}" |
| 231 | + Visibility="{Binding ShowDismissButton, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 232 | + <StackPanel Orientation="Horizontal"> |
| 233 | + <TextBlock>DISMISS</TextBlock> |
| 234 | + <materialDesign:PackIcon Margin="4 .5 0 0" Kind="Close" /> |
| 235 | + </StackPanel> |
| 236 | + </Button> |
| 237 | + <TextBlock Text="{Binding DemoRestartCountdownText}" |
| 238 | + VerticalAlignment="Center" |
| 239 | + Visibility="{Binding ShowDismissButton, Converter={StaticResource InvertedBooleanToVisibilityConverter}}" |
| 240 | + /> |
| 241 | + </Grid> |
| 242 | + |
| 243 | + <!-- floating action button with progress --> |
| 244 | + <TextBlock Margin="24 0 0 0" VerticalAlignment="Center">Click Me:</TextBlock> |
| 245 | + <Button Style="{StaticResource MaterialDesignFloatingActionLightButton}" Margin="8 0 0 0" |
| 246 | + Command="{Binding SaveComand}" |
| 247 | + materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding IsSaving}" |
| 248 | + materialDesign:ButtonProgressAssist.Value="{Binding SaveProgress}"> |
| 249 | + |
| 250 | + <!-- simple example of toggling/animating pack icon with a data trigger--> |
| 251 | + <materialDesign:PackIcon Height="24" Width="24"> |
| 252 | + <materialDesign:PackIcon.Style> |
| 253 | + <Style TargetType="materialDesign:PackIcon" BasedOn="{StaticResource {x:Type materialDesign:PackIcon}}"> |
| 254 | + <Setter Property="Kind" Value="CloudSync" /> |
| 255 | + <Style.Triggers> |
| 256 | + <DataTrigger Binding="{Binding IsSaveComplete}" Value="True"> |
| 257 | + <Setter Property="Kind" Value="Check" /> |
| 258 | + <DataTrigger.EnterActions> |
| 259 | + <BeginStoryboard> |
| 260 | + <Storyboard> |
| 261 | + <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.8" /> |
| 262 | + </Storyboard> |
| 263 | + </BeginStoryboard> |
| 264 | + </DataTrigger.EnterActions> |
| 265 | + </DataTrigger> |
| 266 | + </Style.Triggers> |
| 267 | + </Style> |
| 268 | + </materialDesign:PackIcon.Style> |
| 269 | + </materialDesign:PackIcon> |
| 270 | + |
| 271 | + </Button> |
| 272 | + |
| 273 | + <TextBlock Margin="24 0 0 0" VerticalAlignment="Center">Variations:</TextBlock> |
| 274 | + <Button Style="{StaticResource MaterialDesignFloatingActionButton}" Margin="16 0 0 0" |
| 275 | + materialDesign:ButtonProgressAssist.IsIndicatorVisible="True" |
| 276 | + materialDesign:ButtonProgressAssist.Value="-1" |
| 277 | + materialDesign:ButtonProgressAssist.IsIndeterminate="True" |
| 278 | + Content="{materialDesign:PackIcon DotsHorizontal}" /> |
| 279 | + <Button Style="{StaticResource MaterialDesignFloatingActionAccentButton}" Margin="16 0 0 0" |
| 280 | + materialDesign:ButtonProgressAssist.IsIndicatorVisible="True" |
| 281 | + materialDesign:ButtonProgressAssist.Value="50" |
| 282 | + Content="{materialDesign:PackIcon DotsHorizontal}" /> |
| 283 | + <Button Style="{StaticResource MaterialDesignFloatingActionButton}" Margin="16 0 0 0" |
| 284 | + Background="#81d4fa" |
| 285 | + BorderBrush="#81d4fa" |
| 286 | + Foreground="#DD000000" |
| 287 | + materialDesign:ButtonProgressAssist.IsIndicatorVisible="True" |
| 288 | + materialDesign:ButtonProgressAssist.Value="25" |
| 289 | + materialDesign:ButtonProgressAssist.IndicatorForeground="#e65100" |
| 290 | + materialDesign:ButtonProgressAssist.IndicatorBackground="#ffcc80" |
| 291 | + Content="{materialDesign:PackIcon DotsHorizontal}" /> |
| 292 | + <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}" Margin="16 0 0 0" |
| 293 | + materialDesign:ButtonProgressAssist.IsIndicatorVisible="True" |
| 294 | + materialDesign:ButtonProgressAssist.Value="75" |
| 295 | + Content="{materialDesign:PackIcon DotsHorizontal}" /> |
| 296 | + </StackPanel> |
| 297 | + <Border Margin="0 16 0 0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" Grid.Row="7" /> |
| 298 | + |
| 299 | + <TextBlock Margin="0 32 0 24" Grid.Row="7" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Toggles</TextBlock> |
| 300 | + <Grid Grid.Row="8"> |
219 | 301 | <Grid.RowDefinitions>
|
220 | 302 | <RowDefinition Height="Auto" />
|
221 | 303 | <RowDefinition Height="Auto" />
|
|
373 | 455 | </ListBox>
|
374 | 456 | </Grid>
|
375 | 457 |
|
376 |
| - <Border Grid.Row="6" Margin="0 16 0 0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" /> |
377 |
| - <TextBlock Margin="0 32 0 0" Grid.Row="6" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Rating bar</TextBlock> |
378 |
| - <StackPanel Grid.Row="7" Margin="0 16 0 0" Orientation="Horizontal"> |
| 458 | + <Border Grid.Row="9" Margin="0 16 0 0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" /> |
| 459 | + <TextBlock Margin="0 32 0 0" Grid.Row="9" Style="{StaticResource MaterialDesignHeadlineTextBlock}">Rating bar</TextBlock> |
| 460 | + <StackPanel Grid.Row="10" Margin="0 16 0 0" Orientation="Horizontal"> |
379 | 461 | <materialDesign:RatingBar Value="3" x:Name="BasicRatingBar" />
|
380 | 462 | <TextBlock Text="{Binding ElementName=BasicRatingBar, Path=Value, StringFormat=Rating: {0}}" VerticalAlignment="Top" Margin="10,2,0,0" />
|
381 | 463 | <materialDesign:RatingBar x:Name="CustomRatingBar" Max="3" Value="2" Margin="24 0 0 0" Orientation="Vertical">
|
|
0 commit comments