I am trying to use NavigationWindow class instead of Window to allow navigation开发者_如何学C between windows in WPF application. But when adding content to the NavigationWindow in XAML, I am getting an error: "The type 'NavigationWindow' does not support direct content". How can I overcome this problem?
You can't add any content to a NavigationWindow. It is just a "Window" where the Page is going to run, so you have to tell the NavigationWindow wich Page it is going to initial run, you do that by using "Source" Like this:
<NavigationWindow x:Class="Tes.TesWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Test" Height="300" Width="300" Source="Window1.xaml">
</NavigationWindow>
See a tutorial here: http://windowsclient.net/learn/video.aspx?v=4190
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论