Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


In Main Window , I have frame ,i want to load page in this frame ,this page contains user control can u guide me or send snippets
HTML
<window x:class="Mydemo.MainWindow" xmlns:x="#unknown">
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="300" Width="300">
    <grid>
        <Frame Name="sdkFrame" Background="WhiteSmoke" Source="Page1.xaml" NavigationUIVisibility="Visible" />
    </grid>
</window>

C#
public MainWindow()
        {
            InitializeComponent();
            this.sdkFrame.Navigate(new Uri("Page1.xaml", UriKind.Relative));

        }
Posted
Updated 27-Dec-13 8:20am
v2

1 solution

I don't get it. You've already loaded the page1. Do you want to dynamically change it? If you want to load other page in your frame, such as by click event, you can use
this.sdkFrame.Source = new Uri("Page2.xaml", UriKind.Relative);
 
Share this answer
 
Comments
kingsa 27-Dec-13 21:25pm    
For me page1 also not loading, In page i am trying accessing database getting error like page 1 , line 7 error can u guide me
Xiao Ling 28-Dec-13 0:50am    
I just made a simple page with only text component. It could work. Probably your problem is not about the page loading, it's about the database access. so you can try to comment out the database access code to verify whether the page loading can work. If it can work, the issue must be caused by database access

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