darklinkpower / PlayniteExtensionsCollection

Collection of extensions made for Playnite.
MIT License
330 stars 29 forks source link

[Steam Screenshots] Fullscreen Theme ListView support #544

Closed saVantCZ closed 5 months ago

saVantCZ commented 5 months ago

Extension name

Steam Screenshots

Feature Description

Is it possible to expose plugin for fullscreen theme without using contentcontrol? What i am asking is to use ListView ItemsSource="{PluginSettings Plugin=SteamScreenshots, Path=Screenshots}" with screenshot collection list and ItemContainerStyle something like Image Source="{Binding Image}"

Just like how Screenshot Visualzer plugin works. Thanks

Screenshots

No response

darklinkpower commented 5 months ago

Support added by binding to the control Context.ScreenshotsBitmapImages property, let me know if works fine for you: https://github.com/darklinkpower/PlayniteExtensionsCollection/wiki/Steam-Screenshots#custom-styling-support

saVantCZ commented 5 months ago

I am sorry, i could not get it work

System.Windows.Data Error: 40 : BindingExpression path error: 'ScreenshotsBitmapImages' property not found on 'object' ''SteamScreenshotsControl' (Name='')'. BindingExpression:Path=Content.ScreenshotsBitmapImages; DataItem='ContentControl' (Name='SteamScreenshots_SteamScreenshotsViewControl'); target element is 'ListView' (Name='ScreenshotsList'); target property is 'ItemsSource' (type 'IEnumerable')

<ContentControl x:Name="SteamScreenshots_SteamScreenshotsViewControl" Visibility="Hidden" />

<ListView x:Name="ScreenshotsList" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Tag="{DynamicResource MediaScreenshots}" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" BorderBrush="Transparent" BorderThickness="0" Background="Transparent" FocusVisualStyle="{x:Null}" Focusable="False" AlternationCount="10" KeyboardNavigation.DirectionalNavigation="Once" ItemsSource="{Binding ElementName=SteamScreenshots_SteamScreenshotsViewControl, Path=Content.ScreenshotsBitmapImages}">

darklinkpower commented 5 months ago

Do you have the full source code available? At least from that snippet it looks correct. I also just tried this and it works fine:

<ListView x:Name="ScreenshotsList"  ScrollViewer.HorizontalScrollBarVisibility="Disabled" Tag="{DynamicResource MediaScreenshots}"
            VirtualizingPanel.IsVirtualizing="True"
            VirtualizingPanel.VirtualizationMode="Recycling"
            BorderBrush="Transparent" BorderThickness="0" Background="Transparent"
            FocusVisualStyle="{x:Null}" Focusable="False" AlternationCount="10" KeyboardNavigation.DirectionalNavigation="Once" ItemsSource="{Binding ElementName=SteamScreenshots_SteamScreenshotsViewControl, Path=Content.ScreenshotsBitmapImages}">
    <ListView.View>
        <GridView>
            <GridViewColumn Header="Image">
                <GridViewColumn.CellTemplate>
                    <DataTemplate>
                        <Image Source="{Binding}" RenderOptions.BitmapScalingMode="Fant" Height="100" Margin="5"/>
                    </DataTemplate>
                </GridViewColumn.CellTemplate>
            </GridViewColumn>
        </GridView>
    </ListView.View>
</ListView>

Above is this code, below is the one available in the wiki:

image

Are you sure you have updated to the latest version with this implemented?


As a tip, you can format and display the code here by adding 3 backtick ( ` ) characters, followed by the language, then ending the code block again with 3 backticks and it will display like above:

image

image

saVantCZ commented 5 months ago

Yes it is working now, but i have small problem with Alternation Count, sometimes it shows indeed 3 items and sometimes it loads all of them and ignore visibility based on alternation

saVantCZ commented 5 months ago

Oh my bad, i forgot to set Alternation Count higher instead of 10. Thank you for your help and amazing job on playnite plugins!