This commit is contained in:
Holger Börchers 2020-04-20 22:11:36 +02:00
parent c507cb5b4d
commit 441d1d2010
4 changed files with 105 additions and 90 deletions

View File

@ -3,13 +3,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dryIoc="http://prismlibrary.com/" xmlns:dryIoc="http://prismlibrary.com/"
xmlns:local="clr-namespace:ModernWpfPlayground"
xmlns:ui="http://schemas.modernwpf.com/2019"> xmlns:ui="http://schemas.modernwpf.com/2019">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<local:IntellisenseResourceDictionary Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
<ui:ThemeResources /> <ui:ThemeResources />
<ui:IntellisenseResources Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
<ui:XamlControlsResources /> <ui:XamlControlsResources />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View File

@ -6,8 +6,8 @@
xmlns:local="clr-namespace:ModernWpfPlayground" xmlns:local="clr-namespace:ModernWpfPlayground"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prism="http://prismlibrary.com/" xmlns:prism="http://prismlibrary.com/"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:propertyPresenter="clr-namespace:ModernWpfPlayground.PropertyPresenter" xmlns:propertyPresenter="clr-namespace:ModernWpfPlayground.PropertyPresenter"
xmlns:ui="http://schemas.modernwpf.com/2019"
x:Name="Window" x:Name="Window"
Title="{Binding Title}" Title="{Binding Title}"
Width="{Binding WindowWidth, Mode=TwoWay}" Width="{Binding WindowWidth, Mode=TwoWay}"
@ -155,47 +155,56 @@
<Grid Row="1"> <Grid Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="40" /> <ColumnDefinition Width="40" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border <Border
Grid.Column="0" Grid.Column="0"
Background="#2C2C2C" Background="#2C2C2C"
BorderThickness="0"> BorderThickness="0">
<StackPanel HorizontalAlignment="Center"> <ui:SimpleStackPanel HorizontalAlignment="Center" Spacing="10">
<ui:SimpleStackPanel.Resources>
<Style TargetType="TextBlock">
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-90" />
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ui:ToggleSwitch">
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-90" />
</Setter.Value>
</Setter>
</Style>
</ui:SimpleStackPanel.Resources>
<ui:ToggleSwitch Margin="0,5,0,0" IsOn="{Binding IsPaneOpen}" />
<TextBlock <TextBlock
Margin="0,10"
Cursor="Hand" Cursor="Hand"
FontSize="20" FontSize="20"
Foreground="#F4F4F4" Foreground="#F4F4F4"
Text="Dummy active"> Text="Dummy active" />
<TextBlock.LayoutTransform>
<RotateTransform Angle="270" />
</TextBlock.LayoutTransform>
</TextBlock>
<TextBlock <TextBlock
Margin="0,10"
Cursor="Hand" Cursor="Hand"
FontSize="20" FontSize="20"
Foreground="#808080" Foreground="#808080"
Text="Dummy inactive"> Text="Dummy inactive" />
<TextBlock.LayoutTransform> </ui:SimpleStackPanel>
<RotateTransform Angle="270" />
</TextBlock.LayoutTransform>
</TextBlock>
</StackPanel>
</Border> </Border>
<TreeView <ui:SplitView
Grid.Column="1" Grid.Column="1"
MinWidth="180" BorderThickness="0"
BorderThickness="0"> DisplayMode="Inline"
IsPaneOpen="{Binding IsPaneOpen}"
PanePlacement="Left">
<ui:SplitView.Pane>
<TreeViewItem Header="Root" IsExpanded="True"> <TreeViewItem Header="Root" IsExpanded="True">
<TreeViewItem Header="Child1" /> <TreeViewItem Header="Child1" />
<TreeViewItem Header="Child2" /> <TreeViewItem Header="Child2" />
<TreeViewItem Header="Child3" /> <TreeViewItem Header="Child3" />
</TreeViewItem> </TreeViewItem>
</TreeView> </ui:SplitView.Pane>
<TabControl Grid.Column="2"> <TabControl>
<TabItem Header="Bolt"> <TabItem Header="Bolt">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -254,10 +263,10 @@
IsActive="{Binding BooleanValue}" IsActive="{Binding BooleanValue}"
Visibility="{Binding VisibilityEnumTest}" /> Visibility="{Binding VisibilityEnumTest}" />
<propertyPresenter:PropertyPresenter Label="Visi" Value="{Binding VisibilityEnumTest}" /> <propertyPresenter:PropertyPresenter Label="Visi" Value="{Binding VisibilityEnumTest}" />
<TextBox Text="Dummy" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</TabItem> </TabItem>
</TabControl> </TabControl>
</ui:SplitView>
</Grid> </Grid>
</DockPanel> </DockPanel>
</Window> </Window>

View File

@ -18,6 +18,7 @@ namespace ModernWpfPlayground
private string _title = AppName; private string _title = AppName;
private readonly ISerializer _serializer; private readonly ISerializer _serializer;
private readonly IDeserializer _deserializer; private readonly IDeserializer _deserializer;
private bool _isPaneOpen = true;
public MainWindowViewModel() public MainWindowViewModel()
{ {
@ -105,6 +106,12 @@ namespace ModernWpfPlayground
set => SetProperty(value); set => SetProperty(value);
} }
public bool IsPaneOpen
{
get => _isPaneOpen;
set => SetProperty(ref _isPaneOpen, value);
}
private static void SetTheme(ThemeMode themeMode) private static void SetTheme(ThemeMode themeMode)
{ {
ThemeManager.Current.ApplicationTheme = themeMode switch ThemeManager.Current.ApplicationTheme = themeMode switch

View File

@ -9,7 +9,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="FastMember" Version="1.5.0" /> <PackageReference Include="FastMember" Version="1.5.0" />
<PackageReference Include="ModernWpfUI" Version="0.8.2" /> <PackageReference Include="ModernWpfUI" Version="0.8.3" />
<PackageReference Include="Prism.DryIoc" Version="7.2.0.1422" /> <PackageReference Include="Prism.DryIoc" Version="7.2.0.1422" />
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" /> <PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
<PackageReference Include="YamlDotNet" Version="8.1.0" /> <PackageReference Include="YamlDotNet" Version="8.1.0" />