MyForm_Model


Creating the Model

Create a new folder in your project called MyForm
Add a class called "MyForm_Model" to the folder MyForm.
Add an Interface above the class.

public interface IMyForm_Model 
{
   bool Method_Initialize();
}

Replace the Constructor with the following declaration.
The INotifyPropertyChanged interface has a single event called PropertyChanged.
Classes that implement this interface can raise the PropertyChanged event when one of the object properties change.

public class MyForm_Model : 
   IMyForm_Model,
   System.ComponentModel.INotifyPropertyChanged
{
   //-----------------------------------------------------------------------
   //cannot be renamed, it is part of the INotifyPropertyChanged interface
   public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
   
   //-----------------------------------------------------------------------
   public bool Method_Initialize()
   {
          return true;
   }
   //-----------------------------------------------------------------------
   private void Method_PropertyChanged(string info)
   {
      PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(info));
   }
}

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext