Hi All,
I'm currently working on a WPF application utilizing MVVM pattern where my ViewModels contain the view logic for their respective view. I've come to a point, however; where I'm confused on what is considered best practice. In my case, I have a client class (Socket Client) which is accessed from various views and I'm not sure the best practice for locating references to this class. Currently I shoved it in the App.cs to make it accessible across all views/viewmodels, however; this seems akin to making it global and doesn't site well with me. So my first question is what is the best practice when sharing a client class across multiple Views (Pages/UserControls) and should my ViewModels be accessing that class for sending and receiving information?
Thanks in advance,
AimTron
I'm currently working on a WPF application utilizing MVVM pattern where my ViewModels contain the view logic for their respective view. I've come to a point, however; where I'm confused on what is considered best practice. In my case, I have a client class (Socket Client) which is accessed from various views and I'm not sure the best practice for locating references to this class. Currently I shoved it in the App.cs to make it accessible across all views/viewmodels, however; this seems akin to making it global and doesn't site well with me. So my first question is what is the best practice when sharing a client class across multiple Views (Pages/UserControls) and should my ViewModels be accessing that class for sending and receiving information?
Thanks in advance,
AimTron