From a3d8d373b0638b544c5867e5adaf06aa464c9d22 Mon Sep 17 00:00:00 2001
From: Pawel Andruszkiewicz
Date: Wed, 21 Dec 2016 08:28:05 +0100
Subject: Homogenous mode should be set to false if grouping is enabled
Change-Id: I01327d4c0be6847445c4711d5c4cb6f60f3ba6a9
Signed-off-by: Pawel Andruszkiewicz
---
Xamarin.Forms.Platform.Tizen/Native/ListView.cs | 35 +++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
(limited to 'Xamarin.Forms.Platform.Tizen/Native')
diff --git a/Xamarin.Forms.Platform.Tizen/Native/ListView.cs b/Xamarin.Forms.Platform.Tizen/Native/ListView.cs
index d5531dc4..e932a28e 100644
--- a/Xamarin.Forms.Platform.Tizen/Native/ListView.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/ListView.cs
@@ -84,11 +84,33 @@ namespace Xamarin.Forms.Platform.Tizen.Native
///
GenItemClass _headerFooterItemClass = null;
+ ///
+ /// Indicates if the list view has uneven rows.
+ ///
+ bool _hasUnevenRows = false;
+
+ ///
+ /// Indicates if grouping in the list view is enabled.
+ ///
+ bool _isGroupingEnabled = false;
+
///
/// Gets or sets a value indicating whether this instance has grouping enabled.
///
/// true if this instance has grouping enabled.
- public bool IsGroupingEnabled { get; set; }
+ public bool IsGroupingEnabled
+ {
+ get
+ {
+ return _isGroupingEnabled;
+ }
+
+ set
+ {
+ _isGroupingEnabled = value;
+ UpdateHomogeneousMode();
+ }
+ }
///
/// Constructor of ListView native control.
@@ -124,7 +146,8 @@ namespace Xamarin.Forms.Platform.Tizen.Native
/// If true, the list will allow uneven sizes for its rows.
public void SetHasUnevenRows(bool hasUnevenRows)
{
- Homogeneous = !hasUnevenRows;
+ _hasUnevenRows = hasUnevenRows;
+ UpdateHomogeneousMode();
UpdateRealizedItems();
}
@@ -597,5 +620,13 @@ namespace Xamarin.Forms.Platform.Tizen.Native
}
return _headerFooterItemClass;
}
+
+ ///
+ /// Updates the homogeneous mode of the list view.
+ ///
+ void UpdateHomogeneousMode()
+ {
+ Homogeneous = !_hasUnevenRows && !_isGroupingEnabled;
+ }
}
}
--
cgit v1.2.3