cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

@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.
Check out my PowerApps Videos too!

View solution in original post

2 REPLIES 2
Super User III
Super User III

@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.
Check out my PowerApps Videos too!

View solution in original post

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,587)