Static classes are generally considered an anti pattern and have few and very specific uses cases (don't remember them of the top of my head).
In your example you don't need a static class so u shouldn't use it.
All you need to do is pass the instance of ChannelModel to the classes that use it.
So let say your ViewModel.cs need ChannelModel you do something liked this.
public class ViewModel
{
ChannelModel _channelModel ;
public ViewModel (ChannelModel channelModel)
{
_channelModel = channelModel;
}
}
You should look into Dependency Injection and Inversion of Control since is pretty much a standard now.
Dependency Injection (DI) vs. Inversion of Control (IOC)
2
20 Jun 2018 23:37
u/grim89
in v/programming
Static classes are generally considered an anti pattern and have few and very specific uses cases (don't remember them of the top of my head). In your example you don't need a static class so u shouldn't use it. All you need to do is pass the instance of ChannelModel to the classes that use it. So let say your ViewModel.cs need ChannelModel you do something liked this.
You should look into Dependency Injection and Inversion of Control since is pretty much a standard now.
Dependency Injection (DI) vs. Inversion of Control (IOC)