private void slideAnimate(int x, int y, eSlideSide side, Boolean a) { slidePanel1.AnimationTime = x; slidePanel1.IsOpen = a; slidePanel1.SlideSide = side; slidePanel1.AnimationTime = y; slidePanel1.IsOpen = true; }
private void ChangeSlideSide(eSlideSide side) { slidePanel1.SlideSide = side; buttonLeft.Checked = (side == eSlideSide.Left); buttonTop.Checked = (side == eSlideSide.Top); buttonRight.Checked = (side == eSlideSide.Right); buttonBottom.Checked = (side == eSlideSide.Bottom); }
/// <summary> /// Called when SlideSide property has changed. /// </summary> /// <param name="oldValue">Old property value</param> /// <param name="newValue">New property value</param> protected virtual void OnSlideSideChanged(eSlideSide oldValue, eSlideSide newValue) { //OnPropertyChanged(new PropertyChangedEventArgs("SlideSide")); if (!this.IsOpen) { WaitForCurrentAnimationFinish(); this.Bounds = GetSlideOutBounds(this.Parent, _OpenBounds); if (_SlideOutButtonVisible) CreateSlideOutButton(); } }
private void CloseModalPanel(Control panel, bool slideOut, eSlideSide slideOutToSide) { SlidePanel slidePanel = null; foreach (Control modalPanel in _ModalPanels) { if (modalPanel.Contains(panel)) { slidePanel = (SlidePanel)modalPanel; break; } } if (slidePanel == null) throw new ArgumentException("panel was not shown previously using ShowModalPanel method"); if (slideOut) { slidePanel.SlideSide = slideOutToSide; slidePanel.IsOpen = false; DateTime start = DateTime.Now; while (slidePanel.IsAnimating) { Application.DoEvents(); if (DateTime.Now.Subtract(start).TotalMilliseconds > 950) { slidePanel.AbortAnimation(); slidePanel.Visible = false; break; } } } else slidePanel.Visible = false; slidePanel.Controls.Remove(panel); if (slidePanel.Parent != null) slidePanel.Parent.Controls.Remove(slidePanel); if (_ModalPanels.Contains(slidePanel)) _ModalPanels.Remove(slidePanel); if(!slidePanel.IsDisposed) slidePanel.Dispose(); if (_ModalPanels.Count == 0 && _MetroTab != null) { //_MetroTab.MetroTabStrip.Enabled = true; _MetroTab.MetroTabStrip.StripContainerItem.Enabled = true; for (int i = 0; i < _MetroTab.MetroTabStrip.CaptionContainerItem.SubItems.Count; i++) { BaseItem item = _MetroTab.MetroTabStrip.CaptionContainerItem.SubItems[i]; if (item.SystemItem) continue; if(_DisabledItemIds.Contains(item.Id)) item.Enabled = true; } _MetroTab.MetroTabStrip.Refresh(); } }
/// <summary> /// Hides the panel control that was previously shown using ShowModalPanel method by sliding it out of the view to the specified side. /// </summary> /// <param name="panel">Control to hide.</param> /// <param name="slideOutToSide">Side to slide control into.</param> public void CloseModalPanel(Control panel, eSlideSide slideOutToSide) { CloseModalPanel(panel, true, slideOutToSide); }
private void ShowModalPanel(Control panel, bool slideIn, eSlideSide slideFromSide, int animationTimeMilliseconds) { StyleManager.UpdateAmbientColors(panel); SlidePanel slidePanel = new SlidePanel(); slidePanel.CenterContent = true; slidePanel.AnimationTime = animationTimeMilliseconds; slidePanel.SlideSide = slideFromSide; slidePanel.SlideOutButtonVisible = false; if (slideIn) { slidePanel.Bounds = GetModalPanelBounds(); slidePanel.SlideOutOfViewSilent(this); } else { slidePanel.Bounds = GetModalPanelBounds(); } slidePanel.Controls.Add(panel); this.Controls.Add(slidePanel); this.Controls.SetChildIndex(slidePanel, 0); _ModalPanels.Add(slidePanel); if (_ModalPanels.Count == 1 && _MetroTab != null) { //_MetroTab.MetroTabStrip.Enabled = false; _MetroTab.MetroTabStrip.StripContainerItem.Enabled = false; for (int i = 0; i < _MetroTab.MetroTabStrip.CaptionContainerItem.SubItems.Count; i++) { BaseItem item = _MetroTab.MetroTabStrip.CaptionContainerItem.SubItems[i]; if (item.SystemItem && !(item is QatCustomizeItem)) continue; item.Enabled = false; _DisabledItemIds.Add(item.Id); } _MetroTab.MetroTabStrip.Invalidate(); } this.Update(); if (slideIn) slidePanel.IsOpen = true; }
/// <summary> /// Shows the panel control in the center of the form by sliding it in from specified side and covers all non system controls making the panel effectively modal. /// </summary> /// <param name="panel">Panel to show.</param> /// <param name="slideFromSide">Side to slide panel into the view from.</param> /// <param name="animationTimeMilliseconds">Slide animation speed in milliseconds.</param> public void ShowModalPanel(Control panel, eSlideSide slideFromSide, int animationTimeMilliseconds) { ShowModalPanel(panel, true, slideFromSide, SlidePanel.DefaultAnimationTime); }
private void ChangeSlideSide(eSlideSide side) { }