private async void List_ItemClick(object sender, ItemClickEventArgs e) { Hide(ContentDialogBaseResult.OK); var item = e.ClickedItem as Sticker; if (item != null) { await StickerSetView.GetForCurrentView().ShowAsync(item.SetId); } }
public static StickerSetView GetForCurrentView() { var id = ApplicationView.GetApplicationViewIdForWindow(Window.Current.CoreWindow); if (_windowContext.TryGetValue(id, out WeakReference <StickerSetView> reference) && reference.TryGetTarget(out StickerSetView value)) { return(value); } var context = new StickerSetView(); _windowContext[id] = new WeakReference <StickerSetView>(context); return(context); }