Jump to content
LaunchBox Community Forums

Community Star Rating to BB Theme...is there a simple way?


Expello

Recommended Posts

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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 3 weeks later...
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!

Link to comment
Share on other sites

 

<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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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