我用的是ModernWindow框架,现在就是在MordernWindow定义了一个按钮和一个标签,在点击按钮的时候总是回到一个主界面,在UserControl切换的时候,可以让标签改变值,要怎么做啊
不知道你这个问题是否已经解决, 如果还没有解决的话:<Window x:Class="WpfDemo.UserControlDemo.UseUserControlWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:userControlDemo="clr-namespace:WpfDemo.UserControlDemo"
mc:Ignorable="d"
Title="UseUserControlWindow" Height="600" Width="400">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.2*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="0.2*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Label Content="使用OwnUserControl用户控件"></Label>
<userControlDemo:OwnUserControl Grid.Row="1"></userControlDemo:OwnUserControl>
<Label Grid.Row="2" Content="使用UseUserControlUserControl用户控件"></Label>
<userControlDemo:UseUserControlUserControl Grid.Row="3"></userControlDemo:UseUserControlUserControl>
</Grid>
</Window>