From 1d6d833f1a53df2a1ca54c65bca6e58a2642fd08 Mon Sep 17 00:00:00 2001 From: Andrei Misiukevich Date: Fri, 31 Aug 2018 22:00:01 +0300 Subject: [PATCH] small refactoring --- ExpandableView/ExpandableView.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ExpandableView/ExpandableView.cs b/ExpandableView/ExpandableView.cs index 0ccb087..233a6b9 100644 --- a/ExpandableView/ExpandableView.cs +++ b/ExpandableView/ExpandableView.cs @@ -32,7 +32,7 @@ public class ExpandableView : StackLayout public static readonly BindableProperty IsTouchToExpandEnabledProperty = BindableProperty.Create(nameof(IsTouchToExpandEnabled), typeof(bool), typeof(ExpandableView), true); - public static readonly BindableProperty SecondaryViewHeightRequestProperty = BindableProperty.Create(nameof(SecondaryViewHeightRequest), typeof(double), typeof(ExpandableView), 0.0); + public static readonly BindableProperty SecondaryViewHeightRequestProperty = BindableProperty.Create(nameof(SecondaryViewHeightRequest), typeof(double), typeof(ExpandableView), -1.0); public static readonly BindableProperty ExpandAnimationLengthProperty = BindableProperty.Create(nameof(ExpandAnimationLength), typeof(uint), typeof(ExpandableView), 250u); @@ -157,7 +157,7 @@ private void OnIsExpandedChanged() } _startHeight = 0; - _endHeight = SecondaryViewHeightRequest > 0 + _endHeight = SecondaryViewHeightRequest >= 0 ? SecondaryViewHeightRequest : _lastVisibleHeight; @@ -174,7 +174,7 @@ private void OnIsExpandedChanged() } else { - _lastVisibleHeight = _startHeight = SecondaryViewHeightRequest > 0 + _lastVisibleHeight = _startHeight = SecondaryViewHeightRequest >= 0 ? SecondaryViewHeightRequest : !isExpanding ? SecondaryView.Height