private async Task OnAdd(object obj)
        {
            var dialog = PartDialogsFactory.CreateSelectPartDialog(PartConnector);
            await DialogManager.ShowDialogAsync(dialog);

            if (!dialog.Result)
            {
                PartDialogsFactory.Destroy(dialog);
                return;
            }

            var newLink = AddPartLink(PartConnector, dialog.PartLink);

            newLink.BeginEdit();

            _newLinks.Add(newLink);
            SelectedPartLink = newLink;

            PartDialogsFactory.Destroy(dialog);
        }
Exemple #2
0
        private async Task ChangeLink(object obj)
        {
            var dialog = PartDialogsFactory.CreateSelectPartDialog(PartConnector);
            await DialogManager.ShowDialogAsync(dialog);

            if (!dialog.Result)
            {
                PartDialogsFactory.Destroy(dialog);
                return;
            }

            var partLink = PartConnector.CreatePartLink(dialog.SelectedProduct);

            if (!PartConnector.IsCollection)
            {
                PartConnector.PartLinks.Clear();
            }

            PartConnector.PartLinks.Add(partLink);
            PartLink = partLink;
        }