Jump to content
LaunchBox Community Forums

Recommended Posts

Posted

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!

Posted

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.

 

 

 

 

  • Thanks 1
Posted (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 by NJDave71
  • 3 weeks later...
Posted
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!

Posted

 

<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. 

  • Like 1
Posted
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.

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...