示例#1
0
        /// <summary>
        /// 显示右键菜单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="point"></param>
        private async Task ShowSitesMenuFlyout(FrameworkElement sender, Point point)
        {
            if (sender.DataContext is WatchProgress watch)
            {
                await InitAirSites(watch.SubjectId.ToString());

                SitesMenuFlyout.ShowAt(sender, point);
            }
        }
示例#2
0
        /// <summary>
        /// 鼠标右键
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void GridView_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            if (SettingHelper.UseBangumiDataAirSites && e.PointerDeviceType == PointerDeviceType.Mouse)
            {
                object data = e.OriginalSource switch {
                    GridViewItem item => item.Content,
                    FrameworkElement element => element.DataContext,
                       _ => null
                };
                if (data is WatchProgress watch)
                {
                    e.Handled = true;
                    await InitAirSites(watch.SubjectId.ToString());

                    SitesMenuFlyout.ShowAt((FrameworkElement)e.OriginalSource, e.GetPosition((FrameworkElement)e.OriginalSource));
                }
            }
        }