cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MikeLockwood
Level 8

Component with Timer

I was thinking of building a nice menu component for a canvas app that would animate sliding out from the right of the screen to show text and shrink to just show icons.  I figured the easiest way to do this was to use a timer and adjust the component width based on a variable.  What I found is that from the component width field I can't access the timer control or any other controls for that matter.  I did not read this as being one of the current limitations of components.  Does any have any thoughts on this?

Thanks,
Mike L.
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Component with Timer

@MikeLockwood 

I looked at what you had attached, but it was an empty application...nothing in it.

So, I was thinking through your scenario a little bit more and contrasting to what we do often like this.  It's slightly different as we have more of a side menu that will not cover other items.

So, I put one together to demonstrate more of what you might be looking for.  I didn't really polish it much, so some of this initial states are a little funky (i.e. open and close not really set to a initial states).

But, yes, in your case you want to be able to impact the height and width external to the menu, so you need to have a value exposed as a property and then you can connect to it internally. 

Take a look at the sample app attached.  

In particular, look at the Height and Width properties in the component and see how they are tied back to inner properties that are exposed in the component.  

That might give you more of an idea on how to implement in your component.

 

_____________________________________________________________________________________
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.

View solution in original post

7 REPLIES 7
Super User
Super User

Re: Component with Timer

@MikeLockwood 

You might want to re-think your process a little bit.  

Yes, you will not be able to reference any control in your component from outside of the component.  You would need to expose those as properties on your component.  

But, you might just try to do your slide animation from within the component itself - in other words, consider the component width and height to be fixed and the maximum that you would want for it, and then in the component itself resize, reshape, move, etc the individual controls in it based on your timer in the component.

 

I hope this is helpful for you and gives you some ideas.

_____________________________________________________________________________________
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.
Highlighted
MikeLockwood
Level 8

Re: Component with Timer

@RandyHayes ,

 

The timer control is in the component itself and would be triggered by a button click.  The goal was to build a flyout style menu.  Slim to the right side, 50, showing just icons.  When the hamburger menu is clicked at the top then the menu extends to 250.  Then I can add this to my screens and it handles the sizing on its own, I dont have to do this per page.  Right now I can do the sizing easily, on a button click I set a variable to say if the component is expanded.  In the Components width property I use the formula "If(Component.Expanded = true, 250,50).  This works fine but I wanted to add a bit of elegance to it and use a time and animate it expanding and contracting.

Thanks,
Mike L.
Super User
Super User

Re: Component with Timer

@MikeLockwood 

Yes, I understand completely as we do this often as well.

What I am suggesting is, instead of dealing with the Width property of the component (which is really meant to be an external property, and I've seen get a little messy when you try to resize it internally) instead, put the components of your menu inside of the overall Component and consider it a container.  Then, instead of resizing the Component, resize the internal menu within the component.  Chances are you have this as a rectangle shape...it is that shape that I would apply the automation to, not to the external aspect of the component.

 

I find this process works much better than trying to do it with the width properties of the component.  Just consider the component a visual container, and within it, apply your animated moves and resizings.

 

There are some gotchas to this based on how you are initiating the component to "open".  If you are basing it on an independent (external) button/icon/etc then you should be fine.  If you expect the "trigger" of your component to "open and close" to be built into the component, then when you place the component on the screen, you will want it to be minimum size so that it does not impact other controls in your layer order.

_____________________________________________________________________________________
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.
MikeLockwood
Level 8

Re: Component with Timer

@RandyHayes ,

 

Not sure I follow your logic 100% so I put together a quick demo.  The first screen has the expand happening to the component itself where the second screen has a menu to the expand state and moving of a rectangle with in it.  The problem for me with the second one is that it covers controls on the screen.  Again this is my implementation of what I understand from your post.  Please correct me if i am wrong here.

Thanks,
Mike L.
Super User
Super User

Re: Component with Timer

@MikeLockwood 

I looked at what you had attached, but it was an empty application...nothing in it.

So, I was thinking through your scenario a little bit more and contrasting to what we do often like this.  It's slightly different as we have more of a side menu that will not cover other items.

So, I put one together to demonstrate more of what you might be looking for.  I didn't really polish it much, so some of this initial states are a little funky (i.e. open and close not really set to a initial states).

But, yes, in your case you want to be able to impact the height and width external to the menu, so you need to have a value exposed as a property and then you can connect to it internally. 

Take a look at the sample app attached.  

In particular, look at the Height and Width properties in the component and see how they are tied back to inner properties that are exposed in the component.  

That might give you more of an idea on how to implement in your component.

 

_____________________________________________________________________________________
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.

View solution in original post

Community Support Team
Community Support Team

Re: Component with Timer

Hi @MikeLockwood ,

Do you want to create a Expand/collapse animation component control within your PowerApps app?

 

If you want to create a Expand/collapse animation component control within your PowerApps app, I think the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/ux-patterns-expander-control-with-expand-collapse-animati...

 

Please consider configure your Component based on above blog, then check if the issue is solved. Also please check if the response within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Stutting-in-Animations/td-p/330421

 

In addition, there are some known limits with Component control, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-component#known-limitations

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MikeLockwood
Level 8

Re: Component with Timer

@RandyHayes 

 

With using what you provided as a basis and some additional tweaks I got what I watned working.  Once I get the rest of it in place I will try and remember to post a copy here.

 

Thanks for the help.

Thanks,
Mike L.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,711)