コード例 #1
0
ファイル: ExpanxibleCell.cs プロジェクト: xamarinhub/SKOR.UI
 private void ChangedDetailVisibility()
 {
     if (Detail != null)
     {
         if (IsDetailShown)
         {
             Detail.IsVisible = IsDetailShown;
             //if (Detail.Height > 0 && Detail.TranslationY!=0)
             //{
             //    Detail.TranslateTo(0, 0);
             //}
             Detail.Animate("HeightChange", _ =>
             {
                 Detail.HeightRequest = _;
                 this.ForceUpdateSize();
             }, 0d, DetailHeight);
         }
         else
         {
             Detail.Animate("HeightChangeBack", _ =>
             {
                 Detail.HeightRequest = _;
                 this.ForceUpdateSize();
             }, DetailHeight, 0d);
             //if (Detail.Height > 0)
             //{
             //    Detail.TranslateTo(0, -Detail.Height).ContinueWith(_ => Device.BeginInvokeOnMainThread(() => Detail.IsVisible = IsDetailShown));
             //}
             Task.Delay(250).ContinueWith(_ => Device.BeginInvokeOnMainThread(() => Detail.IsVisible = IsDetailShown));
         }
         var height = Detail.Height;
     }
 }