Title Bar Invisible when adding Frame
Issue type
sample request
Which version of the app?
WinUI 3 Gallery
Description
When I add this code to my App.xaml `Frame rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; // Navigate to the first page, configuring the new page // by passing required information as a navigation parameter rootFrame.Navigate(typeof(LoginPage), args.Arguments);
// Place the frame in the current Window m_window.Content = rootFrame;`
The title Bar is vanishing and not visible on the page.
When i remove this part the title is bar is set but i want different frames and titlebar.
Screenshots
Windows version
Insider Build (xxxxx)
Additional context
No response
Hi, unfortunately I'm unable to reproduce this issue. Can you share the code of your LoginPage? I'm inclined to say that there might be the issue.
Is there any update with this? I am experiencing this exact issue.
I am using a fully custom titlebar per: https://learn.microsoft.com/en-us/windows/apps/develop/title-bar#full-customization-example.
When I add frame navigation to my OnLaunched event in the App.xaml.cs file, the title bar is removed. (per https://learn.microsoft.com/en-us/windows/apps/design/basics/navigate-between-two-pages?tabs=wasdk)
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
m_window = new MainWindow();
// Create a Frame to act as the navigation context and navigate to the first page
Frame rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
// Navigate to the first page, configuring the new page
// by passing required information as a navigation parameter
rootFrame.Navigate(typeof(MainPage), args.Arguments);
// Place the frame in the current Window
m_window.Content = rootFrame;
// Ensure the MainWindow is active
m_window.Activate();
}
By omitting "m_window.Content = rootFrame;", my custom titlebar is left in tact, however, obviously my application will now no longer navigate to the desired page.
Is there any update with this? I am experiencing this exact issue.
I am using a fully custom titlebar per: https://learn.microsoft.com/en-us/windows/apps/develop/title-bar#full-customization-example.
When I add frame navigation to my OnLaunched event in the App.xaml.cs file, the title bar is removed. (per https://learn.microsoft.com/en-us/windows/apps/design/basics/navigate-between-two-pages?tabs=wasdk)
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { m_window = new MainWindow(); // Create a Frame to act as the navigation context and navigate to the first page Frame rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; // Navigate to the first page, configuring the new page // by passing required information as a navigation parameter rootFrame.Navigate(typeof(MainPage), args.Arguments); // Place the frame in the current Window m_window.Content = rootFrame; // Ensure the MainWindow is active m_window.Activate(); }By omitting "m_window.Content = rootFrame;", my custom titlebar is left in tact, however, obviously my application will now no longer navigate to the desired page.
Can you attach a repro app? Thanks in advance!