private void InitializeComponent() { AvaloniaXamlLoader.Load(this); this.KeyDown += MainWindow_KeyDown; this.Closed += MainWindow_Closed; // setup transitions and animations DoubleTransition windowTransition = new DoubleTransition(); windowTransition.Duration = TimeSpan.FromMilliseconds(1000); windowTransition.Property = Window.OpacityProperty; fadeTransition = new DoubleTransition(); fadeTransition.Easing = new QuadraticEaseIn(); fadeTransition.Duration = TimeSpan.FromMilliseconds(AppSettings.Default.FadeTransitionTime); fadeTransition.Property = Image.OpacityProperty; mainWindow = this.FindControl <Window>("mainWindow"); mainWindow.Transitions = new Transitions(); mainWindow.Transitions.Add(windowTransition); mainWindow.SystemDecorations = SystemDecorations.None; mainWindow.WindowState = WindowState.Maximized; mainWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; mainPanel = this.FindControl <Panel>("mainPanel"); tb = this.FindControl <TextBlock>("tb"); tb.Foreground = Brushes.AliceBlue; tb.Text = "Loaded"; tb.FontFamily = new FontFamily("Terminal"); tb.FontWeight = FontWeight.Bold; tb.FontSize = AppSettings.Default.InfoBarFontSize; tb.Transitions = new Transitions(); tb.Transitions.Add(fadeTransition); image1 = this.FindControl <Image>("Front"); image2 = this.FindControl <Image>("Back"); DoubleTransition transition2 = new DoubleTransition(); transition2.Easing = new QuadraticEaseIn(); transition2.Duration = TimeSpan.FromMilliseconds(1600); transition2.Property = Image.OpacityProperty; image1.Transitions = new Transitions(); image1.Transitions.Add(fadeTransition); image2.Transitions = new Transitions(); image2.Transitions.Add(transition2); slideTimer.Elapsed += Timer_Tick; clock.Elapsed += Clock_Elapsed; RefreshSettings(); GetFiles(); slideTimer.Start(); clock.Start(); RaspberryPiPrep(); }
public TransitionBenchmark() { _transition = new DoubleTransition { Duration = TimeSpan.FromMilliseconds(FrameCount), Property = Layoutable.WidthProperty }; _timeProducer = new Subject <double>(); _producedValues = new List <double>(FrameCount); _observer = new AddValueObserver(_producedValues); }
public AnimatableAngleTransform(double angle) { this.MatrixTransform = new MatrixTransform(); this.Angle = angle; if (!ColorPicker.TransitionsDisabled) { this.Transitions = new Transitions(); Transition = new DoubleTransition() { Property = AngleProperty, Duration = new TimeSpan(0, 0, 0, 0, 100) }; this.Transitions.Add(Transition); } }
private void InitializeComponent() { CommandProcessor.GetMainWindowHandle(this); SyncedFrame.SyncEngine.Initialize(); // initialize the list of frames for syncing. AvaloniaXamlLoader.Load(this); this.KeyDown += MainWindow_KeyDown; this.Closed += MainWindow_Closed; // setup transitions and animations DoubleTransition windowTransition = new DoubleTransition(); windowTransition.Duration = TimeSpan.FromMilliseconds(2000); windowTransition.Property = Window.OpacityProperty; DoubleTransition panelTransition = new DoubleTransition(); panelTransition.Duration = TimeSpan.FromMilliseconds(1200); panelTransition.Property = Panel.OpacityProperty; fadeTransition = new DoubleTransition(); fadeTransition.Easing = new QuadraticEaseIn(); fadeTransition.Duration = TimeSpan.FromMilliseconds(AppSettings.Default.FadeTransitionTime); fadeTransition.Property = Image.OpacityProperty; mainWindow = this.FindControl <Window>("mainWindow"); mainWindow.Transitions = new Transitions(); mainWindow.Transitions.Add(windowTransition); mainWindow.SystemDecorations = SystemDecorations.None; mainWindow.WindowState = WindowState.FullScreen; mainWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; mainPanel = this.FindControl <Panel>("mainPanel"); mainPanel.Transitions = new Transitions(); mainPanel.Transitions.Add(panelTransition); if (AppSettings.Default.Rotation != 0) { RotateMainPanel(); } tb = this.FindControl <TextBlock>("tb"); tb.Foreground = Brushes.AliceBlue; tb.Text = "Loading images..."; tb.FontFamily = new FontFamily("Terminal"); tb.FontWeight = FontWeight.Bold; tb.FontSize = AppSettings.Default.InfoBarFontSize; tb.Transitions = new Transitions(); tb.Transitions.Add(fadeTransition); tb.Padding = new Thickness(30); frontImage = this.FindControl <Image>("Front"); backImage = this.FindControl <Image>("Back"); string intro; if ((AppSettings.Default.Rotation == 0) || AppSettings.Default.Rotation == 180) { intro = Environment.CurrentDirectory + "/images/background.jpg"; } else { intro = Environment.CurrentDirectory + "/images/vertbackground.jpg"; } bitmapNew = new Bitmap(intro); frontImage.Source = bitmapNew; frontImage.Stretch = AppSettings.Default.ImageStretch; backImage.Stretch = AppSettings.Default.ImageStretch; DoubleTransition transition2 = new DoubleTransition(); transition2.Easing = new QuadraticEaseIn(); transition2.Duration = TimeSpan.FromMilliseconds(1600); transition2.Property = Image.OpacityProperty; frontImage.Transitions = new Transitions(); frontImage.Transitions.Add(fadeTransition); backImage.Transitions = new Transitions(); backImage.Transitions.Add(transition2); slideTimer.Elapsed += Timer_Tick; AppSettings.Default.ReloadSettings = true; slideTimer.Start(); Timer_Tick(null, null); Logger.LogComment("Initialized"); }