Beispiel #1
0
        private async void ListView_OnItemClick(object sender, ItemClickEventArgs e)
        {
            var channelBindingModel = e.ClickedItem as ChannelBindingModel;

            if (channelBindingModel != null)
            {
                if (PlatformHelper.IsMobile)
                {
                    FirstFrameProgressRing.IsActive = true;
                    var result = await Cache.GetCachedHtml(channelBindingModel.ContentId);

                    FirstFrameProgressRing.IsActive = false;
                    if (!string.IsNullOrEmpty(result))
                    {
                        channelBindingModel.NotifyPropertyChanged("TitleForeground");
                        var obj = result.ToJsonObject <InfoResult.Rootobject>();
                        if (obj.code == 200)
                        {
                            App.RootFrame.Navigate(typeof(ContentPage), obj.data);
                        }
                        else
                        {
                            await new MessageDialog(obj.message).ShowAsync();
                        }
                    }
                }
                else
                {
                    while (SecondFrame.CanGoBack)
                    {
                        SecondFrame.GoBack();
                    }
                    SecondFrameProgressRing.IsActive = true;
                    var result = await Cache.GetCachedHtml(channelBindingModel.ContentId);

                    if (!string.IsNullOrEmpty(result))
                    {
                        channelBindingModel.NotifyPropertyChanged("TitleForeground");
                        var obj = result.ToJsonObject <InfoResult.Rootobject>();
                        if (obj.code == 200)
                        {
                            SecondFrame.Navigate(typeof(ContentPage), obj.data);
                        }
                        else
                        {
                            await new MessageDialog(obj.message).ShowAsync();
                        }
                    }
                    SecondFrameProgressRing.IsActive = false;
                }
            }
        }
Beispiel #2
0
 private void BackButton_Click(object sender, RoutedEventArgs e)
 {
     SecondFrame.GoBack();
 }