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
1650
NullText issues and triggers kicking in
posted

Hi there

I have a style that changes the Foreground property of my editor in case a NullText is being displayed:

        <Style.Triggers>
          <!-- change foreground when displaying null texts -->
          <Trigger Property="igEditors:XamTextEditor.Text"
                   Value="">
            <Setter Property="Foreground"
                    Value="#FFABABAB" />
          </Trigger>
        </Style.Triggers>

 

Now strange enough, if the text of the editor is being set programmatically during initialization, the trigger kicks in, and the real text is displayed in grey as well. However, as soon as I select the editor, the Foreground is being adjusted to the correct value and also stays that way if the editor loses focus - looks like a bug to me.

...and as a sidenote: Use NullTexts is somewhat of a pain and pretty inconsistent:

  • Just clearing the text editor sets the underlying property to an empty string, which doesn't cause the NullText to be displayed. Do I really have to write a converter or is there a way to have the NullText displayed for empty strings on an editor?
  • As you can see in the snippet above, I have to trigger the foreground if the Text is an empty string rather then testing for {x:Null} although the bound property is null. Strange as well...

 

Cheers,

Philipp 

Parents
No Data
Reply
  • 138253
    Offline posted

    Hello Philipp,

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

    If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.

Children
No Data