internal void GetPosition(StickyWindowModel stickyWindow)
        {
            double parentY = stickyWindow.Top;
            double parentX = stickyWindow.Left;
            double parentH = stickyWindow.Height;
            double parentW = stickyWindow.Width;

            WindowPositon colorControlPos;

            //Left or Right
            if (parentX < 220)
            {
                colorControlPos = WindowPositon.Right;
            }
            else
            {
                colorControlPos = WindowPositon.Left;
            }

            //determine actual doubles
            switch (colorControlPos)
            {
            case WindowPositon.Right:
                this.Left = parentX + this.Height + 10;
                break;

            case WindowPositon.Left:
                this.Left = parentX - this.Width - 10;
                break;
            }

            //TODO - Top or Bottom
            this.Top = parentY;
        }
Ejemplo n.º 2
0
 protected void ActivateTextBox(StickyWindowModel stickyWindow)
 {
     if (stickyWindow.MyWindowState != WindowState.Minimized)
     {
         this.Focusable = true;
         this.SetValue(TextBox.CursorProperty, Cursors.IBeam);
     }
 }
Ejemplo n.º 3
0
 protected void ActivateTextBox(StickyWindowModel stickyWindow)
 {
     if (stickyWindow.MyWindowState != WindowState.Minimized)
     {
         this.Focusable = true;
         this.SetValue(TextBox.CursorProperty, Cursors.IBeam);
     }
 }
        public StickyWindowColorControlModel(StickyWindowModel stickyWindow)
        {
            _stickyWindowParent = stickyWindow;

            CommandBinding CloseCmdBinding = new CommandBinding(CloseCmd, CloseCmdExecuted, CloseCmdCanExecute);
            this.CommandBindings.Add(CloseCmdBinding);
            this.ShowInTaskbar = false;
        }
Ejemplo n.º 5
0
        void scroller_ScrollChanged(object sender, RoutedEventArgs e)
        {
            StickyWindowModel stickyWindow = (StickyWindowModel)sender;
            MySlider          slider       = stickyWindow.sSlider;

            slider.HandleScrollChange(stickyWindow);
            e.Handled = true;
        }
        public StickyWindowColorControlModel(StickyWindowModel stickyWindow)
        {
            _stickyWindowParent = stickyWindow;

            CommandBinding CloseCmdBinding = new CommandBinding(CloseCmd, CloseCmdExecuted, CloseCmdCanExecute);

            this.CommandBindings.Add(CloseCmdBinding);
            this.ShowInTaskbar = false;
        }
Ejemplo n.º 7
0
        public void HandleScrollChange(StickyWindowModel stickyWindow)
        {
            MyScrollViewer scroller = stickyWindow.sScroller;

            if (scroller.ExtentHeight > scroller.Height && stickyWindow.MyWindowState == WindowState.Normal)
                this.MyVisibility = Visibility.Visible;
            else
                this.MyVisibility = Visibility.Hidden;

            this.Value = scroller.MyVerticalOffset;
            this.Maximum = scroller.ExtentHeight;
        }
Ejemplo n.º 8
0
        public void HandleScrollChange(StickyWindowModel stickyWindow)
        {
            MyScrollViewer scroller = stickyWindow.sScroller;

            if (scroller.ExtentHeight > scroller.Height && stickyWindow.MyWindowState == WindowState.Normal)
            {
                this.MyVisibility = Visibility.Visible;
            }
            else
            {
                this.MyVisibility = Visibility.Hidden;
            }

            this.Value   = scroller.MyVerticalOffset;
            this.Maximum = scroller.ExtentHeight;
        }
Ejemplo n.º 9
0
        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;
        }
        internal void CreateAndShow(StickyWindowModel stickyWindow)
        {
            this.Height             = 210;
            this.Width              = 210;
            this.AllowsTransparency = true;
            this.WindowStyle        = WindowStyle.None;
            this.Title              = "stickyWindowColorControl";
            this.Name  = "stickyWindowColorControl";
            this.Owner = stickyWindow;
            GetPosition(stickyWindow);

            //fade in window
            Storyboard animationsFadeInColorControl = stickyWindow.Template.Resources["animationsFadeInColorControl"] as Storyboard;

            animationsFadeInColorControl.Begin(this);

            this.Show();

            Initialize();
            stickyWindow.isColorWindowOpen = true;
        }
Ejemplo n.º 11
0
 public StickyWindowCommands(StickyWindowModel stickyWindowInstance)
 {
     _stickyWindow = stickyWindowInstance;
 }
Ejemplo n.º 12
0
 public StickyWindowAnimations(StickyWindowModel stickyWindowInstance)
 {
     _stickyWindow = stickyWindowInstance;
 }
        internal void GetPosition(StickyWindowModel stickyWindow)
        {
            double parentY = stickyWindow.Top;
            double parentX = stickyWindow.Left;
            double parentH = stickyWindow.Height;
            double parentW = stickyWindow.Width;

            WindowPositon colorControlPos;

            //Left or Right
            if (parentX < 220)
                colorControlPos = WindowPositon.Right;
            else
                colorControlPos = WindowPositon.Left;

            //determine actual doubles
            switch (colorControlPos)
            {
                case WindowPositon.Right:
                    this.Left = parentX + this.Height + 10;
                    break;

                case WindowPositon.Left:
                    this.Left = parentX - this.Width - 10;
                    break;
            }

            //TODO - Top or Bottom
            this.Top = parentY;
        }
        internal void CreateAndShow(StickyWindowModel stickyWindow)
        {
            this.Height = 210;
            this.Width = 210;
            this.AllowsTransparency = true;
            this.WindowStyle = WindowStyle.None;
            this.Title = "stickyWindowColorControl";
            this.Name = "stickyWindowColorControl";
            this.Owner = stickyWindow;
            GetPosition(stickyWindow);

            //fade in window
            Storyboard animationsFadeInColorControl = stickyWindow.Template.Resources["animationsFadeInColorControl"] as Storyboard;
            animationsFadeInColorControl.Begin(this);

            this.Show();

            Initialize();
            stickyWindow.isColorWindowOpen = true;
        }
Ejemplo n.º 15
0
 public StickyWindowAnimations(StickyWindowModel stickyWindowInstance)
 {
     _stickyWindow = stickyWindowInstance;
 }
        public void DeSerialzeState(object sender, EventArgs e)
        {
            XmlDocument stateDoc = new XmlDocument();
            try
            {
                stateDoc.Load(String.Format(@"{0}\stickySpacesState.xml", System.Windows.Forms.Application.UserAppDataPath));
                StringReader reader = new StringReader(stateDoc.InnerXml);
                XPathDocument navDoc = new XPathDocument(reader);
                XPathNavigator nav = navDoc.CreateNavigator();
                XPathExpression windowsPath = nav.Compile(@"/StickySpacesWindows/StickyWindow");
                XPathNodeIterator windows = nav.Select(windowsPath);

                if (windows != null)
                    while (windows.MoveNext())
                    {
                        StickyWindowModel newSw = new StickyWindowModel(windows.Current.OuterXml);
                        newSw.Owner = this;
                        this.RegisterName(newSw.Name, newSw);
                    }
            }
            catch (Exception ex) { }
        }
 public void CreateStickyWindow(object sender, EventArgs e)
 {
     StickyWindowModel stickyWindow = new StickyWindowModel(null);
     stickyWindow.Owner = this;
     this.RegisterName(stickyWindow.Name, stickyWindow);
 }
Ejemplo n.º 18
0
 public StickyWindowCommands(StickyWindowModel stickyWindowInstance)
 {
     _stickyWindow = stickyWindowInstance;
 }
Ejemplo n.º 19
0
        void StickyWindowModel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            StickyWindowModel stickyWindow = sender as StickyWindowModel;

            stickyWindow.DragMove();
        }