예제 #1
0
        protected override void ShowDialog()
        {
            var viewModel = ActivityArgs.GetArgs <DataItemChooserViewModel <T> >();
            var window    = new ViewControllerWindow
            {
                DataContext = viewModel,
                Content     = new DataItemChooserView {
                    Width = 300, Margin = new Thickness(10, 5, 10, 10)
                },
                Title = viewModel.Header,
            }.RemoveIcon().HideMinMaxButton();
            var r      = window.ShowDialog();
            var result = new AsyncActivityResult <DataItemChooserViewModel <T> >(r.GetValueOrDefault(false), viewModel);

            Completion.TrySetResult(result);
        }
예제 #2
0
        protected override void ShowDialog()
        {
            var viewModel = ActivityArgs.GetArgs <InputBoxViewModel>() ?? new InputBoxViewModel();
            var window    = new ViewControllerWindow
            {
                DataContext = viewModel,
                Content     = new InputBox {
                    Width = 300, Margin = new Thickness(10, 5, 10, 10)
                },
                Title         = viewModel.Header,
                SizeToContent = SizeToContent.WidthAndHeight,
                ResizeMode    = ResizeMode.NoResize,
            }.RemoveIcon().HideMinMaxButton();
            var r      = window.ShowDialog();
            var result = new AsyncActivityResult <InputBoxViewModel>(r.GetValueOrDefault(false), viewModel);

            Completion.TrySetResult(result);
        }
예제 #3
0
        private Window PrepareProgressView()
        {
            var options = ActivityArgs.GetArgs <ProgressViewOptions>();

            var window = new ViewControllerWindow
            {
                SizeToContent = SizeToContent.Height,
                DataContext   = new ProgressViewModel(),
                ResizeMode    = ResizeMode.CanMinimize,
                Content       = new ProgressView {
                    Margin = new Thickness(5)
                },
                Title         = options != null ? options.Header : "Copy",
                ShowInTaskbar = true,
                Topmost       = true,
                Width         = 500,
            }.RemoveIcon();

            return(window);
        }
예제 #4
0
        protected override void ShowDialog()
        {
            var saveFileDialog = new SaveFileDialog();
            var options        = ActivityArgs.GetArgs <SaveFileOptions>();

            if (options != null)
            {
                saveFileDialog.AddExtension     = options.AddExtension;
                saveFileDialog.InitialDirectory = options.InitialDirectory;
                saveFileDialog.DefaultExt       = options.DefaultExt;
                saveFileDialog.Filter           = options.Filter;
                saveFileDialog.FileName         = options.FileName;
            }

            if (saveFileDialog.ShowDialog() == true)
            {
                Completion.TrySetResult(saveFileDialog.FileName);
            }
            else
            {
                Completion.TrySetResult(null);
            }
        }
예제 #5
0
        protected override void ShowDialog()
        {
            var viewModel = ActivityArgs.GetArgs <IProgressItemViewModel <T> >();

            StartDialog(viewModel);
        }