Playnite Forums
data triggers - Printable Version

+- Playnite Forums (https://playnite.link/forum)
+-- Forum: Development (https://playnite.link/forum/forum-10.html)
+--- Forum: Themes (https://playnite.link/forum/forum-9.html)
+--- Thread: data triggers (/thread-1082.html)



data triggers - tillaz87 - 01-10-2022

How can i use a data trigger to change matadata values to my own text string or image? 

for example if PEGI 18 exists show 18? or even an image?

tried this as a guess but just crashes. 

<ControlTemplate.Triggers>
    <DataTrigger Binding="{Binding SelectedGame.AgeRatings[0].Name}" Value="PEGI 18">
       <Setter Property="Text" Value="18" TargetName="AgeRatings" />
    </DataTrigger>
</ControlTemplate.Triggers>



RE: data triggers - Crow - 01-10-2022

This is all context sensitive, "SelectedGame" doesn't always exists, depending on a view or control. I currently do not officially support direct binding to game data like this since it can lead to several issues (or be broken by changes I make in an update), like crashes.

The only direct binding scenario I support is if it's provided by Blend editor context on some views, you can see if that's the case for a specific view here:
https://playnite.link/docs/master/tutorials/themes/various.html#adding-additional-information-to-views

As far as general translation of fields, that's planned in future: https://github.com/JosefNemec/Playnite/issues/1902


RE: data triggers - tillaz87 - 01-11-2022

(01-10-2022, 07:44 PM)Crow Wrote: This is all context sensitive, "SelectedGame" doesn't always exists, depending on a view or control. I currently do not officially support direct binding to game data like this since it can lead to several issues (or be broken by changes I make in an update), like crashes.

The only direct binding scenario I support is if it's provided by Blend editor context on some views, you can see if that's the case for a specific view here:
https://playnite.link/docs/master/tutorials/themes/various.html#adding-additional-information-to-views

As far as general translation of fields, that's planned in future: https://github.com/JosefNemec/Playnite/issues/1902

Thanks for reply is it possible to add the date in xaml for example "Tuesday, January 11, 2022"

I've tried I few things but had no look 


RE: data triggers - tillaz87 - 01-12-2022

Never mind figured it out