Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can i load my another test.xaml in mainwindow.xaml tabcontol content or in Grid??
Please give me some example i am new to wpf...

What I have tried:

XAML.Reader.Load have to use
Posted
Updated 7-Nov-16 4:46am
v2
Comments
[no name] 7-Nov-16 8:09am    
You use a XamlReader

1 solution

Is another test.xaml in the same solution as mainwindow.xaml? Also, is test.xaml a user control? If yes, then at the top declare: xmlns:view="clr-namespace:(project your test.xaml is in);assembly=(project your test.xaml is in) then inside your mainwindow.xaml in the tab control or grid simply do <Grid> <view:test/> </Grid> If you can give me a little more to go on I feel sure I can point you in the right direction.

This is an example of what it should look like for referencing a user control in your main window:

C#
<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:view="clr-namespace:MyTestProject;assembly=MyTestProject"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <view:Test />
    </Grid>
</Window>
 
Share this answer
 
Comments
Member 11621962 14-Nov-16 9:13am    
thanks j.Calhoun i have another question can you help me out??

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