Hi all I am struggling with the process of sending data between view models in Catel MVVM model. I have a button which on click I want to open a new window and send some data (object) to the newly opened window. However I am unable to solve this by myself so can you help me out?
In my first View Model I have:
private readonly IShowStopInfo stopInfo;
//Main constructor of the class
public StopViewModel(IGrtrService grtrService, IShowStopInfo stopInfo)
{
this.stopInfo = stopInfo;
Argument.IsNotNull(() => grtrService);
_grtrService = grtrService;
AllStops = _grtrService.LoadStop();
Stop_Line = _grtrService.LoadLines();
ShowSelectedValue = new Command(OnStopsInfo);
}
public Command ShowSelectedValue { get; private set; }
private void OnStopsInfo()
{
stopInfo.ShowStopInfo();
}
//Getting Selected Stop from the list
public Stop SelectedStop
{
get { return GetValue<Stop>(SelectedStopProperty); }
set { SetValue(SelectedStopProperty, value); }
}
public static readonly PropertyData SelectedStopProperty = RegisterProperty("SelectedStop", typeof(Stop));
In my case I want to send the result from the method "SelectedStop" how can I do that?