summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Renderers
diff options
context:
space:
mode:
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>2017-04-24 10:23:40 +0200
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 11:11:24 +0900
commit649baa2d3d9021f5fff50dc24c4b0d0f25fa4fa5 (patch)
treed57bba7d3aff388f75112dc7ef878e12e49da0e3 /Xamarin.Forms.Platform.Tizen/Renderers
parentd80db49273eb1df702077ef040e80ab3f9b6a0f0 (diff)
downloadxamarin-forms-649baa2d3d9021f5fff50dc24c4b0d0f25fa4fa5.tar.gz
xamarin-forms-649baa2d3d9021f5fff50dc24c4b0d0f25fa4fa5.tar.bz2
xamarin-forms-649baa2d3d9021f5fff50dc24c4b0d0f25fa4fa5.zip
Update header/footer in response to HeaderElement/FooterElement notifications
This approach allows to register only one handler per header/footer, covers both Header/Footer and HeaderTemplate/FooterTemplate cases, while handlers are called when elements are ready, so there's no need for an awkward call to Device.StartTimer(). Change-Id: I16c2943e20d93efeab409e8999ce7e72105aa79a Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs44
1 files changed, 4 insertions, 40 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs
index d2b325af..fff21794 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs
@@ -59,12 +59,10 @@ namespace Xamarin.Forms.Platform.Tizen
RegisterPropertyHandler(ListView.IsGroupingEnabledProperty, UpdateIsGroupingEnabled);
RegisterPropertyHandler(ListView.HasUnevenRowsProperty, UpdateHasUnevenRows);
RegisterPropertyHandler(ListView.RowHeightProperty, UpdateRowHeight);
- RegisterPropertyHandler(ListView.HeaderProperty, UpdateHeader);
RegisterPropertyHandler(ListView.SelectedItemProperty, UpdateSelectedItem);
- RegisterPropertyHandler(ListView.FooterProperty, UpdateFooter);
RegisterPropertyHandler(ListView.ItemsSourceProperty, UpdateSource);
- RegisterPropertyHandler(ListView.FooterTemplateProperty, UpdateFooter);
- RegisterPropertyHandler(ListView.HeaderTemplateProperty, UpdateHeader);
+ RegisterPropertyHandler("HeaderElement", UpdateHeader);
+ RegisterPropertyHandler("FooterElement", UpdateFooter);
}
/// <summary>
@@ -327,24 +325,7 @@ namespace Xamarin.Forms.Platform.Tizen
/// </summary>
void UpdateHeader()
{
- if (Element.Header == null)
- {
- Control.SetHeader(null);
- return;
- }
-
- if (((IListViewController)Element).HeaderElement == null)
- {
- Device.StartTimer(new TimeSpan(0), () =>
- {
- Control.SetHeader(((IListViewController)Element).HeaderElement as VisualElement);
- return false;
- });
- }
- else
- {
- Control.SetHeader(((IListViewController)Element).HeaderElement as VisualElement);
- }
+ Control.SetHeader(((IListViewController)Element).HeaderElement as VisualElement);
}
/// <summary>
@@ -352,24 +333,7 @@ namespace Xamarin.Forms.Platform.Tizen
/// </summary>
void UpdateFooter()
{
- if (Element.Footer == null)
- {
- Control.SetFooter(null);
- return;
- }
-
- if (((IListViewController)Element).FooterElement == null)
- {
- Device.StartTimer(new TimeSpan(0), () =>
- {
- Control.SetFooter(((IListViewController)Element).FooterElement as VisualElement);
- return false;
- });
- }
- else
- {
- Control.SetFooter(((IListViewController)Element).FooterElement as VisualElement);
- }
+ Control.SetFooter(((IListViewController)Element).FooterElement as VisualElement);
}
/// <summary>