Skip to content

Steam Screenshots

Brandon edited this page May 31, 2024 · 1 revision

Integration of custom controls in custom themes

Visibility of elements according to extension installation status

Example:

[...]
<Grid Visibility="{PluginStatus Plugin=SteamScreenshots_8e77fe31-5e62-41e2-8fa2-64844cfd5b6b, Status=Installed}">
[...]

It can also be used to return a bool value if used in another property.

Steam Screenshots Control

<ContentControl x:Name="SteamScreenshotsViewControl_8e77fe31-5e62-41e2-8fa2-64844cfd5b6b" />

Extension data specific of the selected game

The source name of the plugin is SteamScreenshots

Setting Type Default Description
IsControlVisible bool false Indicates if the SteamScreenshots control is visible

Binding example:

[...]
<StackPanel>
    <StackPanel.Style>
        <Style TargetType="StackPanel">
            <Setter Property="Visibility" Value="Collapsed" />
            <Style.Triggers>
                <DataTrigger Binding="{PluginSettings Plugin=SteamScreenshots, Path=IsControlVisible, FallbackValue=False}" Value="True">
                    <Setter Property="Visibility" Value="Visible" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </StackPanel.Style>
[...]

Custom styling support

The BitmapImages are exposed by binding to the control Content.ScreenshotsBitmapImages property. Example given:

<ItemsControl ItemsSource="{Binding ElementName=SteamScreenshots_SteamScreenshotsViewControl, Path=Content.ScreenshotsBitmapImages, FallbackValue={x:Null}}">
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <Image Source="{Binding}" RenderOptions.BitmapScalingMode="Fant" Height="100" Margin="5"/>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <WrapPanel />
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
</ItemsControl>