Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Add a resource
        /// </summary>
        private void AddResource()
        {
            var dialogparameters = new DialogParameters()
            {
                Content = "Resource name:"
            };

            RadWindow.Prompt(dialogparameters, (sender, e) =>
            {
                var result = e.PromptResult;
            });
        }
Exemplo n.º 5
0
        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)
            });
        }
Exemplo n.º 6
0
 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
     });
 }
Exemplo n.º 7
0
 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
     });
 }
Exemplo n.º 8
0
        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
            });
        }
Exemplo n.º 9
0
        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();
        }
Exemplo n.º 10
0
        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
                    });
                });
            });
        }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
        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();
        }
Exemplo n.º 13
0
        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);
        }
Exemplo n.º 14
0
 private void SetFee_Click(object sender, RoutedEventArgs e)
 {
     RadWindow.Prompt("Set new fee per case:", this.SetFeeComplete);
 }
Exemplo n.º 15
0
        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);
            });
        }
Exemplo n.º 16
0
 static void \u206C‍‮‬​‬‪‎‮‏‬‍‫‮​​‬‌‌‬​‭‬‌‮([In] DialogParameters obj0)
 {
     RadWindow.Prompt(obj0);
 }
Exemplo n.º 17
0
 public static void Prompt(DialogParameters dialogParameters)
 {
     RadWindow.Prompt(dialogParameters);
 }