internal MainStatusBar() { InitializeComponent(); if (DesignerProperties.GetIsInDesignMode(this)) { DataContext = new MainStatusBarDesignModel(); } else { var mainWindow = (MainWindow)Application.Current.MainWindow; mainWindow.InitStatusBarViewModel(); DataContext = mainWindow.StatusBarModel; } }
public void InitStatusBarViewModel() { if (StatusBarModel != null) { return; } if (DesignerProperties.GetIsInDesignMode(this)) { StatusBarModel = new MainStatusBarDesignModel(); } else { StatusBarModel = new MainStatusBarViewModel(); } }