简体   繁体   English

UWP 导航视图的自定义样式

[英]UWP custom style for navigationview

I need to customize NavigationView like this:我需要像这样自定义 NavigationView: 在此处输入图像描述

I don't know how to create Textblock "Connected" inside NavigationView.我不知道如何在 NavigationView 中创建“已连接”文本块。 I read about PaneTitle, but its not what i need at this situation我读过 PaneTitle,但在这种情况下这不是我需要的

If you are using the native NavigationView control, what you need is to create a default style of the NavigationView control.如果您使用的是本机NavigationView控件,则需要创建NavigationView控件的默认样式。

Open the DocumentOutline windows from the Visual Studio, it will show all the controls that you've added to the Xaml page, then choose the target NavigationView , right click it and choose Edit Template -> Edit a copy .从 Visual Studio 打开 DocumentOutline windows,它会显示您添加到 Xaml 页面的所有控件,然后选择目标NavigationView ,右键单击它并选择Edit Template -> Edit a copy Then the Visual Studio will automatically generate a default style of the NavigationView .然后 Visual Studio 会自动生成NavigationView的默认样式。

In the style, there is a Grid called PaneContentGrid inside a SplitView.Pane, that's the place where the NavigationViewItems are listed.在样式中,在 SplitView.Pane 中有一个名为PaneContentGrid的网格,这是列出 NavigationViewItems 的地方。 You could add another button as you want.您可以根据需要添加另一个按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM