Exemplo n.º 1
0
 private void Button_Click_6(object sender, RoutedEventArgs e)
 {
     if (i == 1)
     {
         var f = FeedListPageViewModelBase.GetProvider(FeedListType.AppPageList, ID.Text);
         if (f != null)
         {
             UIHelper.NavigateInSplitPane(typeof(FeedListPage), f);
         }
     }
     else if (i == 2)
     {
         if (ID.Text.StartsWith("V", StringComparison.Ordinal))
         {
             UIHelper.Navigate(typeof(IndexPage), new ViewModels.IndexPage.ViewModel(Url + ID.Text, true));
         }
         else
         {
             UIHelper.Navigate(typeof(IndexPage), new ViewModels.IndexPage.ViewModel(ID.Text, true));
         }
     }
     else if (i == 3)
     {
         var f = FeedListPageViewModelBase.GetProvider(FeedListType.DevicePageList, ID.Text);
         if (f != null)
         {
             UIHelper.NavigateInSplitPane(typeof(FeedListPage), f);
         }
     }
     else
     {
         UIHelper.OpenLinkAsync(Url + ID.Text);
     }
 }
Exemplo n.º 2
0
        internal static async void FeedButton_Click(object sender, RoutedEventArgs _)
        {
            void DisabledCopy()
            {
                if ((sender as FrameworkElement).DataContext is ICanCopy i)
                {
                    i.IsCopyEnabled = false;
                }
            }

            FrameworkElement element = sender as FrameworkElement;

            switch (element.Name)
            {
            case "makeReplyButton":
                DisabledCopy();
                var item = element.FindAscendant <ListViewItem>();
                var ctrl = item.FindName("makeFeed") as MakeFeedControl;
                ctrl.Visibility = ctrl.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
                break;

            case "likeButton":
                DisabledCopy();
                await DataHelper.MakeLikeAsync(
                    element.Tag as ICanChangeLikModel,
                    element.Dispatcher,
                    (SymbolIcon)element.FindName("like1"),
                    (SymbolIcon)element.FindName("like2"));

                break;

            case "reportButton":
                DisabledCopy();
                UIHelper.Navigate(typeof(Pages.BrowserPage), new object[] { false, $"https://m.coolapk.com/mp/do?c=feed&m=report&type=feed&id={element.Tag}" });
                break;

            case "shareButton":
                DisabledCopy();
                break;

            case "deviceButton":
                var f = FeedListPageViewModelBase.GetProvider(FeedListType.DevicePageList, (sender as FrameworkElement).Tag as string);
                if (f != null)
                {
                    UIHelper.NavigateInSplitPane(typeof(FeedListPage), f);
                }
                break;

            case "changeButton":
                DisabledCopy();
                UIHelper.NavigateInSplitPane(typeof(AdaptivePage), new ViewModels.AdaptivePage.ViewModel((sender as FrameworkElement).Tag as string, ViewModels.AdaptivePage.ListType.FeedInfo, "changeHistory"));
                break;

            default:
                DisabledCopy();
                UIHelper.OpenLinkAsync((sender as FrameworkElement).Tag as string);
                break;
            }
        }
Exemplo n.º 3
0
        private async void ViewFeed(object sender, RoutedEventArgs e)
        {
            var f = FeedListPageViewModelBase.GetProvider(FeedListType.AppPageList, id);

            if (f != null)
            {
                UIHelper.NavigateInSplitPane(typeof(FeedListPage), f);
            }
        }
Exemplo n.º 4
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            var f = FeedListPageViewModelBase.GetProvider(FeedListType.UserPageList, await Core.Helpers.NetworkHelper.GetUserIDByNameAsync(uid.Text));

            if (f != null)
            {
                UIHelper.NavigateInSplitPane(typeof(FeedListPage), f);
            }
        }