Ejemplo n.º 1
0
        public WindowViewModel(Window window)
        {
            this.mWindow = window;

            //Check the syntax, analize the way it works
            mWindow.StateChanged += (sender, e) =>
            {
                OnPropertyChanged(nameof(ResizeBorderThickness));
                OnPropertyChanged(nameof(OuterMarginSize));
                OnPropertyChanged(nameof(OuterMarginSizeThickness));
                OnPropertyChanged(nameof(WindowRadius));
                OnPropertyChanged(nameof(WindowCornerRadius));
            };

            MinimalizeCommand = new RelayCommand(() => mWindow.WindowState = WindowState.Minimized);
            MaximalizeCommand = new RelayCommand(() => mWindow.WindowState ^= WindowState.Maximized);
            CloseCommand      = new RelayCommand(() => mWindow.Close());
            MenuCommand       = new RelayCommand(() => SystemCommands.ShowSystemMenu(mWindow, WindowTools.GetMousePosition(mWindow)));
        }