Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi every body
i am new in wpf
i try to make an application with NavigationWindows

1.in my project i make a directory with name 'dir1' and add a page that named 'Page1.xaml' in it.

2.i add another page named 'MainPage.xaml' in the root and put a button in it to click on it and navigate to page1.xaml in directory 'dir1'....

3.i changed my MainWindow.xaml file to :

C#
<navigationwindow x:class="ShahrdariKashan.MainWindow" xmlns:x="#unknown">
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Source="MainPage.xaml"
                  FlowDirection="RightToLeft"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" WindowState="Maximized">
    
</navigationwindow>



4.i change my app.xaml file like bellow:

C#
<application x:class="ShahrdariKashan.App" xmlns:x="#unknown">
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <application.resources>
         
    </application.resources>
</application>


in the button's click event i write ;

C#
NavigationService.Navigate("/dir1/Page1.xaml");


but no work ,
please help me;
thanks alot
Posted
Updated 7-May-12 21:36pm
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900