Exemple #1
0
 /// <summary>
 /// 通过 ThreadId 打开回复列表页,打开后从1楼开始显示
 /// </summary>
 public void OpenReplyPageByThreadId()
 {
     if (AdaptiveStates.CurrentState == NarrowState)
     {
         string p = $"tid={ThreadId}";
         Frame.Navigate(typeof(ReplyListPage), p, new CommonNavigationTransitionInfo());
     }
     else
     {
         var cts = new CancellationTokenSource();
         var vm  = new ReplyListViewForDefaultViewModel(cts, ThreadId, ReplyListView, RightBeforeLoaded, RightAfterLoaded, ReplyListViewScrollForSpecifiedPost);
         RightWrap.DataContext = vm;
     }
 }
        void PageRoot_Loaded(object sender, RoutedEventArgs e)
        {
            if (ShouldGoToWideState())
            {
                // We shouldn't see this page since we are in "wide master-detail" mode.
                // Play a transition as we are navigating from a separate page.
                NavigateBackForWideState(useTransition: true);
            }
            else
            {
                var cts = new CancellationTokenSource();
                if (PostId > 0)
                {
                    DataContext = new ReplyListViewForSpecifiedPostViewModel(cts, PostId, ReplyListView, BeforeLoaded, AfterLoaded, ReplyListViewScrollForSpecifiedPost);
                }
                else if (ThreadId > 0)
                {
                    DataContext = new ReplyListViewForDefaultViewModel(cts, ThreadId, ReplyListView, BeforeLoaded, AfterLoaded, ReplyListViewScrollForSpecifiedPost);
                }
            }

            Window.Current.SizeChanged += Window_SizeChanged;
        }