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

Window.SetTitleBar method is missed in WinUI/Uwp #2559

Closed
BorzillaR opened this issue May 28, 2020 · 5 comments
Closed

Window.SetTitleBar method is missed in WinUI/Uwp #2559

BorzillaR opened this issue May 28, 2020 · 5 comments
Labels
area-TitleBar Issues related to custom window title bars. needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Reach Issue for the Reach team

Comments

@BorzillaR
Copy link

Can`t find a Window.Current.SetTitleBar method on migrating my project from Uwp to WinUI/Uwp. Was it renamed?

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label May 28, 2020
@mdtauk
Copy link
Contributor

mdtauk commented May 28, 2020

It is not present at the moment, part of the limitations of the preview.

@StephenLPeters StephenLPeters added product-winui3 WinUI 3 issues needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) and removed needs-triage Issue needs to be triaged by the area owners product-winui3 WinUI 3 issues labels May 28, 2020
@chill-github
Copy link

I need this as well. I'm working on a port of our UWP application to WinUI and ran into this issue.

@sjb-sjb
Copy link

sjb-sjb commented Nov 24, 2020

I need this to port my UWP app to a WinUI 3 desktop application (the port is necessary to take advantage of NET 5).

@codendone
Copy link
Contributor

Window.SetTitleBar is now available in Preview 4, along with neighboring Window.ExtendsContentIntoTitleBar: API doc

@luckyluka
Copy link

luckyluka commented May 18, 2021

Just a quick clarification needed regarding .setTitleBar() usage.

MainWindow.xaml

<Window
    
    x:Class="Wrath.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Wrath"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    
    <Grid>
        <!-- ... -->
        <TextBlock x:Name="CustomTitleBar">Custom title text</TextBlock>

        <!-- ... -->


    </Grid>
</Window>

MainWindow.xaml.cpp

MainWindow::ExtendsContentIntoTitleBar(true);
MainWindow::SetTitleBar(?);

Do I have to make CustomTitleBar a UIElement, if so, how?

Or am I missing something here?

This is based on the example (only for .cs) provided from:

https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.window.settitlebar?view=winui-3.0

@bpulliam bpulliam added the area-TitleBar Issues related to custom window title bars. label Oct 8, 2021
@bpulliam bpulliam closed this as completed Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TitleBar Issues related to custom window title bars. needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Reach Issue for the Reach team
Projects
None yet
Development

No branches or pull requests

10 participants