Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Forms;
- using System.Windows.Media.Animation;
- using System.Windows.Threading;
- namespace Robolahing
- {
- /// <summary>
- /// Interaction logic for DisplayWindow.xaml
- /// </summary>
- public partial class DisplayWindow : Window
- {
- public DisplayWindow()
- {
- InitializeComponent();
- }
- private void Window_Loaded(object sender, RoutedEventArgs e)
- {
- Screen s = Screen.AllScreens[1];
- System.Drawing.Rectangle r = s.WorkingArea;
- this.Top = r.Top;
- this.Left = r.Left + (r.Width / 2);
- this.WindowState = WindowState.Maximized;
- CoverLeft.Height = GraphicsCanvas.ActualHeight;
- Canvas.SetLeft(CoverRight,GraphicsCanvas.ActualWidth/2);
- CoverRight.Height = GraphicsCanvas.ActualHeight;
- }
- private void Window_Closed(object sender, System.EventArgs e)
- {
- if (App.Current.MainWindow != null)
- {
- App.Current.MainWindow.Close();
- }
- }
- public void animateCover()
- {
- DoubleAnimation myDoubleAnimation = new DoubleAnimation();
- myDoubleAnimation.From = 0;
- myDoubleAnimation.To = 2*GraphicsCanvas.ActualHeight;
- myDoubleAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(3000));
- Storyboard.SetTargetName(myDoubleAnimation, CoverRight.Name);
- Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(WHAT_ON_EARTH?));
- // Create a storyboard to contain the animation.
- Storyboard myWidthAnimatedButtonStoryboard = new Storyboard();
- myWidthAnimatedButtonStoryboard.Begin(CoverRight);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement