When using ItemsControl
to bind to a property of type List<byte>
, I get the correct values in one direction (displayed using a TextBox
with a hexadecimal StringConverter
), but changing the value has no effect (i.e. the source is not updated). Binding mode is the default. Changing the property to be a ObservableCollection
instead of a list has no effect. (The problem is independent of whether the StringConverter
is used or not.)
The item template (working in the source-to-display direction) I'm using below.
<ItemsControl
ItemsSource="{Binding Context.ContentBytes}">
<!-- Container configuration -->
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="8" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox
Margin="5,5,5,5"
Text="{Binding .}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
The property I'm binding to is defined as public ObservableCollection<byte> ContentBytes { get; set; }
.