/// <summary> /// Default constructor /// </summary> public WindowViewModel(Window window) { mWindow = window; mWindow.StateChanged += (sender, e) => { OnPropertyChanged(("ResizeBorder")); OnPropertyChanged(("ResizeBorderThickness")); OnPropertyChanged(("OuterMarginSize")); OnPropertyChanged(("OuterMarginThickness")); OnPropertyChanged(("WindowRadius")); OnPropertyChanged(("WindowCornerRadius")); }; MinimizeCommand = new RelayCommand(() => mWindow.WindowState = WindowState.Minimized); MaximizeCommand = new RelayCommand(() => mWindow.WindowState ^= WindowState.Maximized); CloseCommand = new RelayCommand(() => mWindow.Close()); MenuCommand = new RelayCommand(() => SystemCommands.ShowSystemMenu(mWindow, GetMousePosition())); WindowMinimumWidth = 800; TitleHeight = 42; MainWindowInnerPadding = 0; WindowMinimumHeight = 400; Instance = this; CurrentPage = ApplicationPage.Login; }
public MainWindow() { InitializeComponent(); DataContext = new WindowViewModel(this); }