Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>totally <strong>TranslateTransform</strong> isnt good for that you want .better to use thinkness animation</p> <p>i advise you dont use canavas and change it to grid but if you use canavas use this code</p> <pre><code> private void Animationsss(Grid grd) { //create an animation DoubleAnimation da = new DoubleAnimation(); //set from animation to start position //dont forget set canvas.left for grid if u dont u will get error da.From = Canvas.GetLeft(grd); //set second position of grid da.To = -100; //set duration da.Duration = new Duration(TimeSpan.FromSeconds(2)); //run animation if u want stop ,start etc use story board grd.BeginAnimation(Canvas.LeftProperty, da); } </code></pre> <p>if you use grid code is this :</p> <pre><code> private void Animation(Grid grd) { ThicknessAnimation ta = new ThicknessAnimation(); //your first place ta.From = grd.Margin; //this move your grid 1000 over from left side //you can use -1000 to move to left side ta.To = new Thickness(1000, 0, 0, 0); //time the animation playes ta.Duration = new Duration(TimeSpan.FromSeconds(10)); //dont need to use story board but if you want pause,stop etc use story board grd.BeginAnimation(Grid.MarginProperty, ta); } </code></pre> <p>you can use opacity animation for fade your grid ... it show good if move and fade !</p> <pre><code> private void Animationsss(Grid grd) { DoubleAnimation da = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(2))); grd.BeginAnimation(Grid.OpacityProperty, da); } </code></pre> <p>if there isnt any reason u can change canavas to grid and also better use <strong>TranslateTransform</strong> for resize controls like code below this code resize control if mouse enter in it :</p> <pre><code>private void grid1_MouseEnter(object sender, MouseEventArgs e) { //at first its normal size ScaleTransform st = new ScaleTransform(1, 1); //animation size to 1.25 persent of real size DoubleAnimation da = new DoubleAnimation(1,1.25, new Duration(TimeSpan.FromSeconds(2))); //set transform to control grid1.RenderTransform = st; //animation transform now From Y And X st.BeginAnimation(ScaleTransform.ScaleXProperty, da); st.BeginAnimation(ScaleTransform.ScaleYProperty, da); } </code></pre> <p>if you animation for width or height do same work like scale transform :)</p> <p>hope i can help you ...:))</p> <p>leave comment for me please</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