小编zhc*_*hma的帖子

如何单击页面的按钮来更改Windows框架的来源?

我有一个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)

wpf frame

5
推荐指数
1
解决办法
6045
查看次数

标签 统计

frame ×1

wpf ×1