Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title Bar Invisible when adding Frame #1434

Open
ashwith2427 opened this issue Jan 26, 2024 · 3 comments
Open

Title Bar Invisible when adding Frame #1434

ashwith2427 opened this issue Jan 26, 2024 · 3 comments
Assignees

Comments

@ashwith2427
Copy link

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

image

Windows version

Insider Build (xxxxx)

Additional context

No response

@marcelwgn
Copy link
Collaborator

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.

@i8jtb
Copy link

i8jtb commented May 9, 2024

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.

@karkarl
Copy link
Collaborator

karkarl commented May 16, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Repro Needed
Development

No branches or pull requests

4 participants