xaml 命名空间问题,求达人解惑

soul__RIver8 2012-12-12 04:59:08

这个是我的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>

不能解决,求助各位达人帮忙解决一下~小弟万分感谢

...全文
103 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
soul__RIver8 2012-12-12
  • 打赏
  • 举报
回复
谢谢啊,这么简单。解决,结贴
在路上20130607 2012-12-12
  • 打赏
  • 举报
回复
在路上20130607 2012-12-12
  • 打赏
  • 举报
回复
Source="NewFolder1/Page4.xaml"
soul_RIver 2012-12-12
  • 打赏
  • 举报
回复
顶!字数还不够么!

8,734

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧