Skip to content

Conversation

@Tamilarasan-Paranthaman
Copy link
Contributor

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman commented Sep 30, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

  • Implemented a new TitleFontAttributes property on the TitleBar to control the font style of the window title.
    • Default value is Bold (to highlight the app title).
    • Users can customize it to Italic, Bold, or None as needed.

Public API Changes

  • New Property Added: TitleFontAttributes (on TitleBar)
  • Type: FontAttributes
  • Default Value: Bold
  • Description: Controls the font style of the window title. Supports Bold, Italic, and None.

Screenshot

Windows Mac
Windows-TitleBar.mp4
Mac-TitleBar.mov

Usage Example

Xaml:

<Window.TitleBar>
    <TitleBar Title="My App"
              TitleFontAttributes="Italic" />
</Window.TitleBar>

C#:

public partial class App : Application
{
  protected override Window CreateWindow(IActivationState? activationState)
  {
     var window = new Window(new SandboxShell());
     window.TitleBar = new TitleBar
     {
      Title = "MauiApp",
      TitleFontAttributes = FontAttributes.Bold,
     };

   return window;
  }
}
 

Issues Fixed

Fixes #24627

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Sep 30, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review September 30, 2025 08:06
@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 08:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new TitleFontAttributes property to the TitleBar control that allows developers to customize the font style (Bold, Italic, None) of the window title text, with Bold as the default value to enhance app title visibility.

  • Added TitleFontAttributes property to TitleBar with FontAttributes.Bold as default
  • Updated TitleBar template to bind the new property to the title label
  • Added comprehensive UI tests to verify the font attributes functionality

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

File Description
src/Controls/src/Core/TitleBar/TitleBar.cs Added TitleFontAttributes property with Bold default and binding to title label
src/Controls/tests/TestCases.HostApp/Issues/Issue24627.cs Created test page to demonstrate title font attributes with toggle functionality
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24627.cs Added UI tests to verify Bold default and None toggle behavior
src/Controls/src/Core/PublicAPI/**/PublicAPI.Unshipped.txt Updated public API surface for all platforms to include new property

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing related tests:
image

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman force-pushed the TitleBar-Title-FontAttributes branch from 22fb331 to 026f347 Compare October 1, 2025 07:46
@Tamilarasan-Paranthaman
Copy link
Contributor Author

Failing related tests: image

@jsuarezruiz, I have updated the test sample, and committed the images

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

public static readonly BindableProperty ForegroundColorProperty = BindableProperty.Create(nameof(ForegroundColor),
typeof(Color), typeof(TitleBar));

/// <summary>Bindable property for <see cref="TitleFontAttributes"/>.</summary>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use bold by default? Using None maintain backward compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I have changed the default value to FontAttributes.None to maintain backward compatibility.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-titlebar community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/macos macOS / Mac Catalyst platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants