2016-07-25 19:24:51 +02:00

120 lines
6.6 KiB
XML

<Window x:Class="MaterialModernWPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:modern="http://modernwpf"
xmlns:system="clr-namespace:System;assembly=mscorlib"
x:Name="Window"
Title="Material Design In XAML Toolkit"
Width="920"
Height="600"
modern:UIHooks.AutoDpiScale="True"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
Icon="airballoon.ico"
ResizeMode="CanResizeWithGrip"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
mc:Ignorable="d">
<modern:Chrome.Chrome>
<modern:Chrome ActiveBorderBrush="{StaticResource PrimaryHueDarkBrush}" />
</modern:Chrome.Chrome>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<modern:TitleBar Grid.Row="0"
Background="{StaticResource PrimaryHueDarkBrush}"
ShowTitle="False" />
<materialDesign:DialogHost Grid.Row="1" Identifier="RootDialog">
<materialDesign:DialogHost.DialogContent>
<StackPanel Margin="16">
<TextBlock>Tell me your name:</TextBlock>
<TextBox x:Name="FruitTextBox"
Margin="0 8 0 0"
HorizontalAlignment="Stretch" />
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button Margin="0 8 8 0"
Command="materialDesign:DialogHost.CloseDialogCommand"
IsDefault="True"
Style="{StaticResource MaterialDesignFlatButton}">
<Button.CommandParameter>
<system:Boolean>True</system:Boolean>
</Button.CommandParameter>
ACCEPT
</Button>
<Button Margin="0 8 8 0"
Command="materialDesign:DialogHost.CloseDialogCommand"
IsCancel="True"
Style="{StaticResource MaterialDesignFlatButton}">
<Button.CommandParameter>
<system:Boolean>False</system:Boolean>
</Button.CommandParameter>
CANCEL
</Button>
</StackPanel>
</StackPanel>
</materialDesign:DialogHost.DialogContent>
<materialDesign:DrawerHost Grid.Row="1" IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}">
<materialDesign:DrawerHost.LeftDrawerContent>
<DockPanel MinWidth="212">
<ToggleButton Margin="16"
HorizontalAlignment="Right"
DockPanel.Dock="Top"
IsChecked="{Binding ElementName=MenuToggleButton,
Path=IsChecked,
Mode=TwoWay}"
Style="{StaticResource MaterialDesignHamburgerToggleButton}" />
<TreeView>
<TreeViewItem Header="Item1" IsExpanded="True">
<TreeViewItem Header="Item1" />
<TreeViewItem Header="Item2" />
<TreeViewItem Header="Item3" />
</TreeViewItem>
<TreeViewItem Header="Item2" />
<TreeViewItem Header="Item3" />
<TreeViewItem Header="Item4" />
</TreeView>
</DockPanel>
</materialDesign:DrawerHost.LeftDrawerContent>
<DockPanel>
<materialDesign:ColorZone materialDesign:ShadowAssist.ShadowDepth="Depth2"
DockPanel.Dock="Top"
Mode="PrimaryMid"
Padding="16">
<DockPanel>
<ToggleButton x:Name="MenuToggleButton"
IsChecked="False"
Style="{StaticResource MaterialDesignHamburgerToggleButton}" />
<materialDesign:PopupBox DockPanel.Dock="Right"
PlacementMode="BottomAndAlignRightEdges"
StaysOpen="False">
<StackPanel>
<Button Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}" Content="Info" />
</StackPanel>
</materialDesign:PopupBox>
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="22"
Text="{Binding Title,
ElementName=Window}" />
</DockPanel>
</materialDesign:ColorZone>
<StackPanel Margin="8">
<TextBlock Text="This window demonstrates using core Chrome + external theming lib (ButchersBoy)." TextWrapping="Wrap" />
<Button Content="Hello Button" />
<ComboBox>
<ComboBoxItem Content="A" />
<ComboBoxItem Content="B" />
<ComboBoxItem Content="C" />
<ComboBoxItem Content="D" />
<ComboBoxItem Content="E" />
</ComboBox>
</StackPanel>
</DockPanel>
</materialDesign:DrawerHost>
</materialDesign:DialogHost>
</Grid>
</Window>