Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions src/AvaloniaInside.Shell/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace AvaloniaInside.Shell;

[PseudoClasses(":modal")]
[TemplatePart("PART_TabStripPlaceHolder", typeof(ContentPresenter))]
public class Page : UserControl, INavigationLifecycle, INavigatorLifecycle, INavigationBarProvider
{
private ContentPresenter? _navigationBarPlaceHolder;
Expand Down Expand Up @@ -344,6 +345,9 @@ private void ApplyNavigationBar()
if (Shell?.NavigationBarAttachType is not ({ } type and not NavigationBarAttachType.ToShell))
return;

if (IsModal && !Shell.NavigationBarForModal)
return;

if ((type == NavigationBarAttachType.ToLastPage && Chain is HostNavigationChain) ||
(type == NavigationBarAttachType.ToFirstHostThenPage && Chain.Back is HostNavigationChain))
return;
Expand Down
21 changes: 21 additions & 0 deletions src/AvaloniaInside.Shell/ShellView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,27 @@ public NavigationBarAttachType NavigationBarAttachType

#endregion

#region NavigationBarForModal

/// <summary>
/// Defines the <see cref="NavigationBarAttachTypeProperty"/> property.
/// </summary>
public static readonly StyledProperty<bool> NavigationBarForModalProperty =
AvaloniaProperty.Register<ShellView, bool>(
nameof(NavigationBarForModal),
defaultValue: false);

/// <summary>
/// Gets or sets the type of attach navigation bar.
/// </summary>
public bool NavigationBarForModal
{
get => GetValue(NavigationBarForModalProperty);
set => SetValue(NavigationBarForModalProperty, value);
}

#endregion

#endregion

#region Safe area properties
Expand Down