Jump to content
LaunchBox Community Forums
Jason Carr

XAML Tips and Tricks

Recommended Posts

Hey everybody, post your XAML tips and tricks to share with other theme creators here. For starters, here's how to add an image with a relative path:
<Image Source="pack://siteoforigin:,,,/Themes/CleanHardware/img/white-corner.png" RenderOptions.BitmapScalingMode="HighQuality" />
Note that the "pack://siteoforigin:,,," is basically replaced with the LaunchBox folder path. Also note the forward slashes instead of backslashes. :)
  • Like 1

Share this post


Link to post
Share on other sites
using the ZIndex will set the layers of your images so you can put them in front of others images or videos very useful when making your theme!
<Grid Grid.Column="1" Panel.ZIndex="8"> <Image Margin="-50,0,0,0" Name="zboy" DockPanel.Dock="Right" Stretch="none" Source="K:\Arcade\LaunchBox \Themes\backgrounds\dk.png" RenderOptions.BitmapScalingMode="HighQuality"/> </Grid>
PS: jason thanks for making this thred it will be good...for all...

Share this post


Link to post
Share on other sites
this would be the best way to add a giff to the mix using "MediaElement"
<Grid Grid.Column="1" Panel.ZIndex="3"> <MediaElement Margin="-1200,-1200,0,0" Name="gamer" DockPanel.Dock="Left" Stretch="none" Source="K:\Arcade\LaunchBox\Themes\backgrounds\Super.gif" RenderOptions.BitmapScalingMode="HighQuality"/> </Grid>
PS : grant that the transparent part of the gif is filled with black....not the best but ok when put in a black area... and still will need a "code" to make it loop... enjoy

Share this post


Link to post
Share on other sites
eric said this would be the best way to add a giff to the mix using "MediaElement"
<Grid Grid.Column="1" Panel.ZIndex="3"> <MediaElement Margin="-1200,-1200,0,0" Name="gamer" DockPanel.Dock="Left" Stretch="none" Source="K:\Arcade\LaunchBox\Themes\backgrounds\Super.gif" RenderOptions.BitmapScalingMode="HighQuality"/> </Grid>
PS : grant that the transparent part of the gif is filled with black....not the best but ok when put in a black area... and still will need a "code" to make it loop... enjoy
I'm interested in doing something with this. Can you elaborate further on the looping 'code'? Or is that something jason has to do internally?

Share this post


Link to post
Share on other sites
Hi guys and Gals. What xaml editor is being used to edit your themes? I'm using Kaxaml and I keep getting "cannot find resource named 'UserControlStyle'. Resource names are case sensitive." on line 10. TIA

Share this post


Link to post
Share on other sites
Yes took a look at Kazaml and it wouldn't load the same files , I've also installed visual studio in the hope to get a working environment so I can see the changes I'm making but that also didn't seem to work. Does anyone know of a way we can create these themes in a live type view or is this not possible

Share this post


Link to post
Share on other sites
I have VS but I haven't looked at the XAML yet what file do I try to edit? I'll test and see if what's up.

Share this post


Link to post
Share on other sites
Kazaml gives up some broken lines but nothing is broken. Can we see the resources in VS?

Share this post


Link to post
Share on other sites
I have experience at making forms and I know that has a lot of visual capability lets you drag and drop elements wherever you want. I assume the same for XAML but not sure that is why I offered to test.

Share this post


Link to post
Share on other sites
The files are in the launchbox themes folder default/views/***any of these***.xaml files , best to copy the default folder and change the name first tho Wink

Share this post


Link to post
Share on other sites
Are the xaml files based on the latest .NET? What VS version would you recommend?

Share this post


Link to post
Share on other sites
Hi, I have not tried this but plan on it. I thought it might be useful since some where wondering about. Editing XAML Live in VS Edit - So I did try with those option enabled and could not get the Live Tree or other to even show up. It might have to do with the copy of VS I have so redownloading just the express version and will try again.

Share this post


Link to post
Share on other sites
Anyone got a solution yet? this is why I stopped messing with vs along time ago :P I'm sure somebody should step in a say something because the thread is loosing its purpose with talk of this issue. #nevergonnagettofinishacustomthemeatthisrate

Share this post


Link to post
Share on other sites
Hi all, I've been waiting to focus on this until after we get the official version out. Ultimately the issue you guys are running into I think is that the editor(s) aren't able to reference the classes inside of LaunchBox.exe and BigBox.exe. UserControlStyle, for instance is part of BigBox.exe. So if we can manage to figure out how to get the editor to pull resources from LaunchBox.exe and BigBox.exe, then that should fix those issues. It may be as easy as copying those files into the same folder as the XAML files, but it probably depends on the editor. Shortly after the release on Monday I'll be looking into the best visual editor to use as well as hopefully doing a tutorial. I didn't want to do that stuff without making sure everything was nailed down first in an official release.

Share this post


Link to post
Share on other sites
Jason Carr said Hi all, I've been waiting to focus on this until after we get the official version out. Ultimately the issue you guys are running into I think is that the editor(s) aren't able to reference the classes inside of LaunchBox.exe and BigBox.exe. UserControlStyle, for instance is part of BigBox.exe. So if we can manage to figure out how to get the editor to pull resources from LaunchBox.exe and BigBox.exe, then that should fix those issues. It may be as easy as copying those files into the same folder as the XAML files, but it probably depends on the editor. Shortly after the release on Monday I'll be looking into the best visual editor to use as well as hopefully doing a tutorial. I didn't want to do that stuff without making sure everything was nailed down first in an official release.
We need themes for launchbox, we're junkies addicted to good looking graphics even though we play 8bits games :D
  • Like 2

Share this post


Link to post
Share on other sites
Jason Carr said Hi all, I've been waiting to focus on this until after we get the official version out. Ultimately the issue you guys are running into I think is that the editor(s) aren't able to reference the classes inside of LaunchBox.exe and BigBox.exe. UserControlStyle, for instance is part of BigBox.exe. So if we can manage to figure out how to get the editor to pull resources from LaunchBox.exe and BigBox.exe, then that should fix those issues. It may be as easy as copying those files into the same folder as the XAML files, but it probably depends on the editor. Shortly after the release on Monday I'll be looking into the best visual editor to use as well as hopefully doing a tutorial. I didn't want to do that stuff without making sure everything was nailed down first in an official release.
Any progress?

Share this post


Link to post
Share on other sites
Hey all, I'm hoping to put out a tutorial tomorrow to wrap everything up. The latest betas include project files to open up the themes in Visual Studio and allow you to visually change them. I'm in the live development stream right now and we just added gif support. You can add animated gifs to Big Box now (or you will be able to after this new beta goes out later today). Just put this in the header UserControl tag: xmlns:gif="clr-namespace:WpfAnimatedGif;assembly=BigBox" And then, wherever you want to use a gif, create a new Image tag and add a property to it like this: gif:ImageBehavior.AnimatedSource="D:\Cat-party.gif" We're using the XamlAnimatedGif library here: https://github.com/XamlAnimatedGif/WpfAnimatedGif You can see their documentation for more details on more things you can do.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×