Leider muss ich das Thema MVVM Binding to DataGrid CellInfo nochmal aufgreifen..
Funktioniert -> Die DataGrid ist mit Daten gefüllt, ich habe den Window Title ins VM gebunden
Der TabControl Selected Index ist ins VM gebunden
Wer hat noch eine Idee??
Ich kann den Wert CellInfo nicht abrufen, die set property wird nicht aufgerufen
Test:
C#-Quelltext
1:
| MessageBox.Show("CellInfo: " + _CellInfo.Column.Header.ToString()); -> Das Fenster wird nicht erzeugt |
->Weitere Verwendung von CellInfo = Null
XAML
XML-Daten
1: 2: 3: 4:
| <DataGrid DataContext="{StaticResource vm}"
... CurrentCell="{Binding CellInfo,Mode=OneWayToSource}" Focusable="True" |
c# viewmodel vm
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| private DataGridCellInfo _CellInfo; public DataGridCellInfo CellInfo { get { return _CellInfo; } set { MessageBox.Show("CellInfo: " + _CellInfo.Column.Header.ToString());
SetProperty(ref _CellInfo, value); } } |
Moderiert von Th69: C#-Tags hinzugefügt
Moderiert von Th69: XML-Tags hinzugefügt