cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Aaronk21234
Advocate I
Advocate I

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
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
v-yutliu-msft
Community Support
Community Support

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

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,630)