summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WinRT
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2016-06-08 17:38:08 (GMT)
committerJason Smith <jason.smith@xamarin.com>2016-06-08 17:38:08 (GMT)
commitce0238846a5aa9436d2d7a79682688511473f595 (patch)
tree40ff7dd4a29312ad2c5bada1ce252a31e97aaefc /Xamarin.Forms.Platform.WinRT
parent2a244e0b2fc793f9d58ee517b6e73350583756b0 (diff)
downloadxamarin-forms-ce0238846a5aa9436d2d7a79682688511473f595.zip
xamarin-forms-ce0238846a5aa9436d2d7a79682688511473f595.tar.gz
xamarin-forms-ce0238846a5aa9436d2d7a79682688511473f595.tar.bz2
[Win 8.1] Initial ListView selection not shown (#174)
On Windows 8.1, when initially setting a ListView's SelectedItem, the item in question would not have any visual indication that it was selected when first showing (a background color for the cell). Subsequent selections would work as expected.
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT')
-rw-r--r--Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs b/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs
index bbd101f..d47299a 100644
--- a/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs
@@ -83,6 +83,12 @@ namespace Xamarin.Forms.Platform.WinRT
// WinRT throws an exception if you set ItemsSource directly to a CVS, so bind it.
List.DataContext = new CollectionViewSource { Source = Element.ItemsSource, IsSourceGrouped = Element.IsGroupingEnabled };
+#if !WINDOWS_UWP
+ var selected = Element.SelectedItem;
+ if (selected != null)
+ OnElementItemSelected(null, new SelectedItemChangedEventArgs(selected));
+#endif
+
UpdateGrouping();
UpdateHeader();
UpdateFooter();