Пример #1
0
        public async Task OpenAsync()
        {
            var dialog = new OpenPathViewModel();

            this.configs.Update(dialog);
            if (await dialog.ShowDialogAsync() == true)
            {
                if (this.dataSet != null)
                {
                    await this.CloseDocumentsAsync(true);

                    this.dataSet  = null;
                    this.IsLoaded = false;
                    this.OnUnloaded(EventArgs.Empty);
                }

                await this.OpenAsync(dialog.Path1, dialog.Path2, dialog.FilterExpression);

                this.configs.Commit(dialog);
            }
        }
Пример #2
0
        protected override async void OnDrop(DragEventArgs e)
        {
            base.OnDrop(e);

            if (e.Data.GetDataPresent(DataFormats.FileDrop) == true)
            {
                var items = e.Data.GetData(DataFormats.FileDrop) as string[];
                if (items.Length == 2)
                {
                    var dialog = new OpenPathViewModel()
                    {
                        Path1 = items[0],
                        Path2 = items[1],
                    };
                    if (await dialog.ShowDialogAsync() == true)
                    {
                        await this.shell.OpenAsync(dialog.Path1, dialog.Path2, dialog.FilterExpression);
                    }
                }
            }
        }