I have created a spin button user control spin button. XML is:
& lt; UserControl x: class = "MyApp.SpinButton" x: name = "spinner" [...] & gt; & Lt; Grid X: Name = "Layouts" & gt; & Lt; StackPanel margin = "8,8,8,0" workspaceElement = "top" orientation = "horizontal" & gt; & Lt; Text box x: name = "text" textweeping = "wrap" text = "{binding number, mode = twon, elementname = spinner}" text alignment = "center" width = "120" input scope = "telephone number" /> ; & Lt; Button x: name = "plusbutton" content = "+" border area = "3,3,0,3" margin = "- 12,0,0,0" width = "55" click = "plus button_link" padding = " 0 "style =" {static processing button style} "/> & Lt; Button x: name = "mins button" content = "-" width = "55" click = "minusbutton_click" padding = "0" style = "{static processing button style}" /> & lt; / StackPanel & gt; & Lt; / Grid & gt; & Lt; / UserControl & gt; and spin button. Xaml.cs is
public partial square spin button: user control, INotifyPropertyChanged {Private int count, min, max; Public Ent Calculation {Received {Return Count; } Set {count = value; Changed ("count"); }} Public Mandatory Min {get {return min; } Set {min = value; Changed ("min"); Changed ("count"); }} Public atx {get {return max; } Set {max = value; Changed ("max"); Changed ("count"); }} Public spin button () {initial group (); } Private Event PropertyChangedEventHandler PropertyChanged; Private zero changed (string asset) {if (calculated & lt; min) calculation = minimum; If (calculation & gt; max) calculation = max; If (property changed! = Null) {property changed (this, new asset changing event ARG (property)); }} Private Zero PlusButton_Click (Object Sender, RoutedEventArgs e) {Count ++; } Private Zero MinusButton_Click (Object Sender, RoutedEventArgs e) {count--; }} I want to use this control in one page. It works perfectly:
& lt; Local: SpinBaton calculation = "20" minimum = "0" max = "255" /> But this is not the case:
& lt; Local: spin button calculation = "{some binding some IITproperty}" minimum = "0" max = "255" /> I have an XamlParseException with error AG_E_PARSER_BAD_PROPERTY_VALUE while specifying the melting feature.
Any idea can be wrong and how can I fix it?
I believe the calculation needs to be dependent property to support data binding.
Comments
Post a Comment