0
SampleCommand가 실행될 때 Page1.xaml에서 프레임의 source 속성을 변경하려고합니다. View Model에서이를 어떻게 달성 할 수 있습니까?MVVM 및 리본 명령
Page1.xaml :
<r:RibbonTab.Groups>
<r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayout}">
<r:RibbonGroup.Command>
<r:RibbonCommand LabelTitle="RibbonButton"/>
</r:RibbonGroup.Command>
<r:RibbonButton x:Name="RibbonButton1" Command="{Binding Path=SampleCommand}"/>
</r:RibbonGroup>
</r:RibbonTab.Groups>
</r:RibbonTab>
</r:Ribbon>
<Border Name="PageBorder" Grid.Row="0" Grid.Column="1">
<Frame Name="pageFrame" Source="FirstPage.xaml" />
</Border>
</DockPanel>
C 번호 Page1ViewModel.cs :
RelayCommand _sampleCommand;
public ICommand SampleCommand
{
get
{
// create command ??
return _sampleCommand
}
page1.xaml.cs :
Page1ViewModel pageViewModel;
this.DataContext = pageViewModel; // pageloads 때