I'm creating a customer care program using WPF MVVM pattern I created a registration window and a customer information window I want to bring the value of the data grid of the customer information window to the text box of the creation window
This is information ViewModel
public class MainViewModel : ObservableObject
{
private MemberInfo selectedCustomer = new MemberInfo();
public MemberInfo SelectedCustomer
{
get => selectedCustomer;
set
{
SetProperty(ref selectedCustomer, value);
RegisterViewModel RV = new RegisterViewModel();
if (value != null)
{
RV.Name = selectedCustomer.Name;
}
}
}
}
This is Creat ViewModel
public class RegisterViewModel : ObservableObject
{
private string name = "";
public string Name
{
get => this.name;
set => SetProperty(ref this.name, value);
}
}
If I use it like this, the value goes over only set, and there is no value to execute the get