private void AddMembershipOptionBoxCommandExecuted() { string name = string.Empty; RaisePropertyChanged("DisableParentWindow"); RadWindow.Prompt(new DialogParameters() { Header = "Add Option Box", Closed = (sender, args) => { name = args.PromptResult; } }); RaisePropertyChanged("EnableParentWindow"); if (!string.IsNullOrWhiteSpace(name)) { var membershipOptionBox = new MembershipOptionBox() { ID = Guid.NewGuid(), Name = name }; _adminDataUnit.MembershipOptionBoxesRepository.Add(membershipOptionBox); _adminDataUnit.SaveChanges(); MembershipOptionBoxes.Add(membershipOptionBox); TreeViewItemPath = "Members|Option Boxes"; RaisePropertyChanged("SelectTreeViewItem"); SelectedTreeViewObject = membershipOptionBox; } }
private void RbtnEliminar_Click(object sender, RoutedEventArgs e) { EquiposModel model = new EquiposModel(); DialogParameters parameters = new DialogParameters(); parameters.Content = "Observaciones de la baja:"; parameters.Header = "Atención:"; parameters.Closed = this.OnClosed; parameters.Owner = this; RadWindow.Prompt(parameters); if (ChkOtros.IsChecked == true) { model.BajaEquipo(equipos, observacionesDelete); ServidoresSingleton.RemoveEquipoUsuario(equipo.Expediente, equipos); } else { ObservableCollection <Equipos> lEquipos = new ObservableCollection <Equipos>() { equipos[currentIndex] }; model.BajaEquipo(lEquipos, observacionesDelete); ServidoresSingleton.RemoveEquipoUsuario(equipos[currentIndex].Expediente, lEquipos); } this.Close(); }
private void RbtnAgregar_Click_1(object sender, RoutedEventArgs e) { DialogParameters parameters = new DialogParameters(); parameters.Content = "Ingresa la nueva descripcion"; parameters.Closed = this.OnAddClosed; parameters.Header = "Agregar"; parameters.Owner = this; RadWindow.Prompt(parameters); }
/// <summary> /// Add a resource /// </summary> private void AddResource() { var dialogparameters = new DialogParameters() { Content = "Resource name:" }; RadWindow.Prompt(dialogparameters, (sender, e) => { var result = e.PromptResult; }); }
public MainWindow() { InitializeComponent(); this.Icon = new BitmapImage(new Uri("pack://application:,,,/images/chat_wpf_46.png", UriKind.RelativeOrAbsolute)); RadWindow.Prompt(new DialogParameters { Content = "Enter an UserName:", Closed = new EventHandler <WindowClosedEventArgs>(OnPromptClosed) }); }
public void Input(string Message = "Enter your name:", EventHandler <WindowClosedEventArgs> closed = null) { //StyleManager.SetTheme(this,App.Theme); RadWindow.Prompt(new DialogParameters() { Theme = App.Theme, Content = Message, Closed = closed, OkButtonContent = "Ok", CancelButtonContent = "Cancel", Owner = MainWindow.Me }); }
public void ShowPrompt(string content, string defaultPromptResult, Action <bool, string> onPrompted) { this._onPromptClosed = onPrompted; RadWindow.Prompt(new DialogParameters() { Content = FormatContent(content), Closed = OnPromptClosed, DialogStartupLocation = WindowStartupLocation.CenterOwner, Header = UiResources.Prompt, OkButtonContent = UiResources.Ok, CancelButtonContent = UiResources.Cancel, Owner = WpfHelper.GetActiveWindow(), DefaultPromptResultValue = defaultPromptResult }); }
public void GetValueFromUser(string header, string text, string currentValue, Action <string, string> callback) { _valueCallback = callback; _valueCallbackShort = null; _currentValue = currentValue; RadWindow.Prompt(new DialogParameters { Header = header, Content = text, Closed = new EventHandler <WindowClosedEventArgs>(OnPromptClosed), Owner = Application.Current.MainWindow, DefaultPromptResultValue = currentValue }); }
public MainWindow() { InitializeComponent(); //TODO: Replace this with login logic later on RadWindow.Prompt(new DialogParameters { Content = "Enter a User Name:", Closed = new EventHandler <WindowClosedEventArgs>(OnPromptClosed) }); ViewModel = new ChatViewModel(CurrentUser); Window buddylist = new OnlineUsersWindow(CurrentUser); buddylist.Activate(); buddylist.Show(); }
public AppointmentDetailView(AppointmentDetailViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; this.WhenActivated(d => { this.OneWayBind(ViewModel, x => x.Dvo.Name, x => x.NameTextBlock.Text) .DisposeWith(d); this.BindCommand(ViewModel, x => x.RenameCommand, x => x.EditNameButton) .DisposeWith(d); this.ViewModel .RenameInteraction .RegisterHandler(inter => { RadWindow.Prompt(new DialogParameters { Header = "Cambio de nombre", Content = "Nuevo nombre:", DefaultPromptResultValue = inter.Input, Closed = new EventHandler <WindowClosedEventArgs>((s, e) => { if (e.DialogResult ?? false) { inter.SetOutput(e.PromptResult); } else { inter.SetOutput(null); } }), DialogStartupLocation = WindowStartupLocation.CenterOwner, Owner = System.Windows.Application.Current.MainWindow }); }); }); }
private void RbtnActualizar_Click(object sender, RoutedEventArgs e) { if (RlstTipos.SelectedIndex == -1) { MessageBox.Show("Seleccione el tipo de equipo que desea actualizar"); return; } tipoSeleccionado = RlstTipos.SelectedItem as CommonProperties; DialogParameters parameters = new DialogParameters(); parameters.Content = "Ingresa la nueva descripcion"; parameters.Closed = this.OnUpdateClosed; parameters.Header = "Actualizar"; parameters.DefaultPromptResultValue = tipoSeleccionado.Descripcion; parameters.Owner = this; RadWindow.Prompt(parameters); }
public void EditUserPasswordCommandExecuted() { string password = string.Empty; RaisePropertyChanged("DisableParentWindow"); RadWindow.Prompt(new DialogParameters() { Content = "Enter New Password:"******"EnableParentWindow"); if (!string.IsNullOrWhiteSpace(password)) { SelectedUser.User.PasswordSalt = Guid.NewGuid().ToString("N"); SelectedUser.User.PasswordHash = _saltedHash.ComputeHash(password + SelectedUser.User.PasswordSalt); } //_adminDataUnit.SaveChanges(); SaveChangesCommand.RaiseCanExecuteChanged(); }
public static WindowClosedEventArgs ShowPromt(string promtText, string okButtonContent = "Да", string сancelButtonContent = "Нет", string header = "Подтвердите действие", bool confirm = false) { WindowClosedEventArgs result = null; logger.Debug($"ShowPromt: {promtText}"); System.Windows.Application.Current.Dispatcher.Invoke(() => { var dp = new DialogParameters { Content = promtText, Header = header, DialogStartupLocation = WindowStartupLocation.CenterScreen }; if (!((System.Windows.Application.Current.MainWindow == null) || (System.Windows.Application.Current.MainWindow.Visibility != System.Windows.Visibility.Visible))) { dp.Owner = System.Windows.Application.Current.MainWindow; } dp.Closed = new EventHandler <WindowClosedEventArgs>((s, e) => { result = e; logger.Debug($"ShowPromt result: {e.DialogResult}"); }); dp.OkButtonContent = okButtonContent; dp.CancelButtonContent = сancelButtonContent; if (confirm) { RadWindow.Confirm(dp); } else { RadWindow.Prompt(dp); } }); return(result); }
private void SetFee_Click(object sender, RoutedEventArgs e) { RadWindow.Prompt("Set new fee per case:", this.SetFeeComplete); }
public ToDoTaskListView(ToDoTaskListViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; this.WhenActivated(d => { this.OneWayBind(ViewModel, x => x.ToDoTasks, x => x.GridView.ItemsSource) .DisposeWith(d); this.Bind(ViewModel, x => x.SelectedToDoTask, x => x.GridView.SelectedItem) .DisposeWith(d); this.OneWayBind(ViewModel, x => x.AllToDoTasks, x => x.DataPager.Source) .DisposeWith(d); //this.OneWayBind(ViewModel, // x => x.PageRequest.Size, // x => x.DataPager.PageSize) //.DisposeWith(d); this.WhenAnyValue(x => x.DataPager.PageIndex) .Select(x => new PageRequest(x + 1, DataPager.PageSize)) .BindTo(this, x => x.ViewModel.PageRequest); //this.OneWayBind(ViewModel, // x => x.PageRequest.Page, // x => x.DataPager.PageIndex,null,) //.DisposeWith(d); // CREATE this.BindCommand( this.ViewModel, x => x.CreateToDoTaskCommand, x => x.AddButton) .DisposeWith(d); this.ViewModel .CreateInteraction .RegisterHandler(inter => { RadWindow.Prompt(new DialogParameters { Header = "Creación de tarea", Content = "Nombre:", Closed = new EventHandler <WindowClosedEventArgs>((s, e) => { if (e.DialogResult ?? false) { inter.SetOutput(e.PromptResult); } else { inter.SetOutput(null); } }), DialogStartupLocation = WindowStartupLocation.CenterOwner, Owner = System.Windows.Application.Current.MainWindow }); }); // EDIT this.BindCommand( this.ViewModel, x => x.EditToDoTaskCommand, x => x.EditButton, this.WhenAnyValue(x => x.GridView.SelectedItem)) .DisposeWith(d); this.BindCommand( this.ViewModel, x => x.EditToDoTaskCommand, x => x.GridView, this.WhenAnyValue(x => x.GridView.SelectedItem), nameof(GridView.MouseDoubleClick)) .DisposeWith(d); // DELETE this.BindCommand( this.ViewModel, x => x.DeleteToDoTaskCommand, x => x.DeleteButton, this.WhenAnyValue(x => x.GridView.SelectedItem)) .DisposeWith(d); // REFRESH this.BindCommand( this.ViewModel, x => x.RefreshCommand, x => x.RefreshButton) .DisposeWith(d); }); }
static void \u206C([In] DialogParameters obj0) { RadWindow.Prompt(obj0); }
public static void Prompt(DialogParameters dialogParameters) { RadWindow.Prompt(dialogParameters); }