protected override async Task ExecuteCoreAsync()
        {
            if (NodeContainer == null)
            {
                await InformRequestCannotBeProcessedAsync();

                return;
            }
            var kindNames  = GetKinds().Select(kind => ItemKindNames[kind]).ToArray();
            var chosenName = await QueryUserForItemKind(kindNames);

            if (!ItemKinds.ContainsKey(chosenName))
            {
                return;
            }
            var chosenKind = ItemKinds[chosenName];
            var item       = CreateItem(chosenKind);

            if (item == null)
            {
                return;
            }
            if (OpenConditionItemCommand.CanExecute(item))
            {
                OpenConditionItemCommand.Execute(item);
                return;
            }
            await
            DialogService.ShowDialogAsync("Cannot navigate", "There was an error and the item could not be opened.",
                                          "cancel");
        }
예제 #2
0
        protected override async Task ExecuteCoreAsync()
        {
            if (CreateItemAsync == null || GetConfiguredKindsFunc == null)
            {
                await InformRequestCannotBeProcessedAsync();

                return;
            }
            var configuredKinds     = GetConfiguredKindsFunc();
            var configuredKindNames = configuredKinds.Select(kind => ItemKindNames[kind]).ToArray();
            var chosenKindName      = await QueryUserForItemKind(configuredKindNames);

            if (!ItemKinds.ContainsKey(chosenKindName))
            {
                return;
            }
            var chosenKind = ItemKinds[chosenKindName];
            var item       = await CreateItemAsync(chosenKind);

            if (item == null)
            {
                return;
            }
            ConfigureItemName(item, chosenKindName);
            if (OpenCatalogueItemCommand.CanExecute(item))
            {
                OpenCatalogueItemCommand.Execute(item);
                return;
            }
            await
            DialogService.ShowDialogAsync("Cannot navigate", "There was an error and the item could not be opened.",
                                          "cancel");
        }