private void BtnMenuItem_OnClick(object sender, RoutedEventArgs e) { var editGeneralMenuSettingsViewModel = new GeneralMenuSettingsViewModel(GetMenuItemButton(sender, e)); editGeneralMenuSettingsViewModel.MenuItemUpdated += async(_, __) => await MainWindowViewModel?.Reset(); var editGeneralMenuSettingsView = new GeneralMenuSettingsView(GetMenuItemButton(sender, e)) { DataContext = editGeneralMenuSettingsViewModel }; Main.Content = editGeneralMenuSettingsView; }
public GeneralMenuSettingsView(MenuItemEntityModel menuItemEntityModel) { InitializeComponent(); DataContextChanged += Reset; DataContext = new GeneralMenuSettingsViewModel(menuItemEntityModel); }