//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Initializes a new instance of the WinUI.Vm.WindowVm class. </summary> /// /// <param name="titleBarVm"> The title bar view model. </param> /// <param name="ownerWindow"> The window that owns this item. </param> //////////////////////////////////////////////////////////////////////////////////////////////////// public WindowVm(IExtWindow ownerWindow, TitleBarVm?titleBarVm = null) { _ownerWindow = ownerWindow; //If null then this is a lookless window. if (titleBarVm == null) { return; } _titleBarVm = titleBarVm; _titleBarVm.CloseWindowCmd = new DelegateCmd(_ownerWindow.Close); _titleBarVm.MinimizeWindowCmd = new DelegateCmd(_ownerWindow.Minimize); _titleBarVm.MaximizeWindowCmd = new DelegateCmd(_ownerWindow.Maximize); _titleBarVm.RestoreWindowCmd = new DelegateCmd(_ownerWindow.Restore); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Initializes a new instance of the WinUI.Vm.MainPageVm class. </summary> /// /// <param name="dialogService"> The dialog service. </param> /// <param name="ownerWindow"> The window that owns this item. </param> //////////////////////////////////////////////////////////////////////////////////////////////////// public MainPageVm( IDialogService dialogService, IExtWindow ownerWindow) { OwnerWindow = ownerWindow; DialogService = dialogService; _toggleNonClientVisibilityButtonVm = new ToggleButtonVm <MainPageVm>(ToggleNonClientVisibility, "Show Non-Client Area", true); _addWindowTransparencyButtonVm = new ButtonVm <MainPageVm>(async mp => await AddWindowTransparencyWithConfirmTask(mp), "Set Transparency"); _removeWindowTransparencyButtonVm = new ButtonVm <MainPageVm>(RemoveWindowTransparency, "Remove Transparency", false); _sizeToContentButtonVm = new ButtonVm <MainPageVm>(SizeToContent, "Size to Content"); }