Closed Zaitonn closed 6 months ago
你好!我下载了您的 test.zip,并发现你没有按照正确的方法为您的项目安装此框架。现在,按照如下的步骤可以修复此问题:
<Application x:Class="test.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:local="clr-namespace:test"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources/>
<ui:XamlControlsResources/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
<Window x:Class="test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:local="clr-namespace:test"
mc:Ignorable="d"
ui:WindowHelper.UseModernWindowStyle="True" ui:WindowHelper.SystemBackdropType="Mica" ui:TitleBar.Height="36"
Title="MainWindow"
Height="450" Width="800">
<Grid>
<ui:NavigationView x:Name="nvSample" PaneDisplayMode="LeftCompact">
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem
Content="Menu Item1"
Tag="SamplePage1">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Glyph="{x:Static ui:SegoeIcons.Play}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="Menu Item2"
Tag="SamplePage2">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Glyph="{x:Static ui:SegoeIcons.Save}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="Menu Item3"
Tag="SamplePage3">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Glyph="{x:Static ui:SegoeIcons.Refresh}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="Menu Item4"
Tag="SamplePage1">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Glyph="{x:Static ui:SegoeIcons.Download}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationView.MenuItems>
<Frame x:Name="contentFrame" />
</ui:NavigationView>
</Grid>
</Window>
很感谢你使用我们的框架,但是在开始之前我希望您能看看 Quick Start 和 FAQs,它们将会对你很有帮助(一定要看,就不会犯这些低级错误了)。如果我的回复解决了你的问题,那么你现在可以关闭此 issue 了;如果没有,请在下面提出你的问题。谢谢!
你必须在 Application 中添加 ThemeResources 和 XamlControlsResources 才能让你的 UI 和控件正常运作
在创建新的项目尝试稳定复现时忘记了这个,但是原来的有
ojbk了 系程序入口点问题 用了手动启动MainWindow不知道为什么就会这样
感谢 很抱歉浪费了您的宝贵时间:(
Hi,
If you want to learn more about NavigationView, please check: https://docs.inkore.net/ui-wpf-modern/components/navigation/navigation-view
Describe the bug 使用
NavigationView
时出现异常To Reproduce 从SampleApp抄示例代码
编译运行
test.zip
Expected behavior 像SampleApp一样正常
Screenshots
Desktop (please complete the following information):
Additional context
输出
想不出来是什么问题也不确定是不是bug,故请教一下