Hi, I'm stumped here. I have an observable collection that holds business objects. I have it bound to ItemsSource of a ListBox. I am updating the X and Y of my object and it is being displayed correctly in the UI during runtime as it is bound the the Item top and Left. But, here is where the problem is. I have also bound some data to be displayed in textblock text property and the data only displays the initial value. It never updates the textblock Text no matter how many times I change it.
Here is the XAML. If you see a problem with the XAML please let me know. Like I said, the X/Y - Top/Left binding works just fine and updates when changed, the TextBlock that is bound to DisplayData does not.
Also, my business object in my collection does Implement INotifyPropertyChanged.
I will try to make a small demo to replicate this if an answer can not be given just by looking at the XAML.
Thanks in advance!
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="614" Width="674">
<ListBox Name="PlottingBox" Background="White">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DisplayData}" />
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Canvas IsItemsHost="True" />
</Border>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Canvas.Left" Value="{Binding Path=PlotX}" />
<Setter Property="Canvas.Top" Value="{Binding Path=PlotY}" />
</Style>
</ListBox.ItemContainerStyle>
</ListBox>