DataBox
DataBox copied to clipboard
Looks like SelectedItem binding is not working?
It seems that SelectedItem binding is not working after I switched from DataGrid to DataBox. the code below still works when I use DataGrid. SelectedItem is always null.
in MainWIndowViewModel
private ObservableCollection<Device> _devices;
public ObservableCollection<Device> Devices { get => _devices; set => this.RaiseAndSetIfChanged(ref _devices, value); }
private Device _selectedDevice;
public Device SelectedDevice { get => _selectedDevice; set => this.RaiseAndSetIfChanged(ref _selectedDevice, value); }
XAML
<DataBox
CanUserResizeColumns="True"
GridLinesVisibility="All"
ItemsSource="{Binding Devices}"
SelectedItem="{Binding SelectedDevice, Mode=TwoWay}">
...
</Databox>