Skip to content

[Proposal]: Allow NavigationView icons beyond PathGeometry (SvgImageSource / Element) #201

Description

@asural

Problem statement

NavigationView.Items currently only accepts icons as Func<T, PathGeometry?>.
Apps that want richer SVG icons (especially via Aprillz.MewUI.Svg / SvgImageSource)
cannot use them directly in the navigation pane.

Today the practical workaround is to extract SVG path d strings and call
PathGeometry.Parse. That works for simple monochrome icons, but it does not
compose well with multi-path SVGs, tinting, or the SvgImageSource workflow
already documented for Image controls.

Why the current approach is insufficient

  1. PathGeometry-only icons force a second icon pipeline alongside MewUI.Svg.
  2. SvgImageSource + Image works elsewhere, but NavigationView cannot consume it.
  3. Converting every icon to a single path string loses SVG flexibility
    (multiple fills, strokes, complex groups) and is hard to maintain for large
    Fluent / custom icon packs.
  4. App-level workarounds (custom sidebar, drawing icons manually) abandon
    NavigationView's built-in icon slot and rail/compact layout behavior.

Type of change

Public API change

Expected impact

  • App developers using NavigationView + SVG icon packs can keep one icon source.
  • Existing PathGeometry-based apps remain unaffected if the API is additive
    (overload / optional alternate selector).
  • Slightly broader icon rendering path in NavigationView pane items.

Alternatives or tradeoffs

Alternatives already available in app code:

  • Keep using PathGeometry.Parse with Fluent SVG d paths (current workaround).
  • Build a custom navigation list instead of NavigationView.
  • Rasterize SVGs to bitmaps (worse for DPI / theme tint).

Tradeoffs if added to MewUI:

  • Need a clear icon abstraction (PathGeometry vs IImageSource vs Element).
  • Pane measurement/layout must handle non-path icons consistently in
    expanded / compact / rail modes.
  • Prefer additive API to avoid breaking existing PathGeometry callers.

Additional context

Current signature (0.19.1):

.Items(
items,
text: item => item.Text,
icon: item => item.Icon, // PathGeometry only
kind: item => item.Kind,
keySelector: item => item.Key,
content: ...)

Possible directions (any would help):

  1. Overload icon selector to accept IImageSource / SvgImageSource
  2. Allow Func<T, Element?> for custom icon content
    (e.g. Image { Source = SvgImageSource.From... })
  3. If PathGeometry-only is intentional, document the recommended SVG → PathGeometry
    workflow for NavigationView

Related package: Aprillz.MewUI.Svg (SvgImageSource + Image already works)

Environment:

  • Aprillz.MewUI 0.19.1
  • Considering Aprillz.MewUI.Svg for navigation icons

Before submitting

  • I searched for existing issues and discussions first.
  • I described why this belongs in MewUI core rather than only in app-level code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions