Page 1 of 1

Keyword: x:Shared="false"

Posted: 12 Apr 2020, 22:10
by C4ustic
Hi,
I have a resource:
<Image x:Key="Icon_TrashCan" x:Shared="false" Source="/Assets/UI/Icons/Icon_TrashCan.png"/>
That I use in a DataTemplate in a ListView. In windows wpf I use the x:Shared="false" keyword in order to get the icon on every row on the list. NoesisGUI don't seem to support that keyword so how am I supposed to use it? As it is the icon is only shown on one of the rows in the ListView the other rows still has the button but it is just blank with no icon on it.

Re: Keyword: x:Shared="false"

Posted: 13 Apr 2020, 20:21
by sfernandez
Sorry to say we don't implement x:Shared yet. But you don't need it if you use an ImageSource as resource instead:
<Grid.Resources>
  <ImageSource x:Key="Icon_TrashCan">/Assets/UI/Icons/Icon_TrashCan.png</ImageSource>
  <DataTemplate x:Key="MyTemplate">
    <Image Source="{StaticResource Icon_TrashCan}"/>
  </DataTemplate>
</Grid.Resources>

Re: Keyword: x:Shared="false"

Posted: 14 Apr 2020, 04:46
by C4ustic
Ok, thanks! That should be doable.

Re: Keyword: x:Shared="false"

Posted: 14 Apr 2020, 14:49
by jsantos
Thanks, closing this.