我有一个WPF项目,我在Windows中添加了一个框架,框架的源是页面.我想实现单击页面中的按钮来更改框架的页面.
<Window x:Class="MagicArm.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MagicArm"
Title="MainWindow">
<Frame Name="FrameContent"Source="PageStart.xaml"></Frame>
</Window>
Run Code Online (Sandbox Code Playgroud)
PageStart:
<Page x:Class="MagicArm.PageStart"
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"
Height="452" Width="800"
Title="PageStart">
<Canvas>
<button name=""> </button>
</Canvas>
Run Code Online (Sandbox Code Playgroud)