Problem Accessing Property from different class...
UI is not Updating [MVVM]
1. I am Trying to Access IsEnabled Property from Different Class. (MVVM)
public class FirstScreeenViewModel : INotifyPropertyChanged { TwoClassInteraction _sc = new TwoClassInteraction(); public FirstScreeenViewModel() { ControlEnabled = _sc.ControlEnabled; } private bool _controlEnabled; public bool ControlEnabled { get => _controlEnabled; set { _controlEnabled = value; Selectedhandbuger = false; OnPropertyChanged(nameof(ControlEnabled)); } } } public class TwoClassInteraction : Basepropertychangedevent { private bool _controlEnabledproperty; public bool ControlEnabled { get => _controlEnabledproperty; set { if (_controlEnabledproperty == value) return; _controlEnabledproperty = value; OnPropertyChanged("ControlEnabled"); } } } Now I am Accessing from Third Class public class ThirdClassInteraction : Basepropertychangedevent { public void Test() { var mm = new TwoClassInteraction(); mm.ControlEnabled = false; } }
But UI is Not Updating...... IsEnabled="{Binding ControlEnabled}"
My Requirement is Simple..
Change Property value from Multiple class and UI Should be Reflected