forked from amkovkov/GranuSightSoftware2
feat: SectionPanel
This commit is contained in:
@@ -13,7 +13,10 @@ public partial class MainViewModel : ViewModelBase
|
||||
[ObservableProperty] private CameraViewModel _cameraViewModel;
|
||||
[ObservableProperty] private ResourcesViewModel _resourcesViewModel;
|
||||
[ObservableProperty] private OpenCvSharp.Mat? _image;
|
||||
[ObservableProperty] private IRelayCommand _buttonClick;
|
||||
[ObservableProperty] private IRelayCommand _buttonCaptureClick;
|
||||
[ObservableProperty] private IRelayCommand _buttonUpClick;
|
||||
[ObservableProperty] private IRelayCommand _buttonDownClick;
|
||||
[ObservableProperty] private int _currentIndex;
|
||||
|
||||
public MainViewModel(ILogger<MainViewModel> logger, CameraViewModel cameraViewModel, ResourcesViewModel resourcesViewModel, CameraService cameraService)
|
||||
{
|
||||
@@ -21,10 +24,12 @@ public partial class MainViewModel : ViewModelBase
|
||||
_cameraService = cameraService;
|
||||
CameraViewModel = cameraViewModel;
|
||||
ResourcesViewModel = resourcesViewModel;
|
||||
ButtonClick = new RelayCommand(() =>
|
||||
ButtonCaptureClick = new RelayCommand(() =>
|
||||
{
|
||||
Task.Run(() => cameraService.CaptureImage(CancellationToken.None, 10).ContinueWith(image => Image = image.Result));
|
||||
});
|
||||
ButtonUpClick = new RelayCommand(() => CurrentIndex--);
|
||||
ButtonDownClick = new RelayCommand(() => CurrentIndex++);
|
||||
|
||||
_logger.LogInformation("{} initialized", nameof(MainViewModel));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user