mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-04-19 06:53:50 +02:00
binding window height and width and saving properties to file.
This commit is contained in:
parent
a5d05e05a3
commit
c44931c11e
@ -1,5 +1,4 @@
|
||||
|
||||
<Window
|
||||
<Window
|
||||
x:Class="ModernWpfPlayground.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@ -11,8 +10,8 @@
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
x:Name="Window"
|
||||
Title="{Binding Title}"
|
||||
Width="1200"
|
||||
Height="600"
|
||||
Width="{Binding WindowWidth, Mode=TwoWay}"
|
||||
Height="{Binding WindowHeight, Mode=TwoWay}"
|
||||
d:DataContext="{d:DesignInstance local:MainWindowViewModel}"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
ui:ThemeManager.IsThemeAware="True"
|
||||
|
@ -93,6 +93,18 @@ namespace ModernWpfPlayground
|
||||
set => SetProperty(value, SetTheme);
|
||||
}
|
||||
|
||||
public int WindowWidth
|
||||
{
|
||||
get => GetProperty(1200);
|
||||
set => SetProperty(value);
|
||||
}
|
||||
|
||||
public int WindowHeight
|
||||
{
|
||||
get => GetProperty(600);
|
||||
set => SetProperty(value);
|
||||
}
|
||||
|
||||
private static void SetTheme(ThemeMode themeMode)
|
||||
{
|
||||
ThemeManager.Current.ApplicationTheme = themeMode switch
|
||||
|
Loading…
x
Reference in New Issue
Block a user