Как исправить ошибку System.InvalidOperationException: "Недопустимый для переходов корневой элемент "PlantsProject.PlantsPage"."?
Вызов нужного окна в C#
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
MainFrame.Content = new PlantsPage();
}
}
Код в WPF
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="75"/>
<RowDefinition Height="*"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Image Source="/Resources/logo.png" HorizontalAlignment="Left"></Image>
<TextBlock Text="Header" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<Grid Background="White" ZIndex="-2"></Grid>
<Grid Grid.Row="2" Background="#76e383"></Grid>
<Button Name="PlantsPage" Grid.Row="1" Content="Go" Background="White"
Height="60" Width="200" FontSize="30"
Click="Button_Click"></Button>
<Frame Name="MainFrame" Grid.Row="1"></Frame>
</Grid>

