D
D
Drottarutarnum2019-03-07 17:01:40
C++ / C#
Drottarutarnum, 2019-03-07 17:01:40

Where to place a global class in MVVM?

I have a class in Model for working with USB HID, but there is only one USB device and an instance of the class is created only once and then connected to the device
Where should I put it if I have several windows? I cannot initialize this class in each ViewModel
i.e. I need one global property and catch updates from it in all windows? If so, where should I create this property and how to bind to windows?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Zolotov, 2019-03-07
@Drottarutarnum

Read about DI containers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question