<Window x:Class="MyWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:WpfApplication1"
Title="ContactsSelector" Height="300" Width="300">
<Window.Content>
<src:MyPage>
<!--MyPage is a page that I created and exists in the project-->
</src:MyPage>
</Window.Content>
</Window>
我想一个窗口的内容设置为一个页面,就像我会编程做到这一点:
Dim w As New MyWindow
Dim p As New MyPage
w.Content = p
w.ShowDialog()
或将其设置在窗口的Load事件,简易我希望它在XAML来完成。