views:

33

answers:

0

So I currently have a a class like this in my ViewModel:

namespace ViewModel
{
  public sealed class MyClass
  {
     public static bool IsInMode
     {
       get;
       private set;
     }

  }
}

The way our assemblies are setup is that the view can access the viewmodel, and the model, but the viewmodel can only access the model, and the model can only access itself.

I need access to this IsInMode property from the model. I know the IsInMode property will be initialized at app startup and should never change after that. My thought so far is to create another class in the Model layer which has a get; private set; on the IsInMode variable, and create an instance of that object in MyClass in the View Model Layer, and then when the program gets the IsInMode property in the viewmodel, it returns the state of this Model object.

Is this the best way to go about solving this problem?

The problem is that I want to avoid having any other class change the state of this mode while maintaining access in the model layer and above. I'd also like to maintain access to the property off of the ViewModel class.