I would like to use the built-in Silverlight 4.0 field check in the following code, and I am having trouble working with it.
MyForm.fs:
type MyForm() as this =
inherit UriCanvasControl("/Project;component/MyForm.xaml", "Enter Stuff")
[<DefaultValue>]
val mutable myTextBox: TextBox
do
Application.LoadComponent(this, base.uri)
this.myTextBox <- this?myTextBox
MyForm.xaml:
<TextBox Name="myTextBox" Text="{Binding Path=myTextBox,Mode=TwoWay,ValidatesOnExceptions=True,NotifyOnValidationError=True}" TextChanged="Duration_Changed" Grid.Column="0" Margin="0,0,2,0"></TextBox>
I tried putting annotations over the myTextBox field in the .fs file, but the compiler complained about it (annotations like :) [Required(ErrorMessage="enter something!")].
Any ideas? Thank.
source
share