This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Part 2 : Gone with Wind32 Titlebar
- [x] Maximize button is only visible when not already maximized - [x] Restore button is only visibile when Window is maximized - [x] WindowRootGrid is now called WindowRoot - [x] Added a WindowRoot view model - [x] Added a Window State Enum for Minimized, Maximized and Other Please see my prior check-in for the first push towards the effort to create a lookless Window where the Win32 border and Titlebar are never used, but all features they would provide still exist. Other than cleanup and my normal addiction to refactoring, most of the work is complete for this feature. With what I have now, there will be some confusion when it comes to a UIElements child/children/Content etc. For example, the WindowRoot inherits from the UWP LayoutTransformControl that actually inherits from Grid. The LayoutTransformControl has a member called Child. When I inherit from LayoutTransformControl I set the Child with another Grid that has two rows. One row is in fact the Titlebar and the other is the clients content (what we normally think of as the Window.Content. I place the client content into the second row by providing a property called Content. So, when you look at the inheritence path, the LayoutTransformControl has Grid.Children that it provides access to via its single LayoutTransformControl.Child. I inherit from this control and provide the WindowRoot.Content property. I am not sure which is more confusing, my explanation of this or the implementation of it. The TitleBar control had four event handlers that were dead code that I removed. In Program.cs I updated the InitializeServices method to change the scope of several injected services to be Transients because that scope causes much less concerns about lifetime and even though my example is simple, I didn't want it to be copied and pasted into the wild as a bunch of singletons. Until this check-in, the Titlebar was part of the MainPage (was once called the SettingsPage). However, I pushed that logic up closer to the actual Window itself because I do not want a page to have to concern itself with the Window's titlebar. On a final random check-in note, I never like the fact that XAML files need to provide a default parameter-less constructor to please the Visual Studio designer. When using nullable, it causes a real pain because the existence of that constructor means that you have to protect those properties by null checking them or disable the related analyzer warnings. Even though WinUI doesn't work with a designer right now, I figured I would code this as if it does.
- Loading branch information
Showing
17 changed files
with
434 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.