Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
415
XamTextEditor -Null text styling
posted

Hi

I am using MS Expression Blend (v4) to template and style my controls (for a new application)

On the XamTextEditor  you can define the null text and following creating it into a template you can change various attributes.

For example, I have set a storyboard for got focus and lost focus (on the current and the edit controls) to ensure that when the user moves over or into the editbox the background colour changes.

This was achieved using storyboards and event triggers (on the mouseEnter/Leave for the textblock and the IsFocused attribute of the PART_FocusSite)

 

I have additionally modified the <igWindows:SimpleTextBlock ..> control in the current template to make the NULL text appear as Italics.

Howerver, following user data input and when they move out of that control, the standard input text reverts to italics (as opposed to Normal) .  I think I understand that this may be due to the displaytext being reset to that input by the user (thus overwriting the null text value)

In this case (where the NULL text is NOT going to be used) I need to ensure that the FontStyle is reverted to Normal

I cannot see a trigger or event which I can trap in the resources to handle this.

Is there a way to achive this, i.e. NULL text to appear in Italics and when control has value and user text is entered this to appear as Normal?

 

It would be great if all this could be achieved in the resource file as I can then ship this (complete with outer changes) to be used on other projects and by other developers in the company.

Thanks

Urfan

 

Parents
No Data
Reply
  • 5600
    Suggested Answer
    Offline posted

    Hello,

    Look at the attached sample.

    I just add defaultStyle for XamTextEditor in my project(which is in the defaultStyle folder in installed location: C:\ProgramFiles\Infragistics...). And add one trigger in this defaultStyle file(named EditorsGeneric_Express.xaml).

    When nullText is visible in the xamTextEditor the value property is 'null'.

    So this trigger checks if Value={x:Null} and set the FontStyle property to Italic.

    Hope this helps.

    Best regards,

    Anastas

     

    WpfApplication4.zip
Children