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

Provide a cross platform API for customizing the TitleBar of desktop apps #13023

Closed
2 of 6 tasks
PureWeen opened this issue Jan 31, 2023 · 5 comments · Fixed by #23019
Closed
2 of 6 tasks

Provide a cross platform API for customizing the TitleBar of desktop apps #13023

PureWeen opened this issue Jan 31, 2023 · 5 comments · Fixed by #23019
Assignees
Labels
area-controls-window Window fixed-in-8.0.80 fixed-in-9.0.0-preview.7.24407.4 partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with partner/winui WinUI / Project Reunion platform/iOS 🍎 proposal/open t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK) User Story A single user-facing feature. Can be grouped under an epic.

Comments

@PureWeen
Copy link
Member

PureWeen commented Jan 31, 2023

Description

Currently the TitleBar on WinUI isn't easily changeable from the xplat code. Users can modify the WinUI AppTitleBar through resources #5811 but ideally you could configure it through xplat code.

On Catalyst we currently have no way to do this other than users just adding the behavior themselves through the handler and hacking the layouts to work.

Related Issues

(Public) API Changes

TitleBar Control

This control is mostly based on the control in the WinAppSDK 1.6 Preview:
image

Properties

API Type Description
Icon ImageSource The ImageSource for the TitleBar icon
LeadingContent IView Leading content, appears before the Content, allows full hit test
Content IView Centered content, allows full hit test
TrailingContent IView Trailing content, appears after the Content, allows full hit test
Title string The title text of the window
Subtitle string The subtitle text, follows the title text
BackgroundColor Color The background color
ForegroundColor Color The foreground color of the Title and Subtitle text
InactiveBackgroundColor Color The background color of the TitleBar when the window is not in focus
InactiveForegroundColor Color The foreground color of the Title and Subtitle text when the window is not focused
IsVisible bool Setting this to False will hide the TitleBar

Window

Methods

API Description
SetTitleBar(TitleBar) Sets the TitleBar

Usage Scenarios

XAML

<ContentPage>
     <TitleBar
         x:Name="MyTitleBar"
         Title="{Binding Title}" />
         <TitleBar.Content>
             <Entry
                 Text="{Binding SearchInput}"/>
         </TitleBar.Content>
...

Backing .cs

protected override void OnAppearing()
{
    base.OnAppearing();
    Window.SetTitleBar(MyTitleBar);
}

Backward Compatibility

N/A

Difficulty

High

VS bug #1864265

@PureWeen PureWeen added this to the Backlog milestone Jan 31, 2023
@ghost
Copy link

ghost commented Jan 31, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@PureWeen PureWeen added platform/iOS 🍎 partner/winui WinUI / Project Reunion partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with labels Jan 31, 2023
@Eilon Eilon added the legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) label Jan 31, 2023
@samhouts samhouts added the User Story A single user-facing feature. Can be grouped under an epic. label May 2, 2023
@lfmouradasilva
Copy link

Any updates on this issue?

@bdovaz
Copy link

bdovaz commented Dec 4, 2023

Any updates on this issue?

@Foda Here I see in the final sentence of the comment you mention new APIs:

#18773 (comment)

But with In the next release how far is it? Minor release? Major release (.NET 9)?

@bdovaz
Copy link

bdovaz commented Dec 4, 2023

I have been trying to do a complex customization and have found myself at a dead end:

#19192

@mhrastegari
Copy link

Any updates on this? :(

@PureWeen PureWeen modified the milestones: Backlog, .NET 9 Planning Mar 4, 2024
@Eilon Eilon added the t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK) label May 10, 2024
@Eilon Eilon added area-controls-window Window and removed legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) labels May 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-window Window fixed-in-8.0.80 fixed-in-9.0.0-preview.7.24407.4 partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with partner/winui WinUI / Project Reunion platform/iOS 🍎 proposal/open t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK) User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants