From 96275d8eecf9cc26216e0232cdb62c8c1034eeb0 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 5 Jun 2019 00:15:54 -0400 Subject: [PATCH] attempted workaround for arg outof range exception --- src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml | 1 + src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs | 4 ++++ src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml index a767afcf4..c33a47e9f 100644 --- a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml +++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml @@ -79,6 +79,7 @@ ("broadcasterService"); _syncService = ServiceContainer.Resolve("syncService"); @@ -57,6 +59,8 @@ namespace Bit.App.Pages } } + public ExtendedListView ListView { get; set; } + protected async override void OnAppearing() { base.OnAppearing(); diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs index 62a4717a4..a5572a777 100644 --- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs +++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs @@ -127,6 +127,7 @@ namespace Bit.App.Pages ShowList = false; ShowAddCipherButton = true; var groupedItems = new List(); + var page = Page as GroupingsPage; try { @@ -203,7 +204,12 @@ namespace Bit.App.Pages ciphersListItems.Count, Device.RuntimePlatform == Device.iOS, !MainPage && !groupedItems.Any())); } + // Workaround for https://stackoverflow.com/a/49992132/1090359 + page.ListView.HasUnevenRows = false; + page.ListView.IsGroupingEnabled = false; GroupedItems.ResetWithRange(groupedItems); + page.ListView.HasUnevenRows = true; + page.ListView.IsGroupingEnabled = true; } finally {