/// <summary> /// Скрыть или отобразить окно с меню /// </summary> /// <param name="sender">Button</param> /// <param name="e">Click</param> private void ShowOrHidePanel(object sender, RoutedEventArgs e) { Button but = (sender as Button); RotateTransform rotate = new RotateTransform(); if (panelMoveProg.IsEnabled) { panelMoveProg.IsEnabled = false; EventHandler @event = (s, es) => { panelMoveProg.IsEnabled = true; }; if (panelMoveProg.Height != 10) { rotate.BeginAnimation(RotateTransform.AngleProperty, StyleUIE.DoubleAnimation(180, TimeSpan.FromSeconds(0.55), 360)); panelMoveProg.BeginAnimation(HeightProperty, StyleUIE.DoubleAnimation(180, TimeSpan.FromSeconds(0.55), 10, @event)); } else { rotate.BeginAnimation(RotateTransform.AngleProperty, StyleUIE.DoubleAnimation(0, TimeSpan.FromSeconds(0.5), 180)); panelMoveProg.BeginAnimation(HeightProperty, StyleUIE.DoubleAnimation(10, TimeSpan.FromSeconds(0.5), 180, @event)); } but.RenderTransform = rotate; } else { panelMoveProg.IsEnabled = true; rotate.BeginAnimation(RotateTransform.AngleProperty, null); panelMoveProg.BeginAnimation(HeightProperty, null); } }
/// <summary> /// Отображение панели с кодом потверждения /// </summary> /// <param name="isVisibility">Состояние отображения</param> public void ShowPanelCode(bool isVisibility) { thisWindow.Dispatcher.BeginInvoke(new ThreadStart(() => { if (isVisibility) { panelCode.Visibility = Visibility.Visible; butOk.Visibility = Visibility.Hidden; errorLb.Visibility = Visibility.Hidden; textMsg.Text = textMsg.Text.Replace("###", emailTB.Text.Trim()); SetTimer(); this.BeginAnimation(HeightProperty, StyleUIE.DoubleAnimation(this.ActualHeight, TimeSpan.FromMilliseconds(450), 450)); OperationServer.SendMsgClient(128, 102, mailU); } else { double opacity = 0; DispatcherTimer timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(30) }; errorLb.Visibility = Visibility.Visible; butOk.IsEnabled = false; timer.Tick += (s, e) => { errorLb.Opacity = opacity += 0.05; if (opacity >= 1) { butOk.IsEnabled = true; timer.Stop(); } }; timer.Start(); } })); }