//在主页点按钮时调用,使用动画切换场景 void MainPageUpdate1() { timer.Stop(); lunbo.Children.Clear(); ThicknessAnimation anim = new ThicknessAnimation(); anim.From = new Thickness(462, 255, 1058, 0); anim.To = new Thickness(10, 465, 1710, 0); anim.Duration = TimeSpan.FromSeconds(0.36); paizhao.BeginAnimation(MarginProperty, anim); ThicknessAnimation anim2 = new ThicknessAnimation(); anim2.From = new Thickness(1062, 250, 458, 430); anim2.To = new Thickness(1710, 460, 10, 420); anim2.Duration = TimeSpan.FromSeconds(0.36); shangchuan.BeginAnimation(MarginProperty, anim2); ThicknessAnimation anim3 = new ThicknessAnimation(); anim3.From = new Thickness(0, 790, 0, 0); anim3.To = new Thickness(0, 1086, 0, -296); anim3.Duration = TimeSpan.FromSeconds(0.36); show_bar.BeginAnimation(MarginProperty, anim3); ThicknessAnimation anim4 = new ThicknessAnimation(); anim4.From = new Thickness(462, 0, 0, 0); anim4.To = new Thickness(462, -252, 0, 0); anim4.Duration = TimeSpan.FromSeconds(0.36); FU_NAME.BeginAnimation(MarginProperty, anim4); DoubleAnimation daV = new DoubleAnimation(400, 200, new Duration(TimeSpan.FromSeconds(0.36))); paizhao.BeginAnimation(WidthProperty, daV); DoubleAnimation daV2 = new DoubleAnimation(400, 200, new Duration(TimeSpan.FromSeconds(0.36))); paizhao.BeginAnimation(HeightProperty, daV2); DoubleAnimation daV3 = new DoubleAnimation(400, 200, new Duration(TimeSpan.FromSeconds(0.36))); shangchuan.BeginAnimation(WidthProperty, daV3); DoubleAnimation daV4 = new DoubleAnimation(400, 200, new Duration(TimeSpan.FromSeconds(0.36))); shangchuan.BeginAnimation(HeightProperty, daV4); DoubleAnimation daV5 = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(0.7))); paizhaokuang.BeginAnimation(OpacityProperty, daV5); }
//返回上一级使用 void MainPageUpdate2() { //重拍按钮在界面中时说明在拍照界面 if (iscongpaiin) { ThicknessAnimation anim5 = new ThicknessAnimation(); anim5.From = new Thickness(1710, 665, 0, 225); anim5.To = new Thickness(1920, 670, -200, 210); anim5.Duration = TimeSpan.FromSeconds(0.36); chongpai.BeginAnimation(MarginProperty, anim5); iscongpaiin = false; } if (issliderbarin) { DoubleAnimation daV = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.25))); slider.BeginAnimation(OpacityProperty, daV); issliderbarin = false; } //拍好照了,说明在处理界面,同时 切换到打印的确认界面也用这个 if (istakeaphoto) { ThicknessAnimation anim6 = new ThicknessAnimation(); anim6.From = new Thickness(0, 0, 1720, 0); anim6.To = new Thickness(10, 465, 1710, 0); anim6.Duration = TimeSpan.FromSeconds(0.36); paizhao.BeginAnimation(MarginProperty, anim6); ThicknessAnimation anim7 = new ThicknessAnimation(); anim7.From = new Thickness(1216, 854, 504, 26); anim7.To = new Thickness(1710, 460, 10, 420); anim7.Duration = TimeSpan.FromSeconds(0.36); shangchuan.BeginAnimation(MarginProperty, anim7); ThicknessAnimation anim8 = new ThicknessAnimation(); anim8.From = new Thickness(1920, 665, -200, 225); anim8.To = new Thickness(1710, 665, 10, 225); anim8.Duration = TimeSpan.FromSeconds(0.36); chongpai.BeginAnimation(MarginProperty, anim8); ThicknessAnimation anim9 = new ThicknessAnimation(); anim9.From = new Thickness(806, 62, 0, 0); anim9.To = new Thickness(350, 80, 0, 0); anim9.Duration = TimeSpan.FromSeconds(0.36); paizhaokuang.BeginAnimation(MarginProperty, anim9); DoubleAnimation daV6 = new DoubleAnimation(1020, 1220, new Duration(TimeSpan.FromSeconds(0.36))); paizhaokuang.BeginAnimation(WidthProperty, daV6); DoubleAnimation daV7 = new DoubleAnimation(770, 920, new Duration(TimeSpan.FromSeconds(0.36))); paizhaokuang.BeginAnimation(HeightProperty, daV7); DoubleAnimation daV8 = new DoubleAnimation(1000, 1200, new Duration(TimeSpan.FromSeconds(0.36))); image.BeginAnimation(WidthProperty, daV8); DoubleAnimation daV9 = new DoubleAnimation(750, 900, new Duration(TimeSpan.FromSeconds(0.36))); image.BeginAnimation(HeightProperty, daV9); ThicknessAnimation anim5 = new ThicknessAnimation(); anim5.From = new Thickness(266, 0, 0, 0); anim5.To = new Thickness(266, -1080, 0, 0); anim5.Duration = TimeSpan.FromSeconds(0.36); choose.BeginAnimation(MarginProperty, anim5); ThicknessAnimation anim4 = new ThicknessAnimation(); anim4.From = new Thickness(1470, 854, 250, 26); anim4.To = new Thickness(1470, 1080, 250, -200); anim4.Duration = TimeSpan.FromSeconds(0.36); chexiao.BeginAnimation(MarginProperty, anim4); } //其他情况 在拍照界面 else { ThicknessAnimation anim = new ThicknessAnimation(); anim.From = new Thickness(10, 465, 1710, 0); anim.To = new Thickness(462, 255, 1058, 0); anim.Duration = TimeSpan.FromSeconds(0.36); paizhao.BeginAnimation(MarginProperty, anim); ThicknessAnimation anim2 = new ThicknessAnimation(); anim2.From = new Thickness(1710, 460, 10, 420); anim2.To = new Thickness(1062, 250, 458, 430); anim2.Duration = TimeSpan.FromSeconds(0.36); shangchuan.BeginAnimation(MarginProperty, anim2); ThicknessAnimation anim3 = new ThicknessAnimation(); anim3.From = new Thickness(0, 1086, 0, -296); anim3.To = new Thickness(0, 790, 0, 0); anim3.Duration = TimeSpan.FromSeconds(0.36); show_bar.BeginAnimation(MarginProperty, anim3); ThicknessAnimation anim4 = new ThicknessAnimation(); anim4.From = new Thickness(462, -252, 0, 0); anim4.To = new Thickness(462, 0, 0, 0); anim4.Duration = TimeSpan.FromSeconds(0.36); FU_NAME.BeginAnimation(MarginProperty, anim4); DoubleAnimation daV = new DoubleAnimation(200, 400, new Duration(TimeSpan.FromSeconds(0.36))); paizhao.BeginAnimation(WidthProperty, daV); DoubleAnimation daV2 = new DoubleAnimation(200, 400, new Duration(TimeSpan.FromSeconds(0.36))); paizhao.BeginAnimation(HeightProperty, daV2); DoubleAnimation daV3 = new DoubleAnimation(200, 400, new Duration(TimeSpan.FromSeconds(0.36))); shangchuan.BeginAnimation(WidthProperty, daV3); DoubleAnimation daV4 = new DoubleAnimation(200, 400, new Duration(TimeSpan.FromSeconds(0.36))); shangchuan.BeginAnimation(HeightProperty, daV4); DoubleAnimation daV5 = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.7))); paizhaokuang.BeginAnimation(OpacityProperty, daV5); } }