Hello. I want to design the correct application architecture by following MVVM. I need to simulate a video camera. I have identified two main classes: ΠΠΈΠ΄Π΅ΠΎΠΊΠ°ΠΌΠ΅ΡΠ° and Π’Π΅Π»Π΅Π²ΠΈΠ·ΠΎΡ . the first one will record video, and the second will stream recorded videos.
Model
class VideoCamera { public Video video {get; set;} public void Record(){...} //Π·Π°ΠΏΠΈΡΡ Π²ΠΈΠ΄Π΅ΠΎ } class TV { public Video video {get;set;} public void Play(){...} //ΠΏΡΠΎΠΈΠ³ΡΡΠ²Π°Π½ΠΈΠ΅ Π²ΠΈΠ΄Π΅ΠΎ } It is clear that the Record() method should run in the background stream, I want to use BackgroundWorker for this and transfer once every 1 second a portion of the recorded video to the TV class. But the Rerort () method in BW, as I understand it, does not stop the background thread, it does not wait for the event handler it generates to complete. That is, it turns out I need to transfer a copy of the Video from the ΠΊΠ°ΠΌΠ΅ΡΡ to tv .
How to design VM these classes to achieve these goals?