Ejemplo n.º 1
0
 public void Expand()
 {
     if (State != CollapsedState.Expanded)
     {
         state = CollapsedState.Expanded;
         workingArea.Visible = true;
         Height = storedHeight;
     }
 }
Ejemplo n.º 2
0
 public void Collapse()
 {
     if (State != CollapsedState.Collapsed)
     {
         state = CollapsedState.Collapsed;
         WorkingArea.Visible = false;
         storedHeight        = Height;
         Height = HeaderHeight;
     }
 }
        internal void StartAnimation(CollapsedState DestinationState)
        {
            if(pnl.Animating)
            return;

              mAnimationStepNum = 0;

              InitAnimationParameteres(DestinationState);

              mAnimationTimer.Start();
        }
Ejemplo n.º 4
0
 public SymbolVisual(Point center, CollapsedState collapsedState)
 {
     this.center         = center;
     this.collapsedState = collapsedState;
 }
Ejemplo n.º 5
0
 public CollapsiblePanel()
 {
     InitializeComponent();
     State        = CollapsedState.Expanded;
     HeaderHeight = 30;
 }
        private void InitAnimationParameteres(CollapsedState destinationState)
        {
            pnl.mAnimating = true;
              pnl.FullExpandedSizeChanged += new EventHandler(pnl_FullExpandedSizeChanged);
              pnl.PartialExpandedSizeChanged += new EventHandler(pnl_PartialExpandedSizeChanged);
              pnl.CollapsedSizeChanged += new EventHandler(pnl_CollapsedSizeChanged);

              pnl.SuspendLayout();

              mDestinationState = destinationState;

              // Set the image that the controll will paint as its background during animation
              // and set initial and final sizes of the animation
              switch(pnl.CollapsedState)
              {
            case CollapsedState.Collapsed:
              if(destinationState == CollapsedState.PartialExpanded)
              {
            // From collapsed to partial
            pnl.AnimationImage = pnl.GetCollapsedImage(ImageSize.Partial);
            mSlideStartSize = pnl.CollapsedSize;
            mSlideEndSize = pnl.PartialExpandedSize;
              }
              else
              {
            // From collapsed to full
            pnl.AnimationImage = pnl.GetCollapsedImage(ImageSize.Full);
            mSlideStartSize = pnl.CollapsedSize;
            mSlideEndSize = pnl.FullExpandedSize;
              }
              break;
            case CollapsedState.PartialExpanded:
              if(destinationState == CollapsedState.FullExpanded)
              {
            // From partial to full
            pnl.AnimationImage = pnl.GetCollapsedImage(ImageSize.Full);
            mSlideStartSize = pnl.PartialExpandedSize;
            mSlideEndSize = pnl.FullExpandedSize;
              }
              else
              {
            // From partial to collapsed
            pnl.AnimationImage = pnl.GetExpandedImage();
            mSlideStartSize = pnl.PartialExpandedSize;
            mSlideEndSize = pnl.CollapsedSize;
              }
              break;
            case CollapsedState.FullExpanded:
              pnl.AnimationImage = pnl.GetExpandedImage();
              if(destinationState == CollapsedState.PartialExpanded)
              {
            // From full to partial
            mSlideStartSize = pnl.FullExpandedSize;
            mSlideEndSize = pnl.PartialExpandedSize;
              }
              else
              {
            // From full to collapsed
            mSlideStartSize = pnl.FullExpandedSize;
            mSlideEndSize = pnl.CollapsedSize;
              }
              break;
              }
        }