Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have done it with my logic, definitely its not a perfect answer but it is working. What I have done is 1)Place Popup/Grid control outside the right side of my screen from where I have to open/close popup with animation<img src="https://i.stack.imgur.com/jP5V4.png" alt="enter image description here"></p> <p>So when I want to open my Popup I am adding ThicknessAnimation and my Popup/Grid animate to the portion(2) as shown in image, and while needs to remove Popup/Grid again I am applying ThicknessAnimation so that to move my Popup/Grid to portion (1) as shown Here is my code.</p> <pre><code>//for opening Popup myPopupGrid.Margin = new Thickness(0, 0, -myPopupGrid.Width, 0); ThicknessAnimation thicknessAnimation = new ThicknessAnimation(); thicknessAnimation .From = myPopupGrid.Margin; thicknessAnimation .To = new Thickness(0, 0, 0, 0); thicknessAnimation .Duration = new Duration(TimeSpan.FromSeconds(0.5)); myPopupGrid.BeginAnimation(Grid.MarginProperty, thicknessAnimation ); thicknessAnimation .Completed += delegate { myPopupGrid.Visibility = Visibility.Visible; }; //for closing Popup myPopupGrid.Margin = new Thickness(0, 0, 0, 0); ThicknessAnimation thicknessAnimation = new ThicknessAnimation(); thicknessAnimation .From = myPopupGrid.Margin; thicknessAnimation .To = new Thickness(0, 0, -myPopupGrid.Width, 0); thicknessAnimation .Duration = new Duration(TimeSpan.FromSeconds(0.5)); myPopupGrid.BeginAnimation(Grid.MarginProperty, thicknessAnimation ); thicknessAnimation .Completed += delegate { myPopupGrid.Visibility = Visibility.Hidden; }; //Here point of notice is I am changing Thickness in both cases //From new Thickness(0, 0, -myPopupGrid.Width, 0) //To new Thickness(0, 0, 0, 0); </code></pre> <p>and vice versa, which cause my Popup to reset his position To and from, thats it</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload