faeran Posted February 6, 2023 Share Posted February 6, 2023 If you have built yourself a custom LaunchBox theme and want to include support for the new Platform Icon system that was released with version 13.2, you can do the following. Open your SidebarView.xaml file. Add the following namespaces to the top (along with the rest of them): xmlns:controls="clr-namespace:Unbroken.LaunchBox.Windows.Controls;assembly=Unbroken.LaunchBox.Windows" xmlns:win="clr-namespace:Unbroken.LaunchBox.Windows;assembly=Unbroken.LaunchBox.Windows" Below that, in the UserControl.Resources section, you will need to add the following: <win:BindingProxy x:Key="IconVisibility" Data="{Binding IconVisibility}"/> Further down, inside of your TreeView.ItemTemplate you will need to add the new PlatformIcon control, which is wrapped in a Grid. Here is an example of the entire DockPanel, but note that you will most likely only need to add the Grid portion of it in the same position as shown in this example. <DockPanel LastChildFill="True" HorizontalAlignment="Stretch"> <TextBlock Padding="12,8,12,8" Text="{Binding Count}" TextAlignment="Right" DockPanel.Dock="Right" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.RightCountVisibility}" /> <Grid DockPanel.Dock="Left" Margin="12,0,0,0" Height="24" Width="24" Visibility="{Binding Source={StaticResource IconVisibility}, Path=Data}"> <controls:PlatformIcon PlatformName="{Binding BackendValue}" PlatformType="{Binding FilterType}" /> </Grid> <TextBlock Padding="12,8,12,8" Text="{Binding Value}" TextAlignment="Left" TextTrimming="CharacterEllipsis" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.ValueWithoutCountVisibility}" /> <TextBlock Padding="12,8,12,8" Text="{Binding ValueWithCount}" TextAlignment="Left" TextTrimming="CharacterEllipsis" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.ValueWithCountVisibility}" /> </DockPanel> 2 2 Quote Link to comment Share on other sites More sharing options...
Retrofrogg Posted February 6, 2023 Share Posted February 6, 2023 That seems to work fine, thanks. Quote Link to comment Share on other sites More sharing options...
Suhrvivor Posted February 7, 2023 Share Posted February 7, 2023 (edited) Tried it on the Beats Theme and it works perfectly! Thanks! Edited February 7, 2023 by Suhrvivor Quote Link to comment Share on other sites More sharing options...
bundangdon Posted February 7, 2023 Share Posted February 7, 2023 Working fine here too. Thanks a lot! Quote Link to comment Share on other sites More sharing options...
Gill Figno Posted February 28, 2023 Share Posted February 28, 2023 (edited) Any idea how to make the images in the grid anti-aliased or higher resolution? I'm trying to use higher resolution images, but they don't look very good. Adding "RenderOptions.BitmapScalingMode="HighQuality"" worked for me in beta-1 but it doesn't work in the full release. I noticed this is also a problem with the "Default Plus" theme now as well. Edited February 28, 2023 by Gill Figno Quote Link to comment Share on other sites More sharing options...
faeran Posted February 28, 2023 Author Share Posted February 28, 2023 7 hours ago, Gill Figno said: Any idea how to make the images in the grid anti-aliased or higher resolution? I'm trying to use higher resolution images, but they don't look very good. Adding "RenderOptions.BitmapScalingMode="HighQuality"" worked for me in beta-1 but it doesn't work in the full release. I noticed this is also a problem with the "Default Plus" theme now as well. On the <controls:PlatformIcon> element, add the property ScalingMode I believe you want to use the HighQuality value. So it would be: <controls:PlatformIcon ScalingMode="HighQuality"> Here's a link that explains other options you can play around with: https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.bitmapscalingmode?view=windowsdesktop-7.0 1 Quote Link to comment Share on other sites More sharing options...
C-Beats Posted February 28, 2023 Share Posted February 28, 2023 On 2/6/2023 at 10:45 PM, Suhrvivor said: Tried it on the Beats Theme and it works perfectly! Thanks! Yeah, I'll be updating my themes soon to use the new bindings available in 13.2 Quote Link to comment Share on other sites More sharing options...
Gill Figno Posted February 28, 2023 Share Posted February 28, 2023 6 hours ago, faeran said: On the <controls:PlatformIcon> element, add the property ScalingMode I believe you want to use the HighQuality value. So it would be: <controls:PlatformIcon ScalingMode="HighQuality"> Here's a link that explains other options you can play around with: https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.bitmapscalingmode?view=windowsdesktop-7.0 Yup, that worked. Thanks a lot! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.