c# - Styling a TextBox with IDataErrorInfo in WPF -


I am trying to replace a text box so far, I have made it my textbox with this code Shows an asterisk on the right side of its border:

  & gt; Style target type = "{x: type text box}" & gt; & Lt; Setter Property = "Validation. Error Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate & gt; & Lt; Grid & gt; & Lt; TextBlock DockPanel.Dock = "Right" HorizontalAlignment = "Right" Foreground = "Red" FontSize = "14pt" font vect = "bold" text = "*" & gt; & Lt; / TextBlock & gt; & Lt; Border borderbrush = "red" borderline = "1" & gt; & Lt; AdrenAidElement placeholder name = "control with error" /> & Lt; / Border & gt; & Lt; / Grid & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; Style.Triggers & gt; & Lt; Trigger Property = "Validation. HesError" Value = "true" & gt; & Lt; Setter property = "tooltip" value = "{binding path = (validation.error) [0] .ErrorContent}" /> & Lt; / Catalyst & gt; & Lt; /Style.Triggers> & Lt; / Style & gt;  

But I want my text box to be shown with a red triangle on the right upper corner. How do I get this style on my textbox?

Thank you.

I have already done what I wanted, it was just like this: / P>

  style target type = "{x: type text box}" & gt; & Lt; Setter Property = "Validation. Error Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate & gt; & Lt; Grid & gt; & Lt; Polygon point = "0,0 10,0 0,10,0,0" horizontal align = fill "true" = "red" flodeircture = "right toolefet" & gt; & Lt; / Polygon & gt; & Lt; Border borderbrush = "red" borderline = "1" & gt; & Lt; AdrenAidElement placeholder name = "control with error" /> & Lt; / Border & gt; & Lt; / Grid & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; Style.Triggers & gt; & Lt; Trigger Property = "Validation. HesError" Value = "true" & gt; & Lt; Setter Property = "Tooltip" value = "{Compulsive Relative Soros = {x: Static Relative Asus}}, path = (Validation. Arrays) [0] .airrontent}" /> & Lt; / Catalyst & gt; & Lt; /Style.Triggers> & Lt; / Style & gt;  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -