Forums

Support for DataTrigger?
Last Post 26 Aug 2017 08:17 AM by Filip Dušek. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
James HaywoodUser is Offline
New Member
New Member
Posts:5


--
24 Aug 2017 03:03 PM
    I understand that you can often get by without DataTriggers by putting the trigger logic in the ViewModel, but it's still a nice tool to have in your toolbox and makes it easier to share UI components. Do you have any plans to add DataTrigger support in the future?


    This is an example of what I wanted to do...

    <TextBlock>
    	<TextBlock.Style>
    		<Style TargetType="TextBlock">
    			<Setter Property="Text" Value="(N)ew Game | (Q)uit"/>
    			<Style.Triggers>
    				<DataTrigger Binding="{Binding CanLoadGame}" Value="true">
    					<Setter Property="Text" Value="(L)oad | (N)ew Game | (Q)uit"/>
    				</DataTrigger>
    			</Style.Triggers>
    		</Style>
    	</TextBlock.Style>
    </TextBlock>
    


    Like I said, I know this can be moved to the ViewModel, but I guess I'm a WPF traditionalist and I like to keep UI stuff in the UI.
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:676


    --
    26 Aug 2017 08:17 AM
    It's on my list. Data Triggers are nice for some stuff tho, i never need one while making my game on the end.
    You are not authorized to post a reply.