Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

Commented Issue: Problem with convention binding to decimal property [90]

$
0
0
When a Silverlight textbox is bound to a decimal property using conventions, it is not possible to type a number followed by a decimal point. As soon as the decimal point is entered it disappears and the cursor moves back to the beginning of the textbox.

ViewModel:
public class TestViewModel : Screen
{
private decimal anyNumber;
public decimal AnyNumber
{
get { return anyNumber; }
set
{
anyNumber = value;
NotifyOfPropertyChange(() => AnyNumber);
}
}
}

View:
<UserControl x:Class="SilverlightApplication1.TestView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<TextBox x:Name="AnyNumber" Width="200" />
</StackPanel>
</UserControl>
Comments: I have the same issue too with British CultureInfo (en-GB). Textbox bound to a double VS 2013 - CM 1.5.2 - WPF Client (NET 4.5). When trying to enter 2.3 I can type the 2 but pressing the '.' doesn't append the decimal place then the 3 is added to give 23. At this point I can click the mouse and add the '.' in the middle.

Viewing all articles
Browse latest Browse all 1760

Trending Articles