Beispiel #1
0
        private async Task ContentDiashow(AppBarButton appBarButton)
        {
            ContentDialog contentDialog = new ContentDialog
            {
                Title               = "是否删除?",
                PrimaryButtonText   = "删除",
                SecondaryButtonText = "取消",
            };

            contentDialog.PrimaryButtonClick += (_s, _e) =>
            {
                var list = NameMap.FindParent <ListViewItem>(appBarButton);
                if (RootPivot.SelectedIndex == 0)
                {
                    drafts.RemoveAt(Draftlist.IndexFromContainer(list));
                }
                else if (RootPivot.SelectedIndex == 1)
                {
                    answerDrafts.RemoveAt(AnswerList.IndexFromContainer(list));
                }
            };
            contentDialog.SecondaryButtonClick += (_s, _e) =>
            {
            };
            await contentDialog.ShowAsync();
        }
Beispiel #2
0
        private void Send_Click(object sender, RoutedEventArgs e)
        {
            AppBarButton appBarButton = (AppBarButton)sender;
            var          list         = NameMap.FindParent <ListViewItem>(appBarButton);

            if (RootPivot.SelectedIndex == 0)
            {
                viewItem = list;
                Frame.Navigate(typeof(EditArtical), drafts[Draftlist.IndexFromContainer(list)]);
            }
            else if (RootPivot.SelectedIndex == 1)
            {
                vAnsItem = list;
                Frame.Navigate(typeof(MakeAnswer), answerDrafts[AnswerList.IndexFromContainer(list)]);
            }
        }