[ACCEPTED]-Set Window.Content to a page by XAML?-window
Accepted answer
Use a Frame element to show the content 1 of the page.
<Window> <Frame Source="/Pages/MyPage.xaml"/> </Window>
Try something like this, where MyPageAssembly points to 2 the assembly where your page resides, and 1 MyPage is the name of the Page.
<Window
x:Class="MyWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:MyPageAssembly="clr-namespace:MyPage;assembly=MyPageAssembly"
Title="ContactsSelector"
Height="300"
Width="300"
>
<Window.Content>
<MyPageAssembly:MyPage />
</Window.Content>
</Window>
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.