예제 #1
0
        public async void Open()
        {
            var dialog = new OpenPathViewModel();

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

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

                this.Open(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);
                    }
                }
            }
        }