public void Setup(IContentChanger contentChanger) { var topData = Data.Peek(); var content = Activator.CreateInstance(topData.ControlType) as UserControl; contentChanger.ChangeContent(content); topData.Setup(content?.DataContext); }
private void OnContextChanged(IContentChanger dataContextChanger) { if (CurrentContentChanger != null) { CurrentContentChanger.ContentChange -= DataContextChanger_DataContextChange; } CurrentContentChanger = dataContextChanger; if (CurrentContentChanger != null) { CurrentContentChanger.ContentChange += DataContextChanger_DataContextChange; } }
public SecondViewModel(IContentChanger contentChanger) { _contentChanger = contentChanger; }
public FirstViewModel(IContentChanger contentChanger) { _contentChanger = contentChanger; }