winforms - C# Form - Property Change -
I have a form that has a property
named car
A class with many properties.
The Properties is being displayed on the current car on the basis of some user actions that are being displayed.
So I have to know whether the property has been allocated or set to zero.
I'm aware of INotifyPropertyChanged
, but in my case I'm not sure that since this change I have changed my car
properties < Code> car do not want to monitor the property.
Any idea how to accomplish this?
In advance thank you
If you have created a true asset in your class then You should be a great and setter, you can add the code directly to the form property in order to take action on the basis of "form":
Public partial category Form 1: form {public form 1 () {InitializeComponent (); } // define car square public class car {public string name = string. Empty; } // private car to keep the value of the current car private variable _car = null; // Property of public form which you can run code when either meets or set is called a public car car {get {return _car; } Set {_car = value; If (_car == faucet) MessageBox.Show (this, "code to run here to run the car", "car is set to empty"); Other messageboxes Show (this is "run the code here: the name of the car is:" "+ _car.Name +" '', 'the car is set to a value');}} private zeros some functions () {car MyCar = new car ICar = MyCar;}}
Comments
Post a Comment