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

Unable to hide title bar fron window with blazor hybrid on Windows #17181

Closed
franklbt opened this issue Sep 2, 2023 · 5 comments
Closed

Unable to hide title bar fron window with blazor hybrid on Windows #17181

franklbt opened this issue Sep 2, 2023 · 5 comments
Labels
platform/windows 🪟 s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@franklbt
Copy link

franklbt commented Sep 2, 2023

Description

I cannot hide the titlebar space on Windows, despite trying different techniques

Steps to Reproduce

  1. Create a new MAUI Blazor hybrid app
  2. Add this code in the MauiProgram.cs:
#if WINDOWS
        builder.ConfigureLifecycleEvents(events =>
        {
            events.AddWindows(b => b.OnWindowCreated(win =>
            {
                if (win is not MauiWinUIWindow { AppWindow.Presenter: OverlappedPresenter pre })
                    return;
                
                pre.SetBorderAndTitleBar(true, false);
            }));
        });
#endif
  1. Add this code to the Platforms/Windows/App.xaml
 <maui:MauiWinUIApplication.Resources>
        <ResourceDictionary>
              <Style TargetType="platform:WindowRootView">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="platform:WindowRootView">
                            <Page Margin="0" Padding="0" x:Name="RootPage">
                                <Grid x:Name="RootGrid" RowSpacing="0" ColumnSpacing="0" Margin="0" Padding="0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <ContentControl x:Name="AppTitleBarContainer"
                                                    IsTabStop="False"
                                                    VerticalAlignment="Top"
                                                    VerticalContentAlignment="Stretch"
                                                    HorizontalContentAlignment="Stretch"
                                                    Canvas.ZIndex="1"
                                                    Margin="{Binding WindowTitleBarContainerMargin}"
                                                    DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                    ContentTemplateSelector="{StaticResource MauiAppTitleBarContainerTemplateSelector}">
                                    </ContentControl>
                                    <ContentPresenter Canvas.ZIndex="0"></ContentPresenter>
                                </Grid>
                            </Page>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </maui:MauiWinUIApplication.Resources>
  1. Notice that the space for the title bar remains

Link to public reproduction project repository

No response

Version with bug

8.0.0-preview.7.8842

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

WindowsAppSDK 10.0.22621.0

Did you find any workaround?

No

Relevant log output

No response

@franklbt franklbt added the t/bug Something isn't working label Sep 2, 2023
@jfversluis
Copy link
Member

Could you see if #17041 maybe fixes it or if the linked issue on that PR seems a duplicate of this issue?

@jfversluis jfversluis added platform/windows 🪟 s/needs-info Issue needs more info from the author labels Sep 4, 2023
@ghost
Copy link

ghost commented Sep 4, 2023

Hi @franklbt. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@franklbt
Copy link
Author

franklbt commented Sep 4, 2023

@jfversluis in fact the linked issue seems to match the one I submitted.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Sep 4, 2023
@jfversluis
Copy link
Member

Alright, marking this as duplicate then, please track the PR/issue for progress, thanks!

@jfversluis
Copy link
Member

Duplicate of #15676

@jfversluis jfversluis marked this as a duplicate of #15676 Sep 4, 2023
@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/windows 🪟 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants