将参数传递给在XAML框架中加载的用户控件

时间:2017-03-16 23:32:08

标签: c# wpf xaml

我有几个框架可以加载相同的用户控件User_Ctrl_foo.xaml,但是我希望将一个参数从 xaml

传递给框架
<StackPanel>
    <Border BorderThickness="1" BorderBrush="Gray" FlowDirection="LeftToRight">
     <Frame Name="form1" Content="Form" Visibility="{Binding IsChecked, ElementName=chk1,Converter={StaticResource b1v}}" Source="Form/User_Ctrl_foo.xaml" Height="600" Width="410" Margin="0"></Frame>


                                    </Border>
                                </StackPanel>
<StackPanel>
    <Border BorderThickness="1" BorderBrush="Gray" FlowDirection="LeftToRight">
     <Frame Name="form2" Content="Form" Visibility="{Binding IsChecked, ElementName=chk2,Converter={StaticResource b2v}}" Source="Form/User_Ctrl_foo.xaml" Height="600" Width="410" Margin="0"></Frame>


                                    </Border>
                                </StackPanel>

如何将参数传递到第"form1"帧,将其他参数传递给"form2"

0 个答案:

没有答案