Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ void ShellElementPropertyChanged(object sender, PropertyChangedEventArgs e)
if (ShellView == null)
return base.MeasureOverride(availableSize);

if (!ShellView.IsPaneOpen)
return base.MeasureOverride(availableSize);

if (ShellView.OpenPaneLength < availableSize.Width)
return base.MeasureOverride(availableSize);

Expand Down
4 changes: 4 additions & 0 deletions src/Core/src/Platform/Windows/MauiNavigationView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ protected override void OnApplyTemplate()
// It causes the content to not be flush up against the title bar
PaneContentGrid.Margin = new WThickness(0, 0, 0, 0);
UpdateMenuItemsContainerHeight();

// On WinUI SDK 1.7, it seems that if the PaneContentGrid width is not explicitly set,
// it takes on the desired width of its child.
PaneContentGrid.Width = OpenPaneLength;
}


Expand Down
10 changes: 10 additions & 0 deletions src/Core/src/Platform/Windows/NavigationViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,19 @@ public static void UpdateFlyoutBehavior(this MauiNavigationView navigationView,
public static void UpdateFlyoutWidth(this MauiNavigationView navigationView, IFlyoutView flyoutView)
{
if (flyoutView.FlyoutWidth >= 0)
{
navigationView.OpenPaneLength = flyoutView.FlyoutWidth;
}
else
{
navigationView.OpenPaneLength = 320;
}

if (navigationView.PaneContentGrid is not null)
{
navigationView.PaneContentGrid.Width = navigationView.OpenPaneLength;
}

// At some point this Template Setting is going to show up with a bump to winui
//handler.PlatformView.OpenPaneLength = handler.PlatformView.TemplateSettings.OpenPaneWidth;
}
Expand Down