Edit: Repro Download (.zip)
I've made a UserControl consisting of 3 sliders and some labels. Meant for manipulating translation, rotation and scale values of a class.
Each UserControl has their own Translation, Rotation and Scale property. The Value of the corresponding slider is bound to this property.
This all works as it should until the user tries to manually change the value by sliding the slider with their mouse. For whatever reason, this doesn't update the property.
This is an example of how one of the sliders are set up:
<Slider x:Name="sliderTranslation" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" ToolTip="{Binding Value, RelativeSource={RelativeSource Self}}" Value="{Binding Path=Translation}" Thumb.DragCompleted="SliderTranslation_DragCompleted" Maximum="65535" TickFrequency="0" SmallChange="1" AutoToolTipPlacement="TopLeft"/>
And this is how my DataGrid is set up:
<DataGrid x:Name="dgValueList" Margin="10,72,10,76" SelectionMode="Single" IsReadOnly="True" BorderThickness="2" AlternationCount="2" EnableRowVirtualization="False">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Face Values" Width="*" CanUserReorder="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<local:FaceValueSlider/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
So for some context. The DataGrid consists of 49 of these UserControls. So essentially there are 147 sliders in total.
Lets use the very first UserControl as an example, it has these values;
Translation: 3380
Rotation: 49972
Scale: 16807
If I move the Translation slider to its maximum which is 65535 and save, the returning value I get is still 3380. However if I update them via a method I added it works as intended. It's only when they try and slide it manually it does this.
On top of that I also get 51 warnings related to the UserControls which I have no idea what they mean. Here's 2 of them:
System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=(0); DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'ClearTypeHint' (type 'ClearTypeHint'),
Am I doing this whole binding thing wrong? I've tried adding the UserControls to a List instead as they're created and setting the ItemsSource of the DataGrid.
But that ends up looking like this.