How can I change the border color of a NavigationView in WinUI 3?

youki 1,016 Reputation points
2024-05-22T15:53:25.08+00:00

Which property is it in the generic.xaml? I can't even find the TargetType.

Lines within the red rectangles.

User's image

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
739 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
778 questions
{count} votes

Accepted answer
  1. Xiaopo Yang - MSFT 11,901 Reputation points Microsoft Vendor
    2024-05-23T02:23:44.8833333+00:00

    Hello @youki,

    There are no such properties for this. But you can use the VisualTreeHelper Class to find the desired element and change its properties when the NavigationView is loaded. NavigationView is defined like:

    <Style TargetType="controls:NavigationView">
        ...
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:NavigationView">
                    ...
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    0 comments No comments

0 additional answers

Sort by: Most helpful