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.
Community Support Team
Community Support Team

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

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
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 381 members 4,911 guests
Please welcome our newest community members: