Odds and Ends
All the extra things you can do in Big Box Themes
Written By Brian Faeran
Last updated 9 months ago
Center Selected Item in a Text List
As of Big Box 12.14, you can now natively vertically center the selected item inside of both a Filters and Games text list using behaviors. To accomplish this, do the following:
For the filters view, open: TextFiltersView.xaml
For the games view, open: TextListView.xaml
Add the namespace:
xmlns:behaviors="clr-namespace:Unbroken.LaunchBox.Windows.Behaviors;assembly=Unbroken.LaunchBox.Windows"Add the following behavior inside of your ListBox:
<i:Interaction.Behaviors>
<behaviors:CenterSelectionBehavior />
</i:Interaction.Behaviors>Filter ListBox Example:
<ListBox Name="Filters" Style="{DynamicResource ListBoxStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<cal:ActionMessage MethodName="OnEnter" />
</i:EventTrigger>
</i:Interaction.Triggers>
<i:Interaction.Behaviors>
<behaviors:CenterSelectionBehavior />
</i:Interaction.Behaviors>
</ListBox>Game ListBox Example:
<ListBox Name="Items" Style="{DynamicResource ListBoxStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<cal:ActionMessage MethodName="OnEnter" />
</i:EventTrigger>
</i:Interaction.Triggers>
<i:Interaction.Behaviors>
<behaviors:CenterSelectionBehavior />
</i:Interaction.Behaviors>
</ListBox>Platform-Specific Games Views
As of Big Box 9.4-beta-5, platform-specific games views are now available. New folders can be created inside a theme’s Views folder for each type of games view, with XAML files inside that are named to match a particular platform. For example, you could create a new file like this:
LaunchBox\Themes\My Custom Theme\Views\WheelGamesView\Nintendo Entertainment System.xaml
This new XAML file would then be used as the WheelGamesView for the Nintendo Entertainment System platform. If a custom platform file does not exist like the above, then of course Big Box will revert to the default WheelGamesView.xaml file directly in the Views folder.
All games views from the “Root Games Views” section above are supported for this feature, and will simply use different folder names to match the name of the games view.
ScrollableTextBlock
The ScrollableTextBlock control is used for vertical-scrolling text. Big thanks goes out to SilvusValentine who contributed the code for this control. Here is an example of its use:
<Canvas x:Name="NotesCanvas" ClipToBounds="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<controls:ScrollableTextBlock Name="ScrollingNotes" Text="{Binding Path=Notes}" FontFamily="Calibri" Foreground="White" TextWrapping="Wrap" Width="{Binding ElementName=NotesCanvas, Path=ActualWidth}" ScrollBeginDelay="10" ScrollSpeed="3" ScrollAutoReverse="True" ScrollEndDelay="10" ReverseScrollSpeed="0.5" ScrollDirection="Up" />
</Canvas>In order to use the ScrollableTextBlock control, you will need the following line in the opening UserControl tag:
xmlns:controls="clr-namespace:Unbroken.LaunchBox.Windows.Controls;assembly=Unbroken.LaunchBox.Windows"Also note the Canvas that surrounds the ScrollableTextBlock control. This is important with the ClipToBounds property in order to ensure that the text is properly restricted to the bounds of the control.
ScrollBeginDelay
This property specifies the number of seconds that will elapse before the control begins to scroll.
ScrollSpeed
This property specifies the number of seconds that each line of text should take to scroll.
ScrollAutoReverse
This property specifies whether or not the scrolling text should reverse scroll back up to the top.
ScrollEndDelay
This property specifies how many seconds to wait before repeating or scrolling back up to the top.
ReverseScrollSpeed
This property specifies the number of seconds each line of text should take to scroll when scrolling back up to the top.
ScrollDirection
This property specifies the initial direction to scroll. Valid values are “Up” and “Down”.
VideoControl
The VideoControl is used for displaying custom videos for backgrounds, etc. It is recommended to use the typical ImageVideoView bindings for most videos, but if you are adding additional videos to your theme, the VideoControl is a good option. Here is an example of its use:
<videos:VideoControl VideoPath="LAUNCHBOX_THEME_FOLDER/Videos/Background.mp4" StretchVideo="true" CenterVideo="false" />In order to use the VideoControl, you will need the following line in the opening UserControl tag:
xmlns:videos="clr-namespace:Unbroken.LaunchBox.Windows.BigBox.Controls;assembly=BigBox"VideoPath
This property specifies path to the video file to play.
StretchVideo
This property specifies whether or not to ignore the aspect ratio and stretch the video to fill the space of the control.
CenterVideo
This property specifies whether or not to center the video in the control. Unfortunately, however, video placement is currently a bit buggy and you may experience incorrect results.
LAUNCHBOX_THEME_FOLDER
This variable can be used in file paths as a relative path to any of your theme files. The benefit is allowing you to build a theme regardless of what the name of your theme will end up being.
LAUNCHBOX_THEME_FOLDER represents the entire path up to your theme folder. This means that:
LAUNCHBOX_THEME_FOLDER = \\LaunchBox\Themes\YourTheme\
Example pointing to an image inside of your theme’s Images > Theme folder:
<coverFlow:FlowImage ImagePath=”LAUNCHBOX_THEME_FOLDER/Images/Theme/background.jpg” />