예제 #1
0
        public RegionSelector(IVideoSourcePicker VideoSourcePicker)
        {
            _videoSourcePicker = VideoSourcePicker;

            InitializeComponent();

            _regionItem = new RegionItem(this);

            // Prevent Closing by User
            Closing += (S, E) => E.Cancel = true;

            InitDimensionBoxes();

            // Setting MainViewModel as DataContext from XAML causes crash.
            Loaded += (S, E) => MainControls.DataContext = ServiceProvider.Get <MainViewModel>();

            ModesBox.ItemsSource = new[]
            {
                new KeyValuePair <InkCanvasEditingMode, string>(InkCanvasEditingMode.None, "Pointer"),
                new KeyValuePair <InkCanvasEditingMode, string>(InkCanvasEditingMode.Ink, "Pencil"),
                new KeyValuePair <InkCanvasEditingMode, string>(InkCanvasEditingMode.EraseByPoint, "Eraser"),
                new KeyValuePair <InkCanvasEditingMode, string>(InkCanvasEditingMode.EraseByStroke, "Stroke Eraser")
            };

            ModesBox.SelectedIndex    = 0;
            ColorPicker.SelectedColor = Color.FromRgb(27, 27, 27);
            SizeBox.Value             = 10;

            InkCanvas.DefaultDrawingAttributes.FitToCurve = true;
        }
예제 #2
0
        public RegionSelectorProvider(RegionSelectorViewModel ViewModel,
                                      IPlatformServices PlatformServices)
        {
            _viewModel = ViewModel;

            _regionSelector = new Lazy <RegionSelector>(() => new RegionSelector(ViewModel));

            _regionItem = new RegionItem(this, PlatformServices);
        }
예제 #3
0
        public RegionSelector()
        {
            InitializeComponent();

            VideoSource = new RegionItem(this);

            // Prevent Closing by User
            Closing += (s, e) => e.Cancel = true;

            InitDimensionBoxes();
        }
예제 #4
0
        public RegionSelector(Settings Settings)
        {
            _settings = Settings;

            InitializeComponent();

            VideoSource = new RegionItem(this);

            // Prevent Closing by User
            Closing += (S, E) => E.Cancel = true;

            InitDimensionBoxes();
        }
예제 #5
0
        public RegionSelectorProvider(IVideoSourcePicker VideoSourcePicker)
        {
            _regionSelector = new Lazy <RegionSelector>(() =>
            {
                var reg = new RegionSelector(VideoSourcePicker);

                reg.SelectorHidden   += () => SelectorHidden?.Invoke();
                reg.UpdateRegionName += M => _regionItem.Name = M;

                return(reg);
            });

            _regionItem = new RegionItem(this);
        }
예제 #6
0
        public RegionSelectorProvider(IVideoSourcePicker VideoSourcePicker, RegionSelectorViewModel ViewModel)
        {
            _viewModel = ViewModel;

            _regionSelector = new Lazy <RegionSelector>(() =>
            {
                var reg = new RegionSelector(VideoSourcePicker, ViewModel);

                reg.SelectorHidden += () => SelectorHidden?.Invoke();

                return(reg);
            });

            _regionItem = new RegionItem(this);
        }
예제 #7
0
        public RegionSelectorProvider(RegionSelectorViewModel ViewModel,
                                      IPlatformServices PlatformServices)
        {
            _viewModel = ViewModel;

            _regionSelector = new Lazy <RegionSelector>(() =>
            {
                var reg = new RegionSelector(ViewModel);

                reg.SelectorHidden += () => SelectorHidden?.Invoke();

                return(reg);
            });

            _regionItem = new RegionItem(this, PlatformServices);
        }
예제 #8
0
        public RegionSelector()
        {
            InitializeComponent();

            VideoSource = new RegionItem(this);

            // Prevent being Maximized
            StateChanged += (s, e) =>
            {
                if (WindowState == WindowState.Maximized)
                {
                    WindowState = WindowState.Normal;
                }
            };

            // Prevent Closing by User
            Closing += (s, e) => e.Cancel = true;
        }