Skip to content

Should there be one navigation - NavigationView? #356

@pomianowski

Description

@pomianowski

Discussed in https://github.com/orgs/lepoco/discussions/329

Originally posted by pomianowski August 4, 2022
Hey guys,
to make breaking changes as much as possible controlled I would like to ask if at this stage you think that there should be one navigation control - NavigationView.

Giving a bit of a wider perspective, when creating the current navigation, I did not follow WinUi but my own implementations created for the needs of other projects. While it made sense for a small scope of apps now I can see that there are too many use cases that I have not considered.

Control

NavigationView would have a presenter - Frame or some other presenting control and a Breadcrumb included.
It should be a whole and not require additional controls. All this to keep everything as simple as possible.

For example:

<ui:NavigationView
  PaneStyle="Compact"
  PaneDisplayMode="Left"
  TransitionType="FadeInWithSlide"
  IsBackEnabled="True"
  IsBackButtonVisible="True"
  IsBreadcrumbVisible="True"
  MenuItems="{Binding}"
  FooterMenuItems="{Binding}"
  Navigated="OnNavigated">
  <ui:NavigationView.Header>
    <!-- Alternate way to create a breadcrumb? -->
  </ui:NavigationView.Header>
  <ui:NavigationView.Breadcrumb>  <!-- Accept object or FrameworkElement ? -->
    <ui:Breadcrumb
      FontSize="12" />
  </ui:NavigationView.Breadcrumb>
  <ui:NavigationView.Content>
    <!--
      Custom content rendered above the content of the page,
      may be breadcrumb or whatever else you like
      maybe dialog or snackbar? -->
  </ui:NavigationView.Content>
</ui:NavigationView>
NavigationView.PaneDisplayMode = PaneDisplayMode.Top; // Top / Left
NavigationView.SelectedItem; // Instead of the currently used property - Current

Parameters named similarly to Win Ui NavigationView - MenuItems instead of Items and FooterMenuItems instead of Footer.

Instead of NavigationStore or NavigationCompact class, we could use PaneStyle="Compact" - Compact / Store / Fluent.

Hamburger button

Hamburger button and Back button can be in title bar or the navigation itself. This is also a problem that should be solved. Should TitleBar implement a property like Navigation="{Bind RootNav}" or maybe a new NavigationControls control that could be placed in TitleBar.Header.

Frame

And the issue of rendering the control itself. We can skip the whole Frame control related stuff and simply use ContentPresenter or ScrollViewer. This will reduce the total number of rendered elements but the effect will be the same. Anyway, the most common way to create page objects is to do it before entering them in Frame.

I would be grateful for your suggestions and comments.

Metadata

Metadata

Assignees

Labels

controlsChanges to the appearance or logic of custom controls.enhancementNew feature or requestlocked-due-to-inactivitynavigationChanges to navigation related controls.stylesTopic is related to styles

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions