Beispiel #1
0
 /// <summary>
 /// Handles the Appearing event.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 public void OnAppearing(object sender, EventArgs e)
 {
     if (!_isSetup) // perform initial setup
     {
         CollapsedView.IsVisible = true;
         ExpandedView.IsVisible  = false;
         //ExpandedCloseLabel.IsVisible = false;
         SetCollapsedBounds();
         SetExpandedBounds();
         CollapsableFrame.LayoutTo(_collapsedBounds);
         ForceUpdateSize();
         _isSetup = true;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Handles Tap events on the ViewCell.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="args">Arguments.</param>
 protected void OnTapped(object sender, EventArgs args)
 {
     Debug.WriteLine("_expandedView Bounds: " + _expandedView.Bounds);
     Debug.WriteLine("_collapsedView Bounds: " + _collapsedView.Bounds);
     Debug.WriteLine("OnTapped");
     if (_isExpanded) // collapse the ViewCell
     {
         Debug.WriteLine("Collapsed: " + _collapsedBounds);
         CollapsableFrame.LayoutTo(_collapsedBounds, 500, Easing.CubicIn);
         ForceUpdateSize();
         CollapsableFrame.BackgroundColor = _collapsedView.BackgroundColor;
         _collapsedView.RotationY         = -270.0;
         _expandedView.RotateYTo(-90.0, 250, Easing.SinIn);
         _expandedView.IsVisible  = false;
         _collapsedView.IsVisible = true;
         _collapsedView.RotateYTo(-360.0, 250, Easing.SinOut);
         _collapsedView.RotationY = 0.0;
         _isExpanded = false;
         //ExpandedCloseLabel.IsVisible = false;
     }
     else // Expand the ViewCell
     {
         Debug.WriteLine("Expanded: " + _expandedBounds);
         CollapsableFrame.LayoutTo(_expandedBounds, 500, Easing.CubicOut);
         ForceUpdateSize();
         CollapsableFrame.BackgroundColor = _expandedView.BackgroundColor;
         _expandedView.RotationY          = -270.0;
         _collapsedView.RotateYTo(-90.0, 250, Easing.SinIn);
         _collapsedView.IsVisible = false;
         _expandedView.IsVisible  = true;
         _expandedView.RotateYTo(-360.0, 250, Easing.SinOut);
         _expandedView.RotationY = 0.0;
         _isExpanded             = true;
         //ExpandedCloseLabel.IsVisible = true;
     }
 }