按钮的命令是 ExcelExportCommand,它的 CommandParameter 是这样的:
<Button x:Name="ExcelExport" Grid.Row="1" Height="25" Width="100" Command="{Binding ExcelExportCommand}" CommandParameter="{Binding ElementName=ListTabControl, Path=SelectedIndex}">Export to Excel</Button>
如何以编程方式通过 ViewModel 获取 SelectedIndex?我是 MVVM 模式的新手,我想验证我是否采用了正确的方法。你能帮我吗?
提前致谢