示例#1
0
        private async void ShowDeleteContentDialog(OperationPattern operationPattern)
        {
            var contentDialogItem = new AcceptContentDialog("Czy chcesz usunąć szablon?");
            var result            = await contentDialogItem.ShowAsync();

            if (result != ContentDialogResult.Primary)
            {
                return;
            }

            RemoveOperationPatternFromList(operationPattern);
            Dal.DeletePattern(operationPattern);
        }
        private async void ShowDeleteOperationContentDialog(Operation operation)
        {
            var acceptDeleteOperationContentDialog = new AcceptContentDialog("Czy chcesz usunąć operację?");

            var result = await acceptDeleteOperationContentDialog.ShowAsync();

            if (result != ContentDialogResult.Primary)
            {
                return;
            }

            DeleteOperation_DialogButtonClick(operation);
            RaisePropertyChanged(nameof(ListOfMoneyAccounts));
        }
        private static async void ShowDeleteAllContentDialog()
        {
            AcceptContentDialog acceptContentDialog = new AcceptContentDialog("Jesteś pewien?");

            ContentDialogResult result = await acceptContentDialog.ShowAsync();

            if (result != ContentDialogResult.Primary)
            {
                return;
            }

            Dal.DeleteAll();
            Dal.AddInitialElements();
        }
        private async void ShowDeleteAccountContentDialog(MAccount account)
        {
            string message = account is SubMAccount
                ? "Czy chcesz usunąć to konto ze wszystkimi subkontami? Zostaną usunięte wszystkie operacje skojażone z tym kontem."
                : "Czy chcesz usunąć to konto? Zostaną usunięte wszystkie operacje skojażone z tym kontem.";

            AcceptContentDialog acceptDeleteOperationContentDialog = new AcceptContentDialog(message);
            ContentDialogResult result = await acceptDeleteOperationContentDialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                DeleteAccountWithOperations(account);
            }
        }