- /// The standard title bar height is 32px, but can be set to a larger value.
- ///
- /// The title bar can also be hidden by setting the property, which
- /// will cause the window content to be displayed in the title bar region.
- ///
- public partial class TitleBar : TemplatedView, ITitleBar, ISafeAreaView
- {
- public const string TemplateRootName = "PART_Root";
-
- public const string TitleBarIcon = "PART_Icon";
- public const string IconVisibleState = "IconVisible";
- public const string IconHiddenState = "IconCollapsed";
-
- public const string TitleBarTitle = "PART_Title";
- public const string TitleVisibleState = "TitleVisible";
- public const string TitleHiddenState = "TitleCollapsed";
-
- public const string TitleBarSubtitle = "PART_Subtitle";
- public const string SubtitleVisibleState = "SubtitleVisible";
- public const string SubtitleHiddenState = "SubTitleCollapsed";
-
- public const string TitleBarLeading = "PART_LeadingContent";
- public const string LeadingVisibleState = "LeadingContentVisible";
- public const string LeadingHiddenState = "LeadingContentCollapsed";
-
- public const string TitleBarContent = "PART_Content";
- public const string ContentVisibleState = "ContentVisible";
- public const string ContentHiddenState = "ContentCollapsed";
-
- public const string TitleBarTrailing = "PART_TrailingContent";
- public const string TrailingVisibleState = "TrailingContentVisible";
- public const string TrailingHiddenState = "TrailingContentCollapsed";
-
- public const string TitleBarActiveState = "TitleBarTitleActive";
- public const string TitleBarInactiveState = "TitleBarTitleInactive";
-
- /// Bindable property for .
- public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(ImageSource),
- typeof(TitleBar), null, propertyChanged: OnIconChanged);
-
- /// Bindable property for .
- public static readonly BindableProperty LeadingContentProperty = BindableProperty.Create(nameof(LeadingContent), typeof(IView),
- typeof(TitleBar), null, propertyChanged: OnLeadingChanged);
-
- /// Bindable property for .
- public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(IView),
- typeof(TitleBar), null, propertyChanged: OnContentChanged);
-
- /// Bindable property for .
- public static readonly BindableProperty TrailingContentProperty = BindableProperty.Create(nameof(TrailingContent), typeof(IView),
- typeof(TitleBar), null, propertyChanged: OnTrailingContentChanged);
-
- /// Bindable property for .
- public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string),
- typeof(TitleBar), null, propertyChanged: OnTitleChanged);
-
- /// Bindable property for .
- public static readonly BindableProperty SubtitleProperty = BindableProperty.Create(nameof(Subtitle), typeof(string),
- typeof(TitleBar), null, propertyChanged: OnSubtitleChanged);
-
- /// Bindable property for .
- public static readonly BindableProperty ForegroundColorProperty = BindableProperty.Create(nameof(ForegroundColor),
- typeof(Color), typeof(TitleBar));
-
- static void OnLeadingChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var titlebar = (TitleBar)bindable;
- if (newValue is null)
- {
- titlebar.ApplyVisibleState(LeadingHiddenState);
- }
- else
- {
- titlebar.ApplyVisibleState(LeadingVisibleState);
- }
- }
-
- static void OnIconChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var titlebar = (TitleBar)bindable;
- var imageSource = newValue as ImageSource;
- if (imageSource is null || imageSource.IsEmpty)
- {
- titlebar.ApplyVisibleState(IconHiddenState);
- }
- else
- {
- titlebar.ApplyVisibleState(IconVisibleState);
- }
- }
-
- static void OnTitleChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var titlebar = (TitleBar)bindable;
- if (newValue is null)
- {
- titlebar.ApplyVisibleState(TitleHiddenState);
- }
- else
- {
- titlebar.ApplyVisibleState(TitleVisibleState);
- }
- }
-
- static void OnSubtitleChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var titlebar = (TitleBar)bindable;
- if (newValue is null)
- {
- titlebar.ApplyVisibleState(SubtitleHiddenState);
- }
- else
- {
- titlebar.ApplyVisibleState(SubtitleVisibleState);
- }
- }
-
- static void OnContentChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var titlebar = (TitleBar)bindable;
- if (newValue is null)
- {
- titlebar.ApplyVisibleState(ContentHiddenState);
- }
- else
- {
- titlebar.ApplyVisibleState(ContentVisibleState);
- }
- }
-
- static void OnTrailingContentChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var titlebar = (TitleBar)bindable;
- if (newValue is null)
- {
- titlebar.ApplyVisibleState(TrailingHiddenState);
- }
- else
- {
- titlebar.ApplyVisibleState(TrailingVisibleState);
- }
- }
-
- ///
- /// Gets or sets an optional icon image of the title bar. Icon images should be
- /// 16x16 pixels in size.
- ///
- /// Setting this property to an empty value will hide the icon.
- ///
- public ImageSource Icon
- {
- get { return (ImageSource)GetValue(IconProperty); }
- set { SetValue(IconProperty, value); }
- }
-
- ///
- /// Gets or sets a control that represents the leading content.
- /// The leading content follows the optional and is aligned to
- /// the left or right of the title bar, depending on the . Views
- /// set here will be allocated as much space as they require.
- ///
- /// Views set here will block all input to the title bar region and handle input directly.
- ///
- public IView? LeadingContent
- {
- get { return (View?)GetValue(LeadingContentProperty); }
- set { SetValue(LeadingContentProperty, value); }
- }
-
- ///
- /// Gets or sets the title text of the title bar. The title usually specifies
- /// the name of the application or indicates the purpose of the window
- ///
- public string Title
- {
- get { return (string)GetValue(TitleProperty); }
- set { SetValue(TitleProperty, value); }
- }
-
- ///
- /// Gets or sets the subtitle text of the title bar. The subtitle usually specifies
- /// the secondary information about the application or window
- ///
- public string Subtitle
- {
- get { return (string)GetValue(SubtitleProperty); }
- set { SetValue(SubtitleProperty, value); }
- }
-
- ///
- /// Gets or sets a control that represents the content.
- /// This content is centered in the title bar, and is allocated the remaining space
- /// between the leading and trailing content.
- ///
- /// Views set here will block all input to the title bar region and handle input directly.
- ///
- public IView? Content
- {
- get { return (View?)GetValue(TitleBar.ContentProperty); }
- set { SetValue(TitleBar.ContentProperty, value); }
- }
-
- ///
- /// Gets or sets a control that represents the trailing content.
- /// The trailing content is aligned to the right or left of the title bar, depending
- /// on the . Views set here will be allocated as much space
- /// as they require.
- ///
- /// Views set here will block all input to the title bar region and handle input directly.
- ///
- public IView? TrailingContent
- {
- get { return (View?)GetValue(TrailingContentProperty); }
- set { SetValue(TrailingContentProperty, value); }
- }
-
- ///
- /// Gets or sets the foreground color of the title bar. This color is used for the
- /// title and subtitle text.
- ///
- public Color ForegroundColor
- {
- get { return (Color)GetValue(ForegroundColorProperty); }
- set { SetValue(ForegroundColorProperty, value); }
- }
-
- ///
- public IList PassthroughElements { get; private set; }
-
- bool ISafeAreaView.IgnoreSafeArea => true;
-
-#nullable disable
- IView IContentView.PresentedContent => (this as IControlTemplated).TemplateRoot as IView;
-#nullable enable
-
- static ControlTemplate? _defaultTemplate;
- View? _templateRoot;
-
- public TitleBar()
- {
- PassthroughElements = new List();
- PropertyChanged += TitleBar_PropertyChanged;
-
- if (ControlTemplate is null)
- {
- ControlTemplate = DefaultTemplate;
- }
- }
-
- private void TitleBar_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
- {
- if (e.PropertyName == nameof(Window) && Window is not null)
- {
- Window.Activated -= Window_Activated;
- Window.Deactivated -= Window_Deactivated;
-
- Window.Activated += Window_Activated;
- Window.Deactivated += Window_Deactivated;
- }
- }
-
- internal void ApplyVisibleState(string stateGroup)
- {
- VisualStateManager.GoToState(this, stateGroup);
-
- if (_templateRoot is not null)
- {
- VisualStateManager.GoToState(_templateRoot, stateGroup);
- }
- }
-
- ///
- /// Gets the default template for the title bar
- ///
- public static ControlTemplate DefaultTemplate
- {
- get
- {
- _defaultTemplate ??= new ControlTemplate(() => BuildDefaultTemplate());
-
- return _defaultTemplate;
- }
- }
-
- protected override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
-
- var controlTemplate = (this as IControlTemplated);
-
- _templateRoot = controlTemplate?.TemplateRoot as View;
-
- if (controlTemplate?.GetTemplateChild(TitleBarLeading) is IView leadingContent)
- {
- PassthroughElements.Add(leadingContent);
- }
-
- if (controlTemplate?.GetTemplateChild(TitleBarContent) is IView content)
- {
- PassthroughElements.Add(content);
- }
-
- if (controlTemplate?.GetTemplateChild(TitleBarTrailing) is IView trailingContent)
- {
- PassthroughElements.Add(trailingContent);
- }
-
- ApplyVisibleState(TitleBarActiveState);
- }
-
- private void Window_Activated(object? sender, System.EventArgs e)
- {
- ApplyVisibleState(TitleBarActiveState);
- }
-
- private void Window_Deactivated(object? sender, System.EventArgs e)
- {
- ApplyVisibleState(TitleBarInactiveState);
- }
-
- static View BuildDefaultTemplate()
- {
- VisualStateGroupList visualStateGroups = new VisualStateGroupList();
-
- #region Root Grid
- var contentGrid = new Grid()
- {
-#if MACCATALYST
- Margin = new Thickness(80, 0, 0, 0),
-#endif
- HorizontalOptions = LayoutOptions.Fill,
- ColumnDefinitions =
- {
- new ColumnDefinition(GridLength.Auto), // Leading content
- new ColumnDefinition(GridLength.Auto), // Icon content
- new ColumnDefinition(GridLength.Auto), // Title content
- new ColumnDefinition(GridLength.Auto), // Subtitle content
- new ColumnDefinition(GridLength.Star), // Content
- new ColumnDefinition(GridLength.Auto), // Trailing content
-#if !MACCATALYST
- new ColumnDefinition(150), // Min drag region + padding for system buttons
-#endif
- }
- };
- BindToTemplatedParent(contentGrid, BackgroundColorProperty, OpacityProperty);
-#endregion
-
- #region Leading content
- var leadingContent = new ContentView()
- {
- IsVisible = false
- };
-
- contentGrid.Add(leadingContent);
- contentGrid.SetColumn(leadingContent, 0);
-
- leadingContent.SetBinding(ContentView.ContentProperty,
- new Binding(LeadingContentProperty.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
-
- var leadingVisibleGroup = GetVisibleStateGroup(TitleBarLeading, LeadingVisibleState, LeadingHiddenState);
- leadingVisibleGroup.Name = "LeadingContentGroup";
- visualStateGroups.Add(leadingVisibleGroup);
- #endregion
-
- #region Icon
- var icon = new Image()
- {
- WidthRequest = 16,
- HeightRequest = 16,
- VerticalOptions = LayoutOptions.Center,
- Margin = new Thickness(16, 0, 0, 0),
- IsVisible = false,
- };
-
- contentGrid.Add(icon);
- contentGrid.SetColumn(icon, 1);
-
- icon.SetBinding(Image.SourceProperty,
- new Binding(IconProperty.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
-
- var iconVisibleGroup = GetVisibleStateGroup(TitleBarIcon, IconVisibleState, IconHiddenState);
- iconVisibleGroup.Name = "IconGroup";
- visualStateGroups.Add(iconVisibleGroup);
- #endregion
-
- #region Title
- var titleLabel = new Label()
- {
- Margin = new Thickness(16, 0),
- LineBreakMode = LineBreakMode.NoWrap,
- HorizontalOptions = LayoutOptions.Start,
- VerticalOptions = LayoutOptions.Center,
- MinimumWidthRequest = 48,
- FontSize = 12,
- IsVisible = false
- };
-
- contentGrid.Add(titleLabel);
- contentGrid.SetColumn(titleLabel, 2);
-
- titleLabel.SetBinding(Label.TextProperty,
- new Binding(TitleProperty.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
-
- titleLabel.SetBinding(Label.TextColorProperty,
- new Binding(ForegroundColorProperty.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
-
- var activeVisualState = new VisualState() { Name = TitleBarActiveState };
- activeVisualState.Setters.Add(
- new Setter()
- {
- Property = Label.OpacityProperty,
- TargetName = TitleBarTitle,
- Value = 1.0
- });
-
- var inactiveVisualState = new VisualState() { Name = TitleBarInactiveState };
- inactiveVisualState.Setters.Add(
- new Setter()
- {
- Property = Label.OpacityProperty,
- TargetName = TitleBarTitle,
- Value = 0.7
- });
-
- var labelActiveStateGroup = new VisualStateGroup() { Name = "TitleActiveStates" };
- labelActiveStateGroup.States.Add(activeVisualState);
- labelActiveStateGroup.States.Add(inactiveVisualState);
- visualStateGroups.Add(labelActiveStateGroup);
-
- var titleVisibleGroup = GetVisibleStateGroup(TitleBarTitle, TitleVisibleState, TitleHiddenState);
- titleVisibleGroup.Name = "TitleTextGroup";
- visualStateGroups.Add(titleVisibleGroup);
- #endregion
-
- #region Subtitle
- var subtitleLabel = new Label()
- {
- Margin = new Thickness(0, 0, 16, 0),
- LineBreakMode = LineBreakMode.NoWrap,
- HorizontalOptions = LayoutOptions.Start,
- VerticalOptions = LayoutOptions.Center,
- MinimumWidthRequest = 48,
- FontSize = 12,
- Opacity = 0.7,
- IsVisible = false
- };
-
- contentGrid.Add(subtitleLabel);
- contentGrid.SetColumn(subtitleLabel, 3);
-
- subtitleLabel.SetBinding(Label.TextProperty,
- new Binding(SubtitleProperty.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
-
- subtitleLabel.SetBinding(Label.TextColorProperty,
- new Binding(ForegroundColorProperty.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
-
- var subtitleVisibleGroup = GetVisibleStateGroup(TitleBarSubtitle, SubtitleVisibleState, SubtitleHiddenState);
- subtitleVisibleGroup.Name = "SubtitleTextGroup";
- visualStateGroups.Add(subtitleVisibleGroup);
- #endregion
-
- #region Content
- var content = new ContentView()
- {
- IsVisible = false
- };
-
- contentGrid.Add(content);
- contentGrid.SetColumn(content, 4);
-
- content.SetBinding(ContentView.ContentProperty,
- new Binding(ContentProperty.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
-
- var contentVisibleGroup = GetVisibleStateGroup(TitleBarContent, ContentVisibleState, ContentHiddenState);
- contentVisibleGroup.Name = "ContentGroup";
- visualStateGroups.Add(contentVisibleGroup);
- #endregion
-
- #region Trailing content
- var trailingContent = new ContentView()
- {
- IsVisible = false
- };
-
- contentGrid.Add(trailingContent);
- contentGrid.SetColumn(trailingContent, 5);
-
- trailingContent.SetBinding(ContentView.ContentProperty,
- new Binding(TrailingContentProperty.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
-
- var trailingContentVisibleGroup = GetVisibleStateGroup(TitleBarTrailing, TrailingVisibleState, TrailingHiddenState);
- trailingContentVisibleGroup.Name = "TrailingContentGroup";
- visualStateGroups.Add(trailingContentVisibleGroup);
- #endregion
-
- INameScope nameScope = new NameScope();
- NameScope.SetNameScope(contentGrid, nameScope);
- nameScope.RegisterName(TemplateRootName, contentGrid);
- nameScope.RegisterName(TitleBarLeading, leadingContent);
- nameScope.RegisterName(TitleBarIcon, icon);
- nameScope.RegisterName(TitleBarTitle, titleLabel);
- nameScope.RegisterName(TitleBarSubtitle, subtitleLabel);
- nameScope.RegisterName(TitleBarContent, content);
- nameScope.RegisterName(TitleBarTrailing, trailingContent);
-
- VisualStateManager.SetVisualStateGroups(contentGrid, visualStateGroups);
-
- return contentGrid;
- }
-
- static VisualStateGroup GetVisibleStateGroup(string targetName, string visibleState, string hiddenState)
- {
- var visualGroup = new VisualStateGroup();
- var visualVisibleState = new VisualState() { Name = visibleState };
- visualVisibleState.Setters.Add(
- new Setter()
- {
- Property = IsVisibleProperty,
- TargetName = targetName,
- Value = true
- });
- visualGroup.States.Add(visualVisibleState);
-
- var collapsedState = new VisualState() { Name = hiddenState };
- collapsedState.Setters.Add(
- new Setter()
- {
- Property = IsVisibleProperty,
- TargetName = targetName,
- Value = false
- });
- visualGroup.States.Add(collapsedState);
- return visualGroup;
- }
-
- static void BindToTemplatedParent(BindableObject bindableObject, params BindableProperty[] properties)
- {
- foreach (var property in properties)
- {
- bindableObject.SetBinding(property, new Binding(property.PropertyName,
- source: RelativeBindingSource.TemplatedParent));
- }
- }
- }
-}
diff --git a/src/Controls/src/Core/Window/Window.cs b/src/Controls/src/Core/Window/Window.cs
index 04637243459f..2d99cd52ee3c 100644
--- a/src/Controls/src/Core/Window/Window.cs
+++ b/src/Controls/src/Core/Window/Window.cs
@@ -1,13 +1,15 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
-using System.Xml.Schema;
using Microsoft.Maui.ApplicationModel;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Layouts;
namespace Microsoft.Maui.Controls
{
@@ -60,10 +62,6 @@ public partial class Window : NavigableElement, IWindow, IToolbarElement, IMenuB
public static readonly BindableProperty MinimumHeightProperty = BindableProperty.Create(
nameof(MinimumHeight), typeof(double), typeof(Window), Primitives.Dimension.Minimum);
- /// Bindable property for .
- public static readonly BindableProperty TitleBarProperty = BindableProperty.Create(
- nameof(TitleBar), typeof(TitleBar), typeof(Window), null, propertyChanged: TitleBarChanged);
-
HashSet _overlays = new HashSet();
List _visualChildren;
Toolbar? _toolbar;
@@ -165,12 +163,6 @@ public double MinimumHeight
set => SetValue(MinimumHeightProperty, value);
}
- public ITitleBar? TitleBar
- {
- get => (ITitleBar?)GetValue(TitleBarProperty);
- set => SetValue(TitleBarProperty, value);
- }
-
double IWindow.X => GetPositionCoordinate(XProperty);
double IWindow.Y => GetPositionCoordinate(YProperty);
@@ -385,23 +377,6 @@ static void FlowDirectionChanged(BindableObject bindable, object oldValue, objec
((IVisualTreeElement)bindable).GetVisualChildren());
}
- static void TitleBarChanged(BindableObject bindable, object oldValue, object newValue)
- {
- var self = (Window)bindable;
- if (self != null)
- {
- if (oldValue is TitleBar prevTitleBar)
- {
- self.RemoveLogicalChild(prevTitleBar);
- }
-
- if (newValue is TitleBar titleBar)
- {
- self.AddLogicalChild(titleBar);
- }
- }
- }
-
bool IFlowDirectionController.ApplyEffectiveFlowDirectionToChildContainer => true;
Window IWindowController.Window
diff --git a/src/Core/src/Core.csproj b/src/Core/src/Core.csproj
index 0e3cc7dea285..b0a5c29e8d03 100644
--- a/src/Core/src/Core.csproj
+++ b/src/Core/src/Core.csproj
@@ -1,4 +1,4 @@
-
+netstandard2.1;netstandard2.0;$(_MauiDotNetTfm);$(MauiPlatforms)
diff --git a/src/Core/src/Core/ITitleBar.cs b/src/Core/src/Core/ITitleBar.cs
deleted file mode 100644
index f021577333bb..000000000000
--- a/src/Core/src/Core/ITitleBar.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System.Collections.Generic;
-
-namespace Microsoft.Maui
-{
- ///
- /// Title bar control
- ///
- public interface ITitleBar : IView, IContentView
- {
- ///
- /// Gets a list of elements that should prevent dragging in the title
- /// bar region and instead handle input directly
- ///
- IList PassthroughElements { get; }
-
- ///
- /// Gets the title text of the title bar. The title usually specifies
- /// the name of the application or indicates the purpose of the window
- ///
- string? Title { get; }
-
- ///
- /// Gets the subtitle text of the title bar. The subtitle usually specifies
- /// the secondary information about the application or window
- ///
- string? Subtitle { get; }
- }
-}
diff --git a/src/Core/src/Core/IWindow.cs b/src/Core/src/Core/IWindow.cs
index 10bec441f29d..15ce4d4a7458 100644
--- a/src/Core/src/Core/IWindow.cs
+++ b/src/Core/src/Core/IWindow.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
using Microsoft.Maui.Graphics;
@@ -131,7 +130,6 @@ public interface IWindow : ITitledElement
float RequestDisplayDensity();
#if WINDOWS
- ITitleBar? TitleBar => null;
Rect[]? TitleBarDragRectangles => null;
#endif
}
diff --git a/src/Core/src/Handlers/Window/WindowHandler.Windows.cs b/src/Core/src/Handlers/Window/WindowHandler.Windows.cs
index 3b751527418e..a4e2641e9081 100644
--- a/src/Core/src/Handlers/Window/WindowHandler.Windows.cs
+++ b/src/Core/src/Handlers/Window/WindowHandler.Windows.cs
@@ -188,13 +188,6 @@ internal static void MapTitleBarDragRectangles(IWindowHandler handler, IWindow w
}
}
- internal static void MapTitleBar(IWindowHandler handler, IWindow window)
- {
- handler
- .PlatformView
- .UpdateTitleBar(window, handler.MauiContext);
- }
-
void OnWindowChanged(AppWindow sender, AppWindowChangedEventArgs args)
{
if (!args.DidSizeChange && !args.DidPositionChange)
diff --git a/src/Core/src/Handlers/Window/WindowHandler.cs b/src/Core/src/Handlers/Window/WindowHandler.cs
index 269746c5a3e6..0089535d6153 100644
--- a/src/Core/src/Handlers/Window/WindowHandler.cs
+++ b/src/Core/src/Handlers/Window/WindowHandler.cs
@@ -36,8 +36,7 @@ public partial class WindowHandler : IWindowHandler
#endif
#if WINDOWS
[nameof(IWindow.FlowDirection)] = MapFlowDirection,
- [nameof(IWindow.TitleBarDragRectangles)] = MapTitleBarDragRectangles,
- [nameof(IWindow.TitleBar)] = MapTitleBar
+ [nameof(IWindow.TitleBarDragRectangles)] = MapTitleBarDragRectangles
#endif
};
diff --git a/src/Core/src/Platform/Windows/MauiNavigationView.cs b/src/Core/src/Platform/Windows/MauiNavigationView.cs
index 6dd485acf974..73f68a1be578 100644
--- a/src/Core/src/Platform/Windows/MauiNavigationView.cs
+++ b/src/Core/src/Platform/Windows/MauiNavigationView.cs
@@ -1,7 +1,14 @@
using System;
+using System.Collections;
+using System.Collections.Generic;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Data;
+using Microsoft.UI.Xaml.Media;
+using Windows.Foundation;
+using WBrush = Microsoft.UI.Xaml.Media.Brush;
using WGridLength = Microsoft.UI.Xaml.GridLength;
+using WRectangle = Microsoft.UI.Xaml.Shapes.Rectangle;
using WThickness = Microsoft.UI.Xaml.Thickness;
namespace Microsoft.Maui.Platform
@@ -251,8 +258,7 @@ void UpdateNavigationViewButtonHolderGridMargin()
#endregion
#region NavigationBackButtonHeight/Width
- // Note: this value is normaly 36, but we're using 32 to match the default titlebar height
- internal static double DefaultNavigationBackButtonHeight => 32; // (double)Application.Current.Resources["NavigationBackButtonHeight"];
+ internal static double DefaultNavigationBackButtonHeight => (double)Application.Current.Resources["NavigationBackButtonHeight"];
internal static double DefaultNavigationBackButtonWidth => (double)Application.Current.Resources["NavigationBackButtonWidth"];
internal static readonly DependencyProperty NavigationBackButtonHeightProperty
@@ -318,8 +324,7 @@ protected private virtual void UpdateFlyoutCustomContent()
#endregion
#region PaneToggleButton
- // Note: this value is normaly 36, but we're using 32 to match the default titlebar height
- internal static double DefaultPaneToggleButtonHeight => 32; // (double)Application.Current.Resources["PaneToggleButtonHeight"];
+ internal static double DefaultPaneToggleButtonHeight => (double)Application.Current.Resources["PaneToggleButtonHeight"];
// The resource is set to 40 but it appears that the NavigationView manually sets the width to 48
internal static double DefaultPaneToggleButtonWidth => 48;//(double)Application.Current.Resources["PaneToggleButtonWidth"];
diff --git a/src/Core/src/Platform/Windows/MauiWinUIWindow.cs b/src/Core/src/Platform/Windows/MauiWinUIWindow.cs
index b18e5487ca37..046498095271 100644
--- a/src/Core/src/Platform/Windows/MauiWinUIWindow.cs
+++ b/src/Core/src/Platform/Windows/MauiWinUIWindow.cs
@@ -173,7 +173,7 @@ void OnWindowMessage(object? sender, WindowMessageEventArgs e)
var rootManager = Window?.Handler?.MauiContext?.GetNavigationRootManager();
if (rootManager != null)
{
- rootManager?.SetTitleBarVisibility(hasTitleBar);
+ rootManager?.SetTitleBarVisibility(this, hasTitleBar);
}
}
}
diff --git a/src/Core/src/Platform/Windows/NavigationRootManager.cs b/src/Core/src/Platform/Windows/NavigationRootManager.cs
index 27685c4250b9..5c5865e37c66 100644
--- a/src/Core/src/Platform/Windows/NavigationRootManager.cs
+++ b/src/Core/src/Platform/Windows/NavigationRootManager.cs
@@ -22,22 +22,17 @@ public NavigationRootManager(Window platformWindow)
var titleBar = platformWindow.GetAppWindow()?.TitleBar;
if (titleBar is not null)
{
- SetTitleBarVisibility(titleBar.ExtendsContentIntoTitleBar);
+ SetTitleBarVisibility(platformWindow, titleBar.ExtendsContentIntoTitleBar);
}
}
- internal void SetTitleBarVisibility(bool isVisible)
+ internal void SetTitleBarVisibility(Window platformWindow, bool isVisible)
{
- var platformWindow = _platformWindow.GetTargetOrDefault();
- if (platformWindow is null)
- return;
-
// https://learn.microsoft.com/en-us/windows/apps/design/basics/titlebar-design
// Standard title bar height is 32px
// This should always get set by the code after but
// we are setting it just in case
var appbarHeight = isVisible ? 32 : 0;
- var titlebarMargins = new UI.Xaml.Thickness(0, 0, 0, 0);
if (isVisible && UI.Windowing.AppWindowTitleBar.IsCustomizationSupported())
{
var titleBar = platformWindow.GetAppWindow()?.TitleBar;
@@ -45,15 +40,13 @@ internal void SetTitleBarVisibility(bool isVisible)
{
var density = platformWindow.GetDisplayDensity();
appbarHeight = (int)(titleBar.Height / density);
- titlebarMargins = new UI.Xaml.Thickness(titleBar.LeftInset, 0, titleBar.RightInset, 0);
}
}
_rootView.UpdateAppTitleBar(
appbarHeight,
UI.Windowing.AppWindowTitleBar.IsCustomizationSupported() &&
- isVisible,
- titlebarMargins
+ isVisible
);
}
@@ -113,14 +106,11 @@ public virtual void Connect(UIElement platformView)
public virtual void Disconnect()
{
_rootView.OnWindowTitleBarContentSizeChanged -= WindowRootViewOnWindowTitleBarContentSizeChanged;
-
if (_platformWindow.TryGetTarget(out var platformWindow))
{
platformWindow.Activated -= OnWindowActivated;
}
-
SetToolbar(null);
- SetTitleBar(null, null);
if (_rootView.Content is RootNavigationView navView)
navView.Content = null;
@@ -148,15 +138,6 @@ internal string? WindowTitle
internal void SetTitle(string? title) =>
_rootView.WindowTitle = title;
- internal void SetTitleBar(ITitleBar? titlebar, IMauiContext? mauiContext)
- {
- if (_platformWindow.TryGetTarget(out var window))
- {
- _rootView.AppWindowId = window.GetAppWindow()?.Id;
- _rootView.SetTitleBar(titlebar, mauiContext);
- }
- }
-
void OnWindowActivated(object sender, WindowActivatedEventArgs e)
{
SolidColorBrush defaultForegroundBrush = (SolidColorBrush)Application.Current.Resources["TextFillColorPrimaryBrush"];
diff --git a/src/Core/src/Platform/Windows/RootNavigationView.cs b/src/Core/src/Platform/Windows/RootNavigationView.cs
index ec2aabb98bb7..ef98916f6703 100644
--- a/src/Core/src/Platform/Windows/RootNavigationView.cs
+++ b/src/Core/src/Platform/Windows/RootNavigationView.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading.Tasks;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
@@ -253,13 +254,13 @@ internal void UpdateAppTitleBar(double appTitleBarHeight, bool useCustomAppTitle
void UpdateNavigationAndPaneButtonHolderGridStyles()
{
- var buttonHeight = Math.Max(_appBarTitleHeight, DefaultNavigationBackButtonHeight);
+ var buttonHeight = Math.Min(_appBarTitleHeight, DefaultNavigationBackButtonHeight);
var buttonRatio = buttonHeight / DefaultNavigationBackButtonHeight;
NavigationBackButtonHeight = buttonHeight;
NavigationBackButtonWidth = DefaultNavigationBackButtonWidth * buttonRatio;
- var paneToggleHeight = Math.Max(_appBarTitleHeight, DefaultPaneToggleButtonHeight);
+ var paneToggleHeight = Math.Min(_appBarTitleHeight, DefaultPaneToggleButtonHeight);
var paneToggleRatio = paneToggleHeight / DefaultPaneToggleButtonHeight;
PaneToggleButtonHeight = paneToggleHeight;
diff --git a/src/Core/src/Platform/Windows/Styles/WindowRootViewStyle.xaml b/src/Core/src/Platform/Windows/Styles/WindowRootViewStyle.xaml
index 131a8ec6ba47..f7c4439c8b7f 100644
--- a/src/Core/src/Platform/Windows/Styles/WindowRootViewStyle.xaml
+++ b/src/Core/src/Platform/Windows/Styles/WindowRootViewStyle.xaml
@@ -14,35 +14,28 @@
x:Key="MauiAppTitleBarContainerTemplateSelector"/>
-
-
-
-
-
-
-
-
+ Margin="0,0,0,0">
+
+
+
+
+
diff --git a/src/Core/src/Platform/Windows/WindowExtensions.cs b/src/Core/src/Platform/Windows/WindowExtensions.cs
index 2de78b35cb0d..30f260d93b40 100644
--- a/src/Core/src/Platform/Windows/WindowExtensions.cs
+++ b/src/Core/src/Platform/Windows/WindowExtensions.cs
@@ -1,6 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
using Microsoft.Maui.ApplicationModel;
using Microsoft.Maui.Devices;
using Microsoft.Maui.Graphics;
@@ -54,11 +52,6 @@ internal static void UpdateTitle(this UI.Xaml.Window platformWindow, IWindow win
.SetTitle(window.Title);
}
- internal static void UpdateTitleBar(this UI.Xaml.Window platformWindow, IWindow window, IMauiContext? mauiContext)
- {
- mauiContext?.GetNavigationRootManager().SetTitleBar(window.TitleBar, mauiContext);
- }
-
public static void UpdateX(this UI.Xaml.Window platformWindow, IWindow window) =>
platformWindow.UpdatePosition(window);
diff --git a/src/Core/src/Platform/Windows/WindowRootView.cs b/src/Core/src/Platform/Windows/WindowRootView.cs
index 1e12e398b213..66d7a3dc5ae2 100644
--- a/src/Core/src/Platform/Windows/WindowRootView.cs
+++ b/src/Core/src/Platform/Windows/WindowRootView.cs
@@ -1,18 +1,9 @@
using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using Microsoft.Maui.Graphics;
-using Microsoft.UI;
-using Microsoft.UI.Input;
-using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.Win32;
using Windows.Foundation;
-using FRect = Windows.Foundation.Rect;
-using Rect32 = Windows.Graphics.RectInt32;
using ViewManagement = Windows.UI.ViewManagement;
using WThickness = Microsoft.UI.Xaml.Thickness;
@@ -31,7 +22,6 @@ public static readonly DependencyProperty AppTitleBarTemplateProperty
internal event EventHandler? ContentChanged;
MauiToolbar? _toolbar;
MenuBar? _menuBar;
- ITitleBar? _titleBar;
FrameworkElement? _appTitleBar;
bool _hasTitleBarImage;
ViewManagement.UISettings _viewSettings;
@@ -40,7 +30,6 @@ public static readonly DependencyProperty AppTitleBarTemplateProperty
public WindowRootView()
{
IsTabStop = false;
- PassthroughTitlebarElements = new List();
_viewSettings = new ViewManagement.UISettings();
}
@@ -50,7 +39,6 @@ public WindowRootView()
Image? AppFontIcon { get; set; }
internal TextBlock? AppTitle { get; private set; }
- internal WindowId? AppWindowId { get; set; }
public RootNavigationView? NavigationViewControl { get; private set; }
@@ -114,7 +102,7 @@ internal FrameworkElement? AppTitleBar
}
}
- internal void UpdateAppTitleBar(int appTitleBarHeight, bool useCustomAppTitleBar, WThickness margin)
+ internal void UpdateAppTitleBar(int appTitleBarHeight, bool useCustomAppTitleBar)
{
_useCustomAppTitleBar = useCustomAppTitleBar;
WindowTitleBarContentControlMinHeight = appTitleBarHeight;
@@ -134,7 +122,6 @@ internal void UpdateAppTitleBar(int appTitleBarHeight, bool useCustomAppTitleBar
WindowTitleBarContentControlVisibility = UI.Xaml.Visibility.Collapsed;
}
- WindowTitleMargin = margin;
UpdateRootNavigationViewMargins(topMargin);
this.RefreshThemeResources();
}
@@ -190,65 +177,15 @@ void LoadAppTitleBarContainer()
AppTitleBarContentControl.SizeChanged += (sender, args) =>
{
OnWindowTitleBarContentSizeChanged?.Invoke(sender, EventArgs.Empty);
- UpdateTitleBarContentSize();
- };
-
- UpdateTitleBarContentSize();
- }
+ if (sender is not FrameworkElement fe)
+ return;
- internal void UpdateTitleBarContentSize()
- {
- if (AppTitleBarContentControl is null)
- return;
-
- if (_appTitleBarHeight != AppTitleBarContentControl.ActualHeight &&
- AppTitleBarContentControl.Visibility == UI.Xaml.Visibility.Visible)
- {
- UpdateRootNavigationViewMargins(AppTitleBarContentControl.ActualHeight);
-
- if (AppWindowId.HasValue)
+ if (_appTitleBarHeight != fe.ActualHeight)
{
- AppWindow.GetFromWindowId(AppWindowId.Value).TitleBar.PreferredHeightOption =
- _appTitleBarHeight >= 48 ? TitleBarHeightOption.Tall : TitleBarHeightOption.Standard;
+ UpdateRootNavigationViewMargins(fe.ActualHeight);
+ this.RefreshThemeResources();
}
-
- this.RefreshThemeResources();
- }
-
- var rectArray = new List();
- foreach (var child in PassthroughTitlebarElements)
- {
- var transform = child.TransformToVisual(null);
- var bounds = transform.TransformBounds(
- new FRect(0, 0, child.ActualWidth, child.ActualHeight));
- var rect = GetRect(bounds, XamlRoot.RasterizationScale);
- rectArray.Add(rect);
- }
-
- if (AppWindowId.HasValue)
- {
- var nonClientInputSrc =
- InputNonClientPointerSource.GetForWindowId(AppWindowId.Value);
-
- if (rectArray.Count > 0)
- {
- nonClientInputSrc.SetRegionRects(NonClientRegionKind.Passthrough, [.. rectArray]);
- }
- else
- {
- nonClientInputSrc.ClearRegionRects(NonClientRegionKind.Passthrough);
- }
- }
- }
-
- private static Rect32 GetRect(FRect bounds, double scale)
- {
- return new Rect32(
- _X: (int)Math.Round(bounds.X * scale),
- _Y: (int)Math.Round(bounds.Y * scale),
- _Width: (int)Math.Round(bounds.Width * scale),
- _Height: (int)Math.Round(bounds.Height * scale)
- );
+ };
}
void OnAppTitleBarContentControlLoaded(object sender, RoutedEventArgs e)
@@ -275,25 +212,22 @@ void UpdateRootNavigationViewMargins(double margin)
void LoadAppTitleBarControls()
{
- if (WindowTitleBarContent is not null && AppTitleBarContentControl is not null)
- {
- AppTitleBarContentControl.ContentTemplateSelector = null;
- AppTitleBarContentControl.Content = WindowTitleBarContent;
- }
- else if (AppTitleBar != null && AppFontIcon is null)
- {
- AppFontIcon = (Image?)AppTitleBar?.FindName("AppFontIcon");
- AppTitle = (TextBlock?)AppTitleBar?.FindName("AppTitle");
+ if (AppTitleBar == null)
+ return;
- if (AppFontIcon != null)
- {
- AppFontIcon.ImageOpened += OnImageOpened;
- AppFontIcon.ImageFailed += OnImageFailed;
- }
+ if (AppFontIcon != null)
+ return;
+
+ AppFontIcon = (Image?)AppTitleBar?.FindName("AppFontIcon");
+ AppTitle = (TextBlock?)AppTitleBar?.FindName("AppTitle");
- ApplyTitlebarColorPrevalence();
+ if (AppFontIcon != null)
+ {
+ AppFontIcon.ImageOpened += OnImageOpened;
+ AppFontIcon.ImageFailed += OnImageFailed;
}
+ ApplyTitlebarColorPrevalence();
UpdateAppTitleBarMargins();
}
@@ -417,10 +351,12 @@ void UpdateAppTitleBarMargins()
// If the AppIcon loads correctly then we set a margin for the text from the image
if (_hasTitleBarImage)
{
+ WindowTitleMargin = new WThickness(12, 0, 0, 0);
WindowTitleIconVisibility = UI.Xaml.Visibility.Visible;
}
else
{
+ WindowTitleMargin = new WThickness(0);
WindowTitleIconVisibility = UI.Xaml.Visibility.Collapsed;
}
}
@@ -430,111 +366,6 @@ void OnButtonHolderGridSizeChanged(object sender, SizeChangedEventArgs e)
UpdateAppTitleBarMargins();
}
- internal void SetTitleBar(ITitleBar? titlebar, IMauiContext? mauiContext)
- {
- if (WindowTitleBarContent is not null)
- {
- WindowTitleBarContent.LayoutUpdated -= PlatformView_LayoutUpdated;
- }
-
- if (_titleBar is INotifyPropertyChanged p)
- {
- p.PropertyChanged -= TitlebarPropChanged_PropertyChanged;
- }
-
- _titleBar = titlebar;
-
- if (_titleBar is null || mauiContext is null)
- {
- return;
- }
-
- var handler = _titleBar?.ToHandler(mauiContext);
- if (handler is not null &&
- handler.PlatformView is not null)
- {
- WindowTitleBarContent = handler.PlatformView;
-
- // This will handle all size changed events when leading/trailing/main content
- // changes size or is added
- WindowTitleBarContent.LayoutUpdated += PlatformView_LayoutUpdated;
-
- // Override the template selector and content
- if (AppTitleBarContentControl is not null)
- {
- AppTitleBarContentControl.ContentTemplateSelector = null;
- AppTitleBarContentControl.Content = WindowTitleBarContent;
- }
-
- // To handle when leading/trailing/main content is added/removed
- if (_titleBar is INotifyPropertyChanged tpc)
- {
- tpc.PropertyChanged += TitlebarPropChanged_PropertyChanged;
- }
-
- UpdateBackgroundColorForButtons();
- SetTitleBarInputElements();
- }
- }
-
- private void TitlebarPropChanged_PropertyChanged(object? sender, PropertyChangedEventArgs e)
- {
- if (_titleBar is not null && _titleBar.Handler?.MauiContext is not null)
- {
- SetTitleBarInputElements();
-
- if (e.PropertyName == "BackgroundColor")
- {
- UpdateBackgroundColorForButtons();
- }
- }
- }
-
- private void UpdateBackgroundColorForButtons()
- {
- if (NavigationViewControl?.ButtonHolderGrid is not null &&
- _titleBar?.Background is SolidPaint bg)
- {
- NavigationViewControl.ButtonHolderGrid.Background = new SolidColorBrush(bg.Color.ToWindowsColor());
- }
- }
-
- private void PlatformView_LayoutUpdated(object? sender, object e)
- {
- UpdateTitleBarContentSize();
- }
-
- private void SetTitleBarInputElements()
- {
- var mauiContext = _titleBar?.Handler?.MauiContext;
- if (mauiContext is null || _titleBar is null)
- {
- return;
- }
-
- var passthroughElements = new List();
- foreach (var element in _titleBar.PassthroughElements)
- {
- if (element is IContentView container && container.PresentedContent is not null)
- {
- var platformView = container.PresentedContent.ToHandler(mauiContext).PlatformView;
- if (platformView is not null)
- {
- passthroughElements.Add(platformView);
- }
- }
- else
- {
- var platformView = element.ToHandler(mauiContext).PlatformView;
- if (platformView is not null)
- {
- passthroughElements.Add(platformView);
- }
- }
- }
- PassthroughTitlebarElements = passthroughElements;
- }
-
static void OnAppTitleBarTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
((WindowRootView)d)._appTitleBar = null;
@@ -576,19 +407,6 @@ void UpdateAppTitleBarTransparency()
border.Background = null;
}
- internal static readonly DependencyProperty WindowTitleBarContentProperty =
- DependencyProperty.Register(
- nameof(WindowTitleBarContent),
- typeof(FrameworkElement),
- typeof(WindowRootView),
- new PropertyMetadata(null));
-
- internal FrameworkElement WindowTitleBarContent
- {
- get => (FrameworkElement)GetValue(WindowTitleBarContentProperty);
- set => SetValue(WindowTitleBarContentProperty, value);
- }
-
internal static readonly DependencyProperty WindowTitleForegroundProperty =
DependencyProperty.Register(
nameof(WindowTitleForeground),
@@ -666,7 +484,5 @@ internal double WindowTitleBarContentControlMinHeight
get => (double)GetValue(WindowTitleBarContentControlMinHeightProperty);
set => SetValue(WindowTitleBarContentControlMinHeightProperty, value);
}
-
- internal IEnumerable PassthroughTitlebarElements { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
index 9c68a461c300..a2e3e6026e42 100644
--- a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
@@ -18,10 +18,6 @@ Microsoft.Maui.ICommandMapper
Microsoft.Maui.ICommandMapper.Add(string! key, System.Action! action) -> void
Microsoft.Maui.ICommandMapper.Add(string! key, System.Action! action) -> void
Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool
-Microsoft.Maui.ITitleBar
-Microsoft.Maui.ITitleBar.PassthroughElements.get -> System.Collections.Generic.IList!
-Microsoft.Maui.ITitleBar.Subtitle.get -> string?
-Microsoft.Maui.ITitleBar.Title.get -> string?
Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Alt = 4 -> Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Cmd = 8 -> Microsoft.Maui.KeyboardAcceleratorModifiers
diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
index d065c5f0df7b..38dcd185dac6 100644
--- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
@@ -26,10 +26,6 @@ Microsoft.Maui.ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint,
Microsoft.Maui.ICrossPlatformLayoutBacking
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.get -> Microsoft.Maui.ICrossPlatformLayout?
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.set -> void
-Microsoft.Maui.ITitleBar
-Microsoft.Maui.ITitleBar.PassthroughElements.get -> System.Collections.Generic.IList!
-Microsoft.Maui.ITitleBar.Subtitle.get -> string?
-Microsoft.Maui.ITitleBar.Title.get -> string?
Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Alt = 4 -> Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Cmd = 8 -> Microsoft.Maui.KeyboardAcceleratorModifiers
diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
index e1b3d35d16fa..870fac341c6e 100644
--- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
@@ -26,10 +26,6 @@ Microsoft.Maui.ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint,
Microsoft.Maui.ICrossPlatformLayoutBacking
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.get -> Microsoft.Maui.ICrossPlatformLayout?
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.set -> void
-Microsoft.Maui.ITitleBar
-Microsoft.Maui.ITitleBar.PassthroughElements.get -> System.Collections.Generic.IList!
-Microsoft.Maui.ITitleBar.Subtitle.get -> string?
-Microsoft.Maui.ITitleBar.Title.get -> string?
Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Alt = 4 -> Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Cmd = 8 -> Microsoft.Maui.KeyboardAcceleratorModifiers
diff --git a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
index 9aa5321e1b45..516ccdcc342b 100644
--- a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
@@ -32,10 +32,6 @@ Microsoft.Maui.Platform.IImageSourcePartSetter.SetImageSource(Microsoft.Maui.Pla
Microsoft.Maui.Platform.ImageSourcePartLoader.ImageSourcePartLoader(Microsoft.Maui.Platform.IImageSourcePartSetter! setter) -> void
Microsoft.Maui.SizeRequest.Equals(Microsoft.Maui.SizeRequest other) -> bool
Microsoft.Maui.SoftInputExtensions
-Microsoft.Maui.ITitleBar
-Microsoft.Maui.ITitleBar.PassthroughElements.get -> System.Collections.Generic.IList!
-Microsoft.Maui.ITitleBar.Subtitle.get -> string?
-Microsoft.Maui.ITitleBar.Title.get -> string?
override Microsoft.Maui.Layouts.FlexBasis.Equals(object? obj) -> bool
override Microsoft.Maui.Layouts.FlexBasis.GetHashCode() -> int
override Microsoft.Maui.SizeRequest.Equals(object? obj) -> bool
diff --git a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
index e8b7f948de39..9106ef6dac6b 100644
--- a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
@@ -15,11 +15,6 @@ Microsoft.Maui.ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint,
Microsoft.Maui.ICrossPlatformLayoutBacking
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.get -> Microsoft.Maui.ICrossPlatformLayout?
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.set -> void
-Microsoft.Maui.ITitleBar
-Microsoft.Maui.ITitleBar.PassthroughElements.get -> System.Collections.Generic.IList!
-Microsoft.Maui.ITitleBar.Subtitle.get -> string?
-Microsoft.Maui.ITitleBar.Title.get -> string?
-Microsoft.Maui.IWindow.TitleBar.get -> Microsoft.Maui.ITitleBar?
Microsoft.Maui.IWindow.TitleBarDragRectangles.get -> Microsoft.Maui.Graphics.Rect[]?
Microsoft.Maui.ICommandMapper
Microsoft.Maui.ICommandMapper.GetCommand(string! key) -> System.Action?
diff --git a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt
index d0d80a996e85..d7bb997de6e3 100644
--- a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt
@@ -21,10 +21,6 @@ Microsoft.Maui.ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint,
Microsoft.Maui.ICrossPlatformLayoutBacking
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.get -> Microsoft.Maui.ICrossPlatformLayout?
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.set -> void
-Microsoft.Maui.ITitleBar
-Microsoft.Maui.ITitleBar.PassthroughElements.get -> System.Collections.Generic.IList!
-Microsoft.Maui.ITitleBar.Subtitle.get -> string?
-Microsoft.Maui.ITitleBar.Title.get -> string?
Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Alt = 4 -> Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Cmd = 8 -> Microsoft.Maui.KeyboardAcceleratorModifiers
diff --git a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt
index e7ab819efdae..7a9469504a37 100644
--- a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt
@@ -17,10 +17,6 @@ Microsoft.Maui.ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint,
Microsoft.Maui.ICrossPlatformLayoutBacking
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.get -> Microsoft.Maui.ICrossPlatformLayout?
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.set -> void
-Microsoft.Maui.ITitleBar
-Microsoft.Maui.ITitleBar.PassthroughElements.get -> System.Collections.Generic.IList!
-Microsoft.Maui.ITitleBar.Subtitle.get -> string?
-Microsoft.Maui.ITitleBar.Title.get -> string?
Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Alt = 4 -> Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Cmd = 8 -> Microsoft.Maui.KeyboardAcceleratorModifiers
diff --git a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
index 0060bce9387e..d46dad7603ea 100644
--- a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
+++ b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
@@ -21,10 +21,6 @@ Microsoft.Maui.ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint,
Microsoft.Maui.ICrossPlatformLayoutBacking
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.get -> Microsoft.Maui.ICrossPlatformLayout?
Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout.set -> void
-Microsoft.Maui.ITitleBar
-Microsoft.Maui.ITitleBar.PassthroughElements.get -> System.Collections.Generic.IList!
-Microsoft.Maui.ITitleBar.Subtitle.get -> string?
-Microsoft.Maui.ITitleBar.Title.get -> string?
Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Alt = 4 -> Microsoft.Maui.KeyboardAcceleratorModifiers
Microsoft.Maui.KeyboardAcceleratorModifiers.Cmd = 8 -> Microsoft.Maui.KeyboardAcceleratorModifiers
diff --git a/src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml b/src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml
index 185d9b2a2897..6641e3aed4ea 100644
--- a/src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml
+++ b/src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml
@@ -392,30 +392,6 @@
-
-
-
-