Expello Posted December 31, 2017 Posted December 31, 2017 Hi, is there a simple way to add the "Community Star Rating" to an BigBox Theme as stars? Sorry, i am not a programmer... Value=">=1" (greater than or equal) doesnt work... :-D <DataTrigger Binding="{Binding SelectedGame.CommunityStarRating}" Value="1" > <Setter Property="Source" Value="pack://siteoforigin:,,,/Themes/Test/Images/Theme/1.png" /> Happy New Year! Thanks a lot! Quote
mcfilmmakers Posted December 31, 2017 Posted December 31, 2017 repeat the code 6 times, changing Value=1 to Value=2 and so on. Don't forget Value = 0. Quote
Expello Posted January 1, 2018 Author Posted January 1, 2018 hey mcfilmmakers, thanks for your reply...unfortunately that does not work. CommunityStarRatings are like this: 3.655578 Quote
mcfilmmakers Posted January 1, 2018 Posted January 1, 2018 You never said anything about a fraction of a value... on that I don’t know. The plugin API doesn’t mention how to use community ratings Quote
Expello Posted January 1, 2018 Author Posted January 1, 2018 true, I did not express myself clearly. my English is not that good. ok then we have to wait until it is implemented. Quote
NJDave71 Posted January 7, 2018 Posted January 7, 2018 The Community Star Rating value needs to be rounded 1.94569656 I am doing this in my theme Text="{Binding Path=ActiveGame.CommunityStarRating, StringFormat=N1}" value should be 1.9 Next on my list is to see if the data trigger with the image. 1 Quote
Expello Posted January 7, 2018 Author Posted January 7, 2018 @NJDave71 That works great! Thanks a lot! 1 Quote
cunningmunki Posted January 13, 2018 Posted January 13, 2018 Hi I've been trying to get this to work, but I'm clearly not doing it right. How does that line containing the 'StringFormat=N1' go into the DataTrigger line at the top of the thread? Quote
NJDave71 Posted January 13, 2018 Posted January 13, 2018 (edited) The f1 is the number of decimals to pass to trigger or display. <TextBlock x:Name="tbCSRImage" Visibility="Collapsed"> <TextBlock.Text> <MultiBinding StringFormat="{}pack://siteoforigin:,,,/Themes/Aeon Nox/Images/etc/score/{0:F1}.png"> <Binding Path="ActiveGame.CommunityStarRating" /> </MultiBinding> </TextBlock.Text> </TextBlock> Edited January 31, 2018 by NJDave71 Quote
bbweiners Posted January 31, 2018 Posted January 31, 2018 On 12/31/2017 at 10:18 AM, Expello said: Hi, is there a simple way to add the "Community Star Rating" to an BigBox Theme as stars? Sorry, i am not a programmer... Value=">=1" (greater than or equal) doesnt work... :-D <DataTrigger Binding="{Binding SelectedGame.CommunityStarRating}" Value="1" > <Setter Property="Source" Value="pack://siteoforigin:,,,/Themes/Test/Images/Theme/1.png" /> Happy New Year! Thanks a lot! Could you post what you did to get this to work? Thanks! Quote
NJDave71 Posted January 31, 2018 Posted January 31, 2018 <TextBlock x:Name="tbCSRImage" Visibility="Collapsed"> <TextBlock.Text> <MultiBinding StringFormat="{}pack://siteoforigin:,,,/Themes/Aeon Nox/Images/etc/score/{0:F1}.png"> <Binding Path="ActiveGame.CommunityOrLocalStarRating" /> </MultiBinding> </TextBlock.Text> </TextBlock> <Image Source="{Binding Text, ElementName=tbCSRImage}" ... /> This block of XAML converts the Community Star Ratings from 4.234567 to 4.2. The result is a hidden textblock Value "../Themes/Aeon Nox/Images/etc/score/4.2.png." This Value is then used as the Image source and you get an image for each rating. 1 Quote
bbweiners Posted January 31, 2018 Posted January 31, 2018 12 minutes ago, NJDave71 said: <TextBlock x:Name="tbCSRImage" Visibility="Collapsed"> <TextBlock.Text> <MultiBinding StringFormat="{}pack://siteoforigin:,,,/Themes/Aeon Nox/Images/etc/score/{0:F1}.png"> <Binding Path="ActiveGame.CommunityOrLocalStarRating" /> </MultiBinding> </TextBlock.Text> </TextBlock> <Image Source="{Binding Text, ElementName=tbCSRImage}" ... /> This block of XAML converts the Community Star Ratings from 4.234567 to 4.2. The result is a hidden textblock Value "../Themes/Aeon Nox/Images/etc/score/4.2.png." This Value is then used as the Image source and you get an image for each rating. It worked! Thank you so much for your help. I really appreciate it. Quote
bbweiners Posted January 31, 2018 Posted January 31, 2018 40 minutes ago, NJDave71 said: <TextBlock x:Name="tbCSRImage" Visibility="Collapsed"> <TextBlock.Text> <MultiBinding StringFormat="{}pack://siteoforigin:,,,/Themes/Aeon Nox/Images/etc/score/{0:F1}.png"> <Binding Path="ActiveGame.CommunityOrLocalStarRating" /> </MultiBinding> </TextBlock.Text> </TextBlock> <Image Source="{Binding Text, ElementName=tbCSRImage}" ... /> This block of XAML converts the Community Star Ratings from 4.234567 to 4.2. The result is a hidden textblock Value "../Themes/Aeon Nox/Images/etc/score/4.2.png." This Value is then used as the Image source and you get an image for each rating. I have one more question. Is there a way to make your theme wait a specific amount of time before loading the image source? Say, 1 second. Quote
NJDave71 Posted January 31, 2018 Posted January 31, 2018 That gets a little complex. you may want to do some research on Storyboard and WPF. I use that in the Aeon Nox theme to animate elements. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.