wpf xaml中路径问题

osnot 2013-07-22 04:51:49
问题:在NavigationWindow的Source属性中如何引用上级目录?
页面:工程/Navigation/WindowForNavigate.xaml

<NavigationWindow x:Class="WpfApplicationForRotedEvent.Navigation.WindowForNavigate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WindowForNavigate" Height="300" Width="300"
Source="MainWindow.xaml">
</NavigationWindow >

而页面MainWindow.xaml位于:工程/MainWindow.xaml
请问Source如何在Xaml中配置?
...全文
164 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
osnot 2013-07-22
  • 打赏
  • 举报
回复
应该如下配置:

<NavigationWindow  x:Class="WpfApplicationForRotedEvent.Navigation.WindowForNavigate"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="WindowForNavigate" Height="300" Width="300"
        Source="/MainWindow.xaml">
</NavigationWindow >
刚开始也是的,只是MainWindow.xaml应该是一个page,而不是window,所以出错。
husar516 2013-07-22
  • 打赏
  • 举报
回复
../Navigation/WindowForNavigate.xaml

8,734

社区成员

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

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