Only a single instance of a CroppedBitmap visible in an ItemsControl
Posted: 04 Dec 2023, 17:42
We have an issue which we think is similar to this one:
viewtopic.php?t=1951
In our case the image is a CroppedBitmap from an atlas
and we have a custom ContentControl with a style:
Only one instance of an image ever gets displayed in the ItemsControl
Is there a workaround for this use case?
viewtopic.php?t=1951
In our case the image is a CroppedBitmap from an atlas
Code: Select all
<CroppedBitmap x:Key="T_HUD_icon_button_KBD_mouse" Source="{StaticResource T_HUD_atlas_main}" SourceRect="573,977,64,64"/>Code: Select all
<Style x:Key="InputActionControl-Style" TargetType="{x:Type ctrl:InputActionControl}" BasedOn="{StaticResource BaseUnfocusable-Style}">
<Setter Property="Template" Value="{StaticResource InputActionControl-Template}"/>
<Setter Property="Content" Value="{x:Null}"/>
<Style.Triggers>
<Trigger Property="InputAssetPath" Value="Keyboard_Mouse2D">
<Setter Property="Tag" Value="True"/>
<Setter Property="Content">
<Setter.Value>
<Rectangle HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Width="32">
<Rectangle.Fill>
<ImageBrush ImageSource="{StaticResource T_HUD_icon_button_KBD_mouse}"/>
</Rectangle.Fill>
</Rectangle>
</Setter.Value>
</Setter>
</Trigger>
...
...
</Style.Triggers>
</Style>Is there a workaround for this use case?