/// <summary> /// Default Constructor /// </summary> public WindowViewModel(Window window) { mWindow = window; // Listen out for the window resizing mWindow.StateChanged += (sender, e) => { // Fire off events of all properties that are affected by a resize OnPropertyChanged(nameof(ResizeBorderThickness)); OnPropertyChanged(nameof(OuterMarginSize)); OnPropertyChanged(nameof(OuterMarginSizeThickness)); OnPropertyChanged(nameof(WindowRadius)); OnPropertyChanged(nameof(WindowCornerRadius)); }; // Create Commands SearchCommand = new RelayParameterizedCommand(async(parameter) => await Search(parameter)); MinimizeCommand = new RelayCommand(() => mWindow.WindowState = WindowState.Minimized); MaximizeCommand = new RelayCommand(() => mWindow.WindowState ^= WindowState.Maximized); CloseCommand = new RelayCommand(() => CloseWindow()); MenuCommand = new RelayCommand(() => SystemCommands.ShowSystemMenu(mWindow, GetMousePosition())); // Fix window resize issue var resizer = new WindowResizer(mWindow); }
/// <summary> /// Default constructor /// </summary> public LoginViewModel() { LoginCommand = new RelayParameterizedCommand(async(parameter) => await Login(parameter)); }
/// <summary> /// Default constructor /// </summary> public CreateViewModel() { CreateCommand = new RelayParameterizedCommand(async(parameter) => await Create(parameter)); }