public UpsertPolicemanPage(PolicemenViewModel viewModel, string action) { InitializeComponent(); DataContext = viewModel; if (action == "Insert") { Edit.Visibility = Visibility.Hidden; } else { Register.Visibility = Visibility.Hidden; } }
public EditorWindow(string action, PolicemenViewModel policemen) { InitializeComponent(); Title = action == "Insert" ? "Въвеждане на служител" : "Редакция на служител"; EditorFrame.Navigate(new UpsertPolicemanPage(policemen, action)); }