Page 1 of 1

Binding to usercontrol property does not update

Posted: Mon Oct 03, 2016 11:20 pm
by tn1
I'm testing a simple case of a user control which has a custom dependency property. When using this usercontrol the twowaybinding to the new property does not seem to update.

Steps to recreate:
Create usercontrol which contains a textbox. The usercontrol has a custom dependency property which is bound in the usercontrol to the textbox text property. When this usercontrol is instantiated in the mainwindow and the usercontrol's text property is bound to a local property the update does not occur. The usercontrol's property is being updated (debugging in the simulator), but the change does not propagate back to the original binding in the mainwindow.

All bindings are twoway. We use this a lot in our original Silverlight application (where it works).

Code extract:
public partial class ucEditBox : UserControl
{
...
// DependencyProperty: Text
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register("Text", typeof(string), typeof(ucEditBox), null);

public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}

...
}

Xaml:
<UserControl
x:Class="XX1.ucEditBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="ctrlEdit"
xmlns:local="using:XX1">
<StackPanel x:Name="LayoutRoot" Orientation="Horizontal" HorizontalAlignment="Left" Height="26" >
<TextBox x:Name="txt"
Text="{Binding Text, Mode=TwoWay, ElementName=ctrlEdit}"
MinWidth="{Binding ElementName=ctrlEdit, Path=MinWidthEdit, Mode=OneWay}"
TextAlignment="{Binding ElementName=ctrlEdit, Path=TextAlignment, Mode=OneWay}"
/>
</StackPanel>
</UserControl>

Re: Binding to usercontrol property does not update

Posted: Tue Oct 04, 2016 12:06 am
by JS-Support @Userware
Hi,

Thank you for reporting this issue.

It indeed appears to be a defect.

We are going to fix it asap.

I'll keep you updated.

Regards,
JS-Support

Re: Binding to usercontrol property does not update

Posted: Wed Nov 23, 2016 3:11 am
by tn1
Any idea when this is planned to be fixed?