c# - Style for Textbox Silverlight -


I want to create a simple style for the text box.

OnFocus want to be able to change the border color of the text box.

I wrote the following and it works, however, everything has been rested, I have to declare the height, the feeling of non-centric bounds and the feeling is different. How can I create a template to affect only the ONFOROX state?

  & lt; Style x: key = "textbox type" targettype = "textbox" & gt; & Lt; Setter Property = "Borderbrush" Value = "Gold" /> & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "Textbox" & gt; & Lt; Grid Height = "{TemplateBinding Height}" & gt; & Lt; VisualStateManager.VisualStateGroups & gt; & Lt; VisualState Group x: Name = "General Location" & gt; & Lt; VisualState X: Name = "General" /> & Lt; VisualState X: Name = "mouseover" /> & Lt; VisualState X: Name = "Pressed" /> & Lt; VisualState X: Name = "Disabled" /> & Lt; / VisualStateGroup & gt; & Lt; VisualStateGroup x: Name = "FocusStats" & gt; & Lt; VisualState X: Name = "Focus" & gt; & Lt; Storyboard & gt; & Lt; Color animation storyboard TargetName = "brd" storyboard Targetproperty = "(border. Boardbrush). (SolidColorBrush.Color)" duration = "0" to = "red" /> & Lt; / Storyboard & gt; & Lt; / VisualState & gt; & Lt; VisualState X: Name = "Unfoxide" /> & Lt; / VisualStateGroup & gt; & Lt; /VisualStateManager.VisualStateGroups> & Lt; Border x: name = "brd" BorderBrush = "{TemplateBinding BorderBrush}" BorderThickness = "{TemplateBinding BorderThickness}" background = "{TemplateBinding background}" cornerRadia = "2" & gt; & Lt; ContentPresenter x: name = "content presenter" /> & Lt; / Border & gt; & Lt; / Grid & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt; You need to duplicate the entire template of the original text box that you can find.  


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -