Skip to content

Conversation

@niels9001
Copy link
Collaborator

@niels9001 niels9001 commented Jun 30, 2025

Description

This PR creates a XAML-defined MainWindow for improved maintaining of the shell UX going forward. It also uses the new TitleBar control and moving the searchbox to the top of the window, following UX-guidance and saving some vertical space in the NavView.

Closes: #1736

[DO NOT MERGE]: Blocked on TitleBar bugs

For TitleBar samples, see: #1797

{
item.IsSelected = true;
}
//if (e.Parameter is NavigationRootPageArgs args && args.NavigationRootPage.NavigationView.MenuItems.OfType<NavigationViewItem>().FirstOrDefault(item => item.Name == "AllControlsItem") is NavigationViewItem item)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oversight, I guess! Would you mind taking a look at this to get this PR in?

@ghost1372 ghost1372 mentioned this pull request Jul 10, 2025
@niels9001
Copy link
Collaborator Author

I'll update this PR with a custom TitleBar so we are not blocked by the known issues. (Or if someone else can do it if they want to jump in :). The titlebar from Windows Community Toolkit Labs would be a great start!

@Jay-o-Way
Copy link
Contributor

What exactly was the problem up til now? And cant we choose to work around it, or just use it with a relatively small imperfection?
Using something else now, and changing it again when the WASDK/WinUi control is perfect, is more work.

@marcelwgn
Copy link
Contributor

I think for now it is fine to keep the titlebar implementation we currently have and focus on decluttering the files and their purpose. WinUI 3 titlebar has some bugs including making resizing the window sometimes hide window content so we should not introduce known regressions like that.

@Zakariathr22
Copy link
Contributor

As a workaround, could we avoid using the IconSource property of the TitleBar control and instead place an icon in the left header of the TitleBar?

@niels9001
Copy link
Collaborator Author

As a workaround, could we avoid using the IconSource property of the TitleBar control and instead place an icon in the left header of the TitleBar?

Yeah that works. Would you mind create a Pr against this branch so we can merge that in and get this PR ready for review too?

@Zakariathr22
Copy link
Contributor

As a workaround, could we avoid using the IconSource property of the TitleBar control and instead place an icon in the left header of the TitleBar?

Yeah that works. Would you mind create a Pr against this branch so we can merge that in and get this PR ready for review too?

…the GalleryIcon.ico (#1915)

<!--- Provide a general summary of your changes in the Title above -->

## Description
This PR targets #1908.

## Motivation and Context
- It provides a temporary workaround for
microsoft/microsoft-ui-xaml#10427.

## How Has This Been Tested?
Manually tested

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

---------

Co-authored-by: Niels Laute <niels.laute@live.nl>
@niels9001 niels9001 marked this pull request as ready for review July 12, 2025 16:00
@niels9001
Copy link
Collaborator Author

Thanks @Zakariathr22 ! This PR is now ready for review (cc @marcelwgn).

1 similar comment
@niels9001
Copy link
Collaborator Author

Thanks @Zakariathr22 ! This PR is now ready for review (cc @marcelwgn).

ghost1372 added a commit to ghost1372/WinUI-Gallery that referenced this pull request Jul 13, 2025
Copy link
Contributor

@marcelwgn marcelwgn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work and cool that we can also use the new TitleBar control (though I certainly need some time to get used to that centered search bar)

@marcelwgn
Copy link
Contributor

/azp run

@niels9001
Copy link
Collaborator Author

Hmm, looks like the UI tests are failing because of some of these changes.

@ghost1372

This comment has been minimized.

@marcelwgn
Copy link
Contributor

I will look at the test failure, the search box got renamed and the new UIA name of the search field seems to be "TextBox"...

@marcelwgn
Copy link
Contributor

/azp run

@marcelwgn
Copy link
Contributor

/azp run

@niels9001
Copy link
Collaborator Author

I will look at the test failure, the search box got renamed and the new UIA name of the search field seems to be "TextBox"...

That seemed to work 🚀🚀

@marcelwgn marcelwgn merged commit 149817b into main Jul 21, 2025
2 checks passed
@marcelwgn marcelwgn deleted the niels9001/mainwindow branch July 21, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a MainWindow + new titlebar

6 participants