C4ustic
Topic Author
Posts: 8
Joined: 03 Sep 2017, 03:02

Keyword: x:Shared="false"

12 Apr 2020, 22:10

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.

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 1920
Joined: 22 Dec 2011, 19:20

Re: Keyword: x:Shared="false"

13 Apr 2020, 20:21

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>
 
C4ustic
Topic Author
Posts: 8
Joined: 03 Sep 2017, 03:02

Re: Keyword: x:Shared="false"

14 Apr 2020, 04:46

Ok, thanks! That should be doable.
 
User avatar
jsantos
Site Admin
Posts: 2907
Joined: 20 Jan 2012, 17:18
Contact:

Re: Keyword: x:Shared="false"

14 Apr 2020, 14:49

Thanks, closing this.

Who is online

Users browsing this forum: No registered users and 1 guest