Jump to content
LaunchBox Community Forums

how do i add logic to my xaml to show a platform image as default unless a image for the selected game exists?


ksherfinski

Recommended Posts

for example:

I have a default image i like to use for all arcade games, which is basically a layout of my panel.  I'd like to change the image, when the selected game requires another type of controller, such as a light gun.  Currently I'm getting the game image on top of the platform image, in the scenario where the game image exists.

I did a quick look in the tutorials and help doc, so forgive me if this is something super simple.

thanks in advance

Link to comment
Share on other sites

After reading through Jason's LaunchBox theming PDF I found something quite useful in the examples that use Style Triggers.  You can basically build a case statement based on a SelectedGame property value (assuming it's exposed).  I'm sure there's a cleaner way to assign the bindings than what i show below, since i just copied that from an existing startup theme:

image.thumb.png.2971ca82af1092ef42f82c99b0a6f40c.png

 

 

Link to comment
Share on other sites

Style Triggers would be a better way. The way I did it in that theme you copied was pretty basic as I was just getting started with (and well still am) learning to code themes. I started updating that old code in those themes to use trigger, but I just do not have much time lately to finish polishing them off and posting. If you look in the BigBox theme folder at the Default theme the GameMarqueeView.xaml uses triggers to accomplish what you are asking. It would be a good file to review to see how to use them.

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