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; }
public RegionSelectorProvider(RegionSelectorViewModel ViewModel, IPlatformServices PlatformServices) { _viewModel = ViewModel; _regionSelector = new Lazy <RegionSelector>(() => new RegionSelector(ViewModel)); _regionItem = new RegionItem(this, PlatformServices); }
public RegionSelector() { InitializeComponent(); VideoSource = new RegionItem(this); // Prevent Closing by User Closing += (s, e) => e.Cancel = true; InitDimensionBoxes(); }
public RegionSelector(Settings Settings) { _settings = Settings; InitializeComponent(); VideoSource = new RegionItem(this); // Prevent Closing by User Closing += (S, E) => E.Cancel = true; InitDimensionBoxes(); }
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); }
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); }
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); }
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; }