문제

I am developing an app using Devexpress Gridcontrol using Xaml. In a cell Template i am having a Textblock in which i want to Display 'Open' if the value in Binding is '0' and 'Close' if it is '0'. Can this be done using FormatterString ie. Using FormatStringConverter?

도움이 되었습니까?

해결책

Hope this helps. :)

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"


<TextBlock Text="{Binding Value}">
  <i:Interaction.Triggers>
    <ei:DataTrigger Value="0" Binding="{Binding Text, ElementName=Self}">
        <im:ChangePropertyAction PropertyName="Text"
                                         Value="Open"/>
    </ei:DataTrigger>
    <ei:DataTrigger Value="1" Binding="{Binding Text, ElementName=Self}">
        <im:ChangePropertyAction PropertyName="Text"
                                         Value="Close"/>
    </ei:DataTrigger>
  </i:Interaction.Triggers>
</TextBlock>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top