public Inputbox(string message, string _title) { InitializeComponent(); IsCanceled = true; this.ResultName = ""; this.tbTitle.Text = _title; this.txtMessage.Text = message; snapToEdge = Properties.Settings.Default.SnapToEdges; #region sticky windows if (snapToEdge) { WindowManager.RegisterWindow(this); m_NativeBehaviors = new NativeBehaviors(this); SnapToBehavior stb = new SnapToBehavior(); stb.OriginalForm = this; NativeBehaviors.Add(stb); } #endregion #region FADE // Create the fade in storyboard fadeInStoryboard = new Storyboard(); fadeInStoryboard.Completed += new EventHandler(fadeInStoryboard_Completed); DoubleAnimation fadeInAnimation = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.20))); Storyboard.SetTarget(fadeInAnimation, this); Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(UIElement.OpacityProperty)); fadeInStoryboard.Children.Add(fadeInAnimation); // Create the fade out storyboard fadeOutStoryboard = new Storyboard(); fadeOutStoryboard.Completed += new EventHandler(fadeOutStoryboard_Completed); DoubleAnimation fadeOutAnimation = new DoubleAnimation(1.0, 0.0, new Duration(TimeSpan.FromSeconds(0.50))); Storyboard.SetTarget(fadeOutAnimation, this); Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath(UIElement.OpacityProperty)); fadeOutStoryboard.Children.Add(fadeOutAnimation); #endregion this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; this.ShowInTaskbar = false; this.Topmost = true; this.FadeIn(); }
public taskbarDummy(Point grippoint, Size size) { InitializeComponent(); this.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual; WindowManager.RegisterWindow(this); m_NativeBehaviors = new NativeBehaviors(this); stb = new SnapToBehavior(); stb.OriginalForm = this; NativeBehaviors.Add(stb); this.ShowInTaskbar = false; this.Top = grippoint.Y; this.Left = grippoint.X; this.Width = size.Width; this.Height = size.Height; this.Show(); }
public WindowSettings(CommandBox current) { InitializeComponent(); this.txtTitle.Text = "Quicky simple settings"; snapToEdge = Properties.Settings.Default.SnapToEdges; #region sticky windows if (snapToEdge) { WindowManager.RegisterWindow(this); m_NativeBehaviors = new NativeBehaviors(this); SnapToBehavior stb = new SnapToBehavior(); stb.OriginalForm = this; NativeBehaviors.Add(stb); } #endregion currentCmd = current; #region FADE // Create the fade in storyboard fadeInStoryboard = new Storyboard(); fadeInStoryboard.Completed += new EventHandler(fadeInStoryboard_Completed); DoubleAnimation fadeInAnimation = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.20))); Storyboard.SetTarget(fadeInAnimation, this); Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(UIElement.OpacityProperty)); fadeInStoryboard.Children.Add(fadeInAnimation); // Create the fade out storyboard fadeOutStoryboard = new Storyboard(); fadeOutStoryboard.Completed += new EventHandler(fadeOutStoryboard_Completed); DoubleAnimation fadeOutAnimation = new DoubleAnimation(1.0, 0.0, new Duration(TimeSpan.FromSeconds(0.50))); Storyboard.SetTarget(fadeOutAnimation, this); Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath(UIElement.OpacityProperty)); fadeOutStoryboard.Children.Add(fadeOutAnimation); #endregion this.FadeIn(); loadSettings(); }