feat: SectionPanel

This commit is contained in:
2026-02-09 15:23:43 +03:00
parent 6179567170
commit b638d4e752
3 changed files with 114 additions and 9 deletions
+7 -2
View File
@@ -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));
}