WPF_ DataGrid选中当前行事件绑定
2025年1月5日小于 1 分钟
View
<DataGrid SelectedItem="{Binding DataGridSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" >
ViewModel
private object m_dataGridSelected;
public object DataGridSelected
{
get => m_dataGridSelected;
set {OnDataGridSelectChanged(value);SetProperty(ref m_dataGridSelected, value);}
}
private static void OnDataGridSelectChanged(object obj)
{
// ....
}