【发布时间】:2015-05-31 14:55:36
【问题描述】:
我有一个 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>
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>
【问题讨论】:
-
你试过什么?你被困在哪里了?能具体一点吗?
-
我在页面中有一个按钮,我想更改框架的来源当我点击按钮时,我该怎么办?