Пример #1
0
        public async void deleteModule(string ID)
        {
            await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                                                        async() =>
            {
                var infos = getModuleInfosViaID(ID);
                MessageDialog dialog_warning = new MessageDialog("");
                dialog_warning.Title         = "An module want to uninstall \"" + infos.moduleName + "\" on the editor";
                dialog_warning.Content       = "Are you sure to accept the module to uninstall \"" + infos.moduleName + "\" on the editor ?";

                dialog_warning.Commands.Add(new UICommand
                {
                    Label   = "Yes",
                    Invoked = async(e) =>
                    {
                        await ModulesWriteManager.DeleteModuleViaIDAsync(ID);
                    }
                });

                dialog_warning.Commands.Add(new UICommand
                {
                    Label   = "No",
                    Invoked = (e) =>
                    { }
                });

                await dialog_warning.ShowAsync();
            });
        }
Пример #2
0
        private async void DeleteAcceptButton_Click(object sender, RoutedEventArgs e)
        {
            ModuleInfosShow element = (ModuleInfosShow)((Button)sender).DataContext;

            if (await ModulesWriteManager.DeleteModuleViaIDAsync(element.Module.ID))
            {
                LoadModules();
            }
        }