我做了最简单的事情。我打开一个新窗口并在其中放置一个框架,并且我想在框架中显示一个页面。 窗口代码:浏览wpf中的页面不工作
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
Page1 p = new Page1();
navigator.NavigationService.Navigate(p);
}
}
导航是帧,在第1页予有黑色背景颜色看出差别。当我运行它时,我仍然看到窗口,而不是应该在框架内的页面。为什么这不起作用?
,但我得到了白色的。
第1页的代码:
<Page x:Class="test.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="269" d:DesignWidth="292"
Title="Page1">
<Grid Background="Black">
</Grid>
在CS方面我没有写任何东西。
_page1_的代码是什么? – Ron
我将它添加到问题中。 – EldarGoren