Jump to content
LaunchBox Community Forums
Jason Carr

XAML Tips and Tricks

Recommended Posts

2 hours ago, Krakerman said:

@faeran is there a way to use a say _Default background if the game background not found? So I would not have to create 600+ backgrounds per say for each game I could use a different default one for each platform and then that way I can create a background for certain ones within that coverflow view using your xml code you gave me.

With your added xml it is always looking for each games background image if one not there this it diplays a black background which I want to use a custom _default image.

There's a few different ways you can do this. The simplest solution would be to just place a second "default" image behind your game background image.

Share this post


Link to post
Share on other sites

How would I do that? and would it work as a per platform basis? So each platform could have a different image

Edited by Krakerman

Share this post


Link to post
Share on other sites
16 minutes ago, Krakerman said:

How would I do that? and would it work as a per platform basis? So each platform could have a different image

Something like this.

Spoiler

<TextBlock x:Name="PlatformBackgrounds" Visibility="Collapsed">
            <TextBlock.Text>
                <MultiBinding StringFormat="{}pack://siteoforigin:,,,/Themes/Unified Redux/Images/PlatformBackgrounds/{0}.png">
                    <Binding Path="ActiveGame.Platform" />
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
        <Image Source="{Binding Text, ElementName=PlatformBackgrounds}" RenderOptions.BitmapScalingMode="HighQuality" Height="{Binding ElementName=Canvas, Path=ActualHeight}" Width="{Binding ElementName=Canvas, Path=ActualWidth}" />

<TextBlock x:Name="GameBackgrounds" Visibility="Collapsed">
            <TextBlock.Text>
                <MultiBinding StringFormat="{}pack://siteoforigin:,,,/Themes/Unified Redux/Images/GameBackgrounds/{0}/{1}.png">
                    <Binding Path="ActiveGame.Platform" />
                    <Binding Path="ActiveGame.Title" />
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
        <Image Source="{Binding Text, ElementName=GameBackgrounds}" RenderOptions.BitmapScalingMode="HighQuality" Height="{Binding ElementName=Canvas, Path=ActualHeight}" Width="{Binding ElementName=Canvas, Path=ActualWidth}" />

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Damn! You da man 👍😁 Works perfectly!!

Thank you for all the help..

Edited by Krakerman
  • Like 1

Share this post


Link to post
Share on other sites

I am trying to get gifs to load from a platform folder and using the game name but doesn't work. Example:

<Image gif:ImageBehavior.AnimatedSource="{}pack://siteoforigin:,,,/StartupThemes/LBFade/Images/Gifs/{0}/{1}.gif" RenderOptions.BitmapScalingMode="HighQuality" Height="{Binding ElementName=Canvas, Path=ActualHeight}" Width="{Binding ElementName=Canvas, Path=ActualWidth}">
</Image>

I do have GIFs working just want to keep them organized within a platform folder and each game could have it's own gifs when launching the game. This code above does not work. This is for the startup theme.

Here is what I do have that works:

<Image gif:ImageBehavior.AnimatedSource="{}pack://siteoforigin:,,,/StartupThemes/LBFade/Images/Gifs/Atari 2600.gif" RenderOptions.BitmapScalingMode="HighQuality" Height="{Binding ElementName=Canvas, Path=ActualHeight}" Width="{Binding ElementName=Canvas, Path=ActualWidth}">
</Image>

This works for fullscreen 3840x2160 gifs with transparent backgrounds 😁

Edited by Krakerman

Share this post


Link to post
Share on other sites

@Krakerman The prior code @faeran gave you for you game specific backgrounds will work as well. Just make a little edit to the source and change the path to the correct folder structure and change the file type to .gif. Something like below. The x:Name can be anything you want to call it. Just make sure in the "ElementName" you reference the same name there. I use something similar to this for gifs.

			<TextBlock x:Name="GameGifs" >
				<TextBlock.Text>
					<MultiBinding StringFormat="{}pack://siteoforigin:,,,/StartupThemes/LBFade/Images/Gifs/{0}/{1}.gif">
						<Binding Path="SelectedGame.Platform" />
						<Binding Path="SelectedGame.Title" />
					</MultiBinding>
				</TextBlock.Text>
			</TextBlock>
			<Image gif:ImageBehavior.AnimatedSource="{Binding Text, ElementName=GameGifs}" Stretch="UniformToFill" RenderOptions.BitmapScalingMode="HighQuality"
            Height="{Binding ElementName=Canvas, Path=ActualHeight}" Width="{Binding ElementName=Canvas, Path=ActualWidth}"  />	 

 

Share this post


Link to post
Share on other sites

I want to be able to launch this within xaml if possible:

C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe -wallpaperloadprofile "Default"

Is this possible to add within xaml in LB/BB? Also within that command line the quotes need to be included.

I know already how to add it within LB/BB as Additional Apps but I want to embed this in my themes code if possible.

 

Edited by Krakerman

Share this post


Link to post
Share on other sites

Did fix a minor issue with the gif code that I was using that corrected a small issue and now is working perfectly in my startup/shutdown themes

Update: Now have Gif support added to my pause themes 👍

Edited by Krakerman

Share this post


Link to post
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
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...