コード例 #1
0
ファイル: Animations.cs プロジェクト: hoangduit/stickiesspace
        public void MinimizeAnimation()
        {
            //Minimize Animation
            stickyWindow.MinHeight            = 0;
            stickyWindow.MinWidth             = 0;
            stickyWindow.ResizeMode           = ResizeMode.NoResize;
            stickyWindow.OriginalSize         = new Size(stickyWindow.ActualWidth, stickyWindow.ActualHeight);
            stickyWindow.MyWindowState        = WindowState.Minimized;
            stickyWindow.sSlider.MyVisibility = Visibility.Hidden;

            MyTextBox txt = stickyWindow.sTextArea;

            txt.PreviousActiveState = txt.ActiveState;
            txt.ActiveState         = TextBoxActiveState.Inactive;
            txt.TextWrapping        = TextWrapping.NoWrap;

            DoubleAnimation animHeight = new DoubleAnimation(stickyWindow.ActualHeight, 20, TimeSpan.FromMilliseconds(250));
            DoubleAnimation animWidth  = new DoubleAnimation(stickyWindow.ActualWidth, 20, TimeSpan.FromMilliseconds(250));

            Storyboard.SetTargetName(animHeight, stickyWindow.Name);
            Storyboard.SetTargetProperty(animHeight, new PropertyPath(Window.HeightProperty));

            Storyboard.SetTargetName(animWidth, stickyWindow.Name);
            Storyboard.SetTargetProperty(animWidth, new PropertyPath(Window.WidthProperty));

            StoryboardExtender storyMin = new StoryboardExtender();

            storyMin.Children.Add(animWidth);
            storyMin.Children.Add(animHeight);

            storyMin.Begin(stickyWindow.Owner);
        }
コード例 #2
0
ファイル: Animations.cs プロジェクト: hoangduit/stickiesspace
        void animationsRestore_Completed(object sender, EventArgs e)
        {
            Clock c = sender as Clock;
            StoryboardExtender sbe = c.Timeline as StoryboardExtender;
            StickyWindowModel  sw  = sbe.TargetElement as StickyWindowModel;

            sw.MinHeight     = 50;
            sw.MinWidth      = 100;
            sw.ResizeMode    = ResizeMode.CanResizeWithGrip;
            sw.MyWindowState = WindowState.Normal;

            MyTextBox txt = sw.sTextArea;

            txt.ActiveState  = txt.PreviousActiveState;
            txt.TextWrapping = TextWrapping.Wrap;
        }
コード例 #3
0
        void txt_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            MyTextBox txt = sender as MyTextBox;

            txt.ActiveState = TextBoxActiveState.Active;
        }
コード例 #4
0
        void txt_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
        {
            MyTextBox txt = sender as MyTextBox;

            txt.ActiveState = TextBoxActiveState.Inactive;
        }