WPF – moving with animated elements outside animation elements

So what I want to do is: move a button with storyboard animation from inside Uniformgrid to a list box brother. As you can see from the image below, The button does move towards the Listbox (green rectangle), but once it exceeds the limits of the ItemControls, it disappears. I try to follow the mvvm mode as much as possible (I use the Mvvm light toolkit). So I try to keep most of the UI in XAML .

So what I want to know is, what is the best solution to this?

> I am trying to make itemscontrol completely overlap the list box and reduce the size of the uniformgrid. This is useful, but I have some buttons next to the Listbox that stop working because they are under the itemscontrol. So the buttons don’t mind Going out of the UniformGrids boundary for some reason.
>The best solution is to create a copy of the button and then move it? What should I do?

The XAML file. I simplified it. (Sorry, it’s quite large)



Width="{Binding ElementName=Canvas, Path=ActualWidth} ">
































< br />
VerticalScrollBarVisibility= "Disabled" HorizontalScrollBarVisibility="Hidden" >










Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ScrollViewer}}" >












< /DataTemplate>








I would appreciate any help 🙂 Thanks.

Would the best solution be to create a copy of the button, then move it?

No, don’t reposition the button , Move it by adjusting the margin until it appears above the target position.

Replacement suggestion

Start the button at the hidden target position, then move it to the grid, and then Make it visible?

So what I want to do is: move a button with storyboard animation from inside Uniformgrid to a list box brother. As you can see from the image below The button does move towards the Listbox (the green rectangle), but once it exceeds the limits of the ItemControls, it disappears. I try to follow the mvvm mode as much as possible (I use the Mvvm light toolkit). So I try in XAML Keep most of the UI.

So what I want to know is, what is the best solution to this?

> I am trying to make itemscontrol completely overlap the list box and reduce the size of the uniformgrid. This is useful, but I have some buttons next to the Listbox that stop working because they are under the itemscontrol. So the buttons don’t mind Going out of the UniformGrids boundary for some reason.
>The best solution is to create a copy of the button and then move it? What should I do?

The XAML file. I simplified it. (Sorry, it’s quite large)



Width="{Binding ElementName=Canvas, Path=ActualWidth} ">


































VerticalScrollBarVisibility="Disabled "HorizontalScrollBarVisibility="Hidden" >










Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ScrollViewer}}" >












< /DataTemplate>








I would appreciate any help :)Thank you.

Would the best solution be to create a copy of the button, then move it?

No, do not reposition the button, move it by adjusting the margin until it appears in Above the target position.

Replacement suggestion

Activate the button at the hidden target position, then move it to the grid, and then make it visible?

Leave a Comment

Your email address will not be published.