private bool OpenMarkCreateRecordWindow(СreateEditMarkViewModel createEditViewModel) { if (createEditViewModel == null) { return(false); } var window = new CreateEditMark { DataContext = createEditViewModel }; return(window.ShowDialog() ?? false); }
private void Window_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { СreateEditMarkViewModel viewModel = this.DataContext as СreateEditMarkViewModel; if (viewModel == null) { return; } if (viewModel.Entity.MarkId == 0) { this.Title = "Create mark"; } else { this.Title = "Edit mark"; } }