Closed ManuelKetisch closed 1 year ago
Never mind... my bad... I was not initializing the Collection, so there was no collection to store the descriptor. Also i wrote Devices = null ... because Devices.Add(null) from the orginal code did result in an error... Even if i would have initialized the collection... it would have returned to null.
Sorry for posting the question in the first place without thoroughly inspecting my code.
No problem and thanks reached out FlashCap!
Hello,
i am having a little trouble using FlashCap with Avalonia 11 and the MVVM Community Toolkit.
I mostly used the Avalonia code sample to get FlashCap up and running, but ran into a problem.
The original sample code looks like this: ` public Command? Opened { get; } public SKBitmap? Image { get; private set; } public bool IsEnbaled { get; private set; }
`
The code i am currently using looks like this: ` private long frameCount; private ImageCaptureWindow? _currentWindow; private CaptureDevice? _captureDevice;
`
My particular problem is that...
Devices?.Add(descriptor);
...does not add the descriptor to...[ObservableProperty] [NotifyPropertyChangedFor(nameof(Device))] private ObservableCollection<CaptureDeviceDescriptor>? _devices;
The descriptor is NOT null, but it is not being added to the collection.
To me it is not obvious why that is the case. Does anyone have any tips what is causing this?
Just in case someone does not know, MVVM Community Toolkit is a similar MVVM framework than Epoxy. It auto-generates the public property 'Devices' from the private observable property '_devices'.
Any help would be appreciated.