cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Aaronk21234
Level: Powered On

Can't reference Gallery.TemplateFill for Fill value of an icon

Don't know if this is a user error or missing functionality.  I have a gallary's Templatefill set as...

 

Gallery1.TemplateFill = If(ThisItem.IsSelected, ColorFade(PrimaryColor.Fill, .6))

 

...which works just fine.  The selected item is highlighted with the appropriate color and fade.  I'm trying to set the fill color of a rectangle to match the selected fill of the gallery (so that I can change all background colors by altering PrimaryColor.Fill), but I'm unable to use...

 

Rectangle1.Fill = Gallery1.TemplateFill

 

...as .TemplateFill is not recognized.  Sure, I have solved this with Rectangle1.Fill = ColorFade(PrimaryColor.Fill, .6), but I'm just wondering if I am doing something wrong in attempting to reference Gallery1.TemplateFill?  Other .Template properties can be referenced.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Can't reference Gallery.TemplateFill for Fill value of an icon

@Aaronk21234 

What you're seeing is true, the TemplateFill property is not exposed to be used like that.

 

An option you can consider is to set a variable -  Set(fillValue, ColorFade(PrimaryColor.Fill, .6)) and then use that variable in your TemplateFill and also in your Rectangle fill.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
2 REPLIES 2
Super User
Super User

Re: Can't reference Gallery.TemplateFill for Fill value of an icon

@Aaronk21234 

What you're seeing is true, the TemplateFill property is not exposed to be used like that.

 

An option you can consider is to set a variable -  Set(fillValue, ColorFade(PrimaryColor.Fill, .6)) and then use that variable in your TemplateFill and also in your Rectangle fill.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
v-yutliu-msft
Level 10

Re: Can't reference Gallery.TemplateFill for Fill value of an icon

Hi @Aaronk21234 ,

The TemplateFill property is used to set the gallery's background. I'm afraid you can't use it directly to set icon's color.

The first way is to use variable, like the way he described @RandyHayes .

The second way, I suggest you also set the icon's fill:

If(ThisItem.IsSelected, ColorFade(PrimaryColor.Fill, .6))

Then the icon's color will change with the selection of gallery item together.

 

 

Best regards,

Community Support Team _ Phoebe Liu