Jump to content
LaunchBox Community Forums

XAML Tips and Tricks


Recommended Posts

On 11/16/2021 at 4:38 PM, ksherfinski said:

Hey Jason,

I know this is a super old thread, but did you ever figure out a way to make those classes available for reference in VS or a WSIWYG xaml editor?

I believe those issues were resolved, but that's over 5 years old, so at this point it's most likely completely irrelevant. What particular issues are you running into?

Link to comment
Share on other sites

Hey Jason,

When I create a project in VS 2022 CE, using some existing Startup/Pause xaml files, I can't use the visual editor, since the Unbroken.LaunchBox.Wpf assembly can't be found.  I'm using a box that has BB/LB installed.  What namespace should I use to access the Unbroken libs?  Do I need to just buck up and forget about using a layout tool for startup/pause themes and stick to editing the xaml files by hand?  I'm ok with that, but was hoping I'm just missing something obvious.

Thanks again for an amazing product.  I've been using it for a few years now and you continue to improve it on a regular basis.

Link to comment
Share on other sites

On 11/24/2021 at 1:46 PM, ksherfinski said:

Hey Jason,

When I create a project in VS 2022 CE, using some existing Startup/Pause xaml files, I can't use the visual editor, since the Unbroken.LaunchBox.Wpf assembly can't be found.  I'm using a box that has BB/LB installed.  What namespace should I use to access the Unbroken libs?  Do I need to just buck up and forget about using a layout tool for startup/pause themes and stick to editing the xaml files by hand?  I'm ok with that, but was hoping I'm just missing something obvious.

Thanks again for an amazing product.  I've been using it for a few years now and you continue to improve it on a regular basis.

Unbroken.LaunchBox.Wpf is an old DLL file that no longer exists. It was replaced by Unbroken.LaunchBox.Windows. So you might be able to fix the issue by adding a reference to that DLL file. :)

Link to comment
Share on other sites

 Things I wish I knew how to do, if possible:

 - Create an image slideshow

 - Display a total game count in gamewheel views  

 - Get previously played games, most played game

 - Count broken, hidden, completed, favorite games in platform and game wheel views

 - Auto capitalize first letter of text.  CTC doesn't support this right now and I'm not sure how to do it manually

 

Some stuff might be wishful thinking.  I have figured a few easy things out on my own like date formatting and such...  I have a lot of previous scripting and forms experience, I'm just new with xaml...

 

Rob

Link to comment
Share on other sites

11 hours ago, Rob_G said:

 Things I wish I knew how to do, if possible:

 - Create an image slideshow

 - Display a total game count in gamewheel views  

 - Get previously played games, most played game

 - Count broken, hidden, completed, favorite games in platform and game wheel views

 - Auto capitalize first letter of text.  CTC doesn't support this right now and I'm not sure how to do it manually

 

Some stuff might be wishful thinking.  I have figured a few easy things out on my own like date formatting and such...  I have a lot of previous scripting and forms experience, I'm just new with xaml...

 

Rob

To do image slideshows requires a plug-in, CTC already handles that.

some of the binding fields you mentioned are platform specific and not available or pertinent to game specific views, such as total game count

auto capitalize 1st letter of first word or each word would require a converter,  CTC can be modified to handle that

 

image.thumb.png.7dcb8cd58cf41013460492d9900a3f1d.png

Edited by y2guru
Link to comment
Share on other sites

18 hours ago, y2guru said:

To do image slideshows requires a plug-in, CTC already handles that.

some of the binding fields you mentioned are platform specific and not available or pertinent to game specific views, such as total game count

auto capitalize 1st letter of first word or each word would require a converter,  CTC can be modified to handle that

 

image.thumb.png.7dcb8cd58cf41013460492d9900a3f1d.png

 Is that going to be in CTC 2.3?

 

 One thing I am currently doing outside of CTC is showing the last played time.  It's a bit of a headache manually editing code each time I do an update.  It's the same code as released date, just a different binding path..  I also set the format of month to MMM so it's shorter.   

<TextBlock x:Name="variableLPD1" Text="{Binding Path=ActiveGame.LastPlayedDate}" Visibility="Collapsed"/>
<TextBlock x:Name="variableLPD1Formatted" Text="{Binding ElementName=variableLPD1,Path=Text, Converter={StaticResource FormatDateTime},ConverterParameter='MMM dd, yyyy'}" Visibility="Collapsed" />
<TextBlock x:Name="variableLPD1withfallbacklogic" Visibility="Collapsed" Text="{Binding ElementName=variableLPD1Formatted,Path=Text, Converter={StaticResource UseValueOrFallbackWithFormat},ConverterParameter='Never;None;No'}"/>
<TextBlock x:Name="Text12text" Opacity="1.0" Foreground="White" FontFamily="LAUNCHBOX_ROOT_FOLDER/Themes/Unified Lives!/Fonts/taileb.ttf#Microsoft Tai Le Bold" FontStyle="Normal" FontWeight="Normal" TextAlignment="Left" TextWrapping="NoWrap" TextTrimming="None" VerticalAlignment="Top" RenderTransformOrigin=".5,.5" Text="{Binding ElementName=variableLPD1withfallbacklogic, Path=Text}" 
FontSize="{Binding ElementName=Canvas,Path=ActualHeight, Converter={StaticResource ScalePropertyValueD}, ConverterParameter=FontSize;17;720}" >    
 

 

 Another item on my wishlist is being able to compare binding path values.  For example, I want to compare 'Platform' and 'KnownPlatformOrPlaylistTitle'.  If they are different, I will show platform and playlist info.  If they are the same, I will just show platform info and hide the other.

 

Rob

 

Link to comment
Share on other sites

23 hours ago, Rob_G said:

 Is that going to be in CTC 2.3?

P

 One thing I am currently doing outside of CTC is showing the last played time.  It's a bit of a headache manually editing code each time I do an update.  It's the same code as released date, just a different binding path..  I also set the format of month to MMM so it's shorter.   

<TextBlock x:Name="variableLPD1" Text="{Binding Path=ActiveGame.LastPlayedDate}" Visibility="Collapsed"/>
<TextBlock x:Name="variableLPD1Formatted" Text="{Binding ElementName=variableLPD1,Path=Text, Converter={StaticResource FormatDateTime},ConverterParameter='MMM dd, yyyy'}" Visibility="Collapsed" />
<TextBlock x:Name="variableLPD1withfallbacklogic" Visibility="Collapsed" Text="{Binding ElementName=variableLPD1Formatted,Path=Text, Converter={StaticResource UseValueOrFallbackWithFormat},ConverterParameter='Never;None;No'}"/>
<TextBlock x:Name="Text12text" Opacity="1.0" Foreground="White" FontFamily="LAUNCHBOX_ROOT_FOLDER/Themes/Unified Lives!/Fonts/taileb.ttf#Microsoft Tai Le Bold" FontStyle="Normal" FontWeight="Normal" TextAlignment="Left" TextWrapping="NoWrap" TextTrimming="None" VerticalAlignment="Top" RenderTransformOrigin=".5,.5" Text="{Binding ElementName=variableLPD1withfallbacklogic, Path=Text}" 
FontSize="{Binding ElementName=Canvas,Path=ActualHeight, Converter={StaticResource ScalePropertyValueD}, ConverterParameter=FontSize;17;720}" >    
 

 

 Another item on my wishlist is being able to compare binding path values.  For example, I want to compare 'Platform' and 'KnownPlatformOrPlaylistTitle'.  If they are different, I will show platform and playlist info.  If they are the same, I will just show platform info and hide the other.

 

Rob

 

provide additional date and time formatting you may want and I'll add them

but i have allowed time formatting for Last Played Date

image.thumb.png.3a422dc556cffbed558a8493231bb059.png

Link to comment
Share on other sites

  • 2 months later...

In the wheel, if I use Endless = False, the wheel will visually stop as desired but how do I get the wheel to stop direction wise? If I press down on the last item in the wheel, it still jumps to the top of the list.

 

<coverFlow:FlowControl

x:Name="FlowControl"

HorizontalAlignment="Stretch"

VerticalAlignment="Bottom"

Height="{Binding ElementName=Canvas, Path=ActualHeight}"

CoverFactory="{Binding CoverFactory}"

CustomImageType="Steam Banner"

ClipToBounds="True"

RenderOptions.BitmapScalingMode="HighQuality"


CurveAmount="0.0"

CameraZPosition="3.12"

VisibleCount="4"

PageSize="4"

Spacing="1.001"

MaxVerticalImageResolutionOverride="800"

Endless="False">
</coverFlow:FlowControl>

Edited by The Mask
Link to comment
Share on other sites

44 minutes ago, The Mask said:

In the wheel, if I use Endless = False, the wheel will visually stop as desired but how do I get the wheel to stop direction wise? If I press down on the last item in the wheel, it still jumps to the top of the list.

 

<coverFlow:FlowControl

x:Name="FlowControl"

HorizontalAlignment="Stretch"

VerticalAlignment="Bottom"

Height="{Binding ElementName=Canvas, Path=ActualHeight}"

CoverFactory="{Binding CoverFactory}"

CustomImageType="Steam Banner"

ClipToBounds="True"

RenderOptions.BitmapScalingMode="HighQuality"


CurveAmount="0.0"

CameraZPosition="3.12"

VisibleCount="4"

PageSize="4"

Spacing="1.001"

MaxVerticalImageResolutionOverride="800"

Endless="False">
</coverFlow:FlowControl>

Endless is a property that only designed to work using the new FlowControl, which is doesn't look like you are using there.

How exactly are you wanting to display your wheel?

 

Link to comment
Share on other sites

1 hour ago, The Mask said:

vertical. what do i change to convert it to the new wheel?

 

Edit: i used the exact example in the docs for the new wheel but the wheel still resets.

Edit2: Same with default theme.

If all you are looking for is the same type of wheel in the default theme, but you want it vertically straight instead of curved, you can set the CurveAmount to 0, like so:

<coverFlow:FlowControl x:Name="FlowControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CoverFactory="{Binding CoverFactory}" ImageType="Clear Logos" CurveAmount="0" CameraZPosition="3.0" VisibleCount="14" PageSize="6" Spacing="1.0" ItemZPosition="1.0" SelectedItemZPosition="2.0" />

The above was just taken from the default theme's vertical game view.

You only should convert to the new FlowControl if you are requiring a specific feature from it. It provides more flexibility, but there's a much steeper learning curve to use and makes the code more complex.

Link to comment
Share on other sites

6 minutes ago, The Mask said:

the problem is the wheel not ending with directional control when using endless = "false" like it's supposed to. that was the focal point of my initial post.

Also, I'm not new to coding.

I think I see what you want now, which wasn't entirely clear in the first post. If you are wanting the navigation to stop when you get to the beginning or end of a list, this is not currently possible (someone could prove me wrong here). The Endless property will not play a roll in what you want.

Link to comment
Share on other sites

  • 4 weeks later...
  • 6 months later...

FlowImage (Introduced in 11.10) This control allows you to draw an image related to a Game, Platform, Platform Category, or Playlist. It is used as a control inside of a FlowTemplate.

FlowImage has the following properties: CreateFallbackImage (bool) When this property is set to true the control will create a fallback image if the image requested is not found. The default value of this property is true.

 

Can someone post a code snippet example using a flowtemplate/flowimage that only uses Createfallbackimage in it?

Edited by The Mask
Link to comment
Share on other sites

  • 2 months later...
35 minutes ago, Jass_167 said:

Can someone help me edit the code to a theme I’m trying to edit? It is not major edits, basically removing two items and add an image. 

Probably good to tell exactly what you need and provide pics of the view you want edited. Also what theme it is. 

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