这个是我的wpf的项目结构。是用‘NavigationWindow’完成 page的跳转操作
如下写是没有问题的:
<NavigationWindow x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Switch page with transition" Height="512" Icon="icon1.ico" Width="958"
ShowsNavigationUI="False"
Source="index.xaml" Navigating="NavigationWindow_Navigating" ResizeMode="NoResize" SnapsToDevicePixels="True">
</NavigationWindow>
因为Window1.xaml和index.xaml在同一文件夹下
但是我想将所有page页归类在一个文件夹(Pages)下,也就是,自动会生成一个新的命名空间 WpfApplication1.Pages.然后我将代码更改如下
<NavigationWindow x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Switch page with transition" Height="512" Icon="icon1.ico" Width="958"
xmlns:my="WpfApplication1.NewFolder1;assembly=WpfApplication1"
ShowsNavigationUI="False"
Source="my:Page4.xaml" Navigating="NavigationWindow_Navigating" ResizeMode="NoResize" SnapsToDevicePixels="True">
</NavigationWindow>
不能解决,求助各位达人帮忙解决一下~小弟万分感谢