It seems x:Array isn't implemented (Unknown type 'Array')?
Posted: 08 Feb 2021, 05:16
Hi there. After several weeks of learning WPF from scratch I'm finally starting to integrate noesisgui to my game(c++/smfl/opengl), and it seems to be working perfectly now.
Now I run into a little "problem", the "play" and "pause" button in the screenshot are actually RadioButtons, and the code below is how I've done it in WPF.
But since x:Array is not implemented in NoesisGUI yet, I just hard coded them(since there are only 2 buttons), but I'm wondering is there a better way to do this? Thanks a lot!
Now I run into a little "problem", the "play" and "pause" button in the screenshot are actually RadioButtons, and the code below is how I've done it in WPF.
Code: Select all
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="img" Property="Source" Value="{Binding Tag[1], RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="img" Property="Source" Value="{Binding Tag[2], RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
</ControlTemplate.Triggers>
<RadioButton.Tag>
<x:Array Type="ImageSource">
<BitmapImage UriSource="../Images/btnSmallPlay0001.png" />
<BitmapImage UriSource="../Images/btnSmallPlay0002.png" />
<BitmapImage UriSource="../Images/btnSmallPlay0003.png" />
</x:Array>
</RadioButton.Tag>