DataBox icon indicating copy to clipboard operation
DataBox copied to clipboard

Looks like SelectedItem binding is not working?

Open uno-studio opened this issue 11 months ago • 0 comments

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>

uno-studio avatar Jan 23 '25 09:01 uno-studio