private void MostraVerDialog(object parameter)
        {
            IModalDialog dialog = ServiceProvider.Instance1.Get <IModalDialog>();

            dialog.BindViewModel(this);
            dialog.ShowDialog();
        }
Example #2
0
        public bool GenerateNew()
        {
            try
            {
                string   appPath    = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
                Assembly uiAssembly = Assembly.LoadFrom(appPath + @"\gView.Interoperability.OGC.UI.dll");

                IModalDialog dlg = uiAssembly.CreateInstance("gView.Interoperability.OGC.UI.Dataset.WMS.FormNewConnection") as IModalDialog;
                if (dlg is IConnectionString)
                {
                    if (dlg.OpenModal())
                    {
                        string connectionString = ((IConnectionString)dlg).ConnectionString;

                        _dataset = new WMSDataset();
                        _dataset.ConnectionString = connectionString;
                        return(true);
                    }
                }
            }
            catch
            {
            }
            return(false);
        }
Example #3
0
        public CalendarViewModel(IModalDialog modalDialog, Func <Task <CancelReason> > cancelReasonSelector, INavigationService navigationService, ICalendarDataProvider dataProvider, Func <string, string, string> localizationManager, DataCache dataCache)
        {
            if (modalDialog == null)
            {
                throw new ArgumentNullException(nameof(modalDialog));
            }
            if (cancelReasonSelector == null)
            {
                throw new ArgumentNullException(nameof(cancelReasonSelector));
            }


            this.ModalDialog          = modalDialog;
            this.CancelReasonSelector = cancelReasonSelector;
            this.NavigationService    = navigationService;
            this.DataProvider         = dataProvider;
            this.LocalizationManager  = localizationManager;
            this.DataCache            = dataCache;
            this.CloseDaysCommand     = new ActionCommand(this.CloseSelectedDays);
            this.CancelDaysCommand    = new ActionCommand(this.CancelSelectedDays);
            this.CurrentMonth         = DateTime.Today;
            this.NextDayCommand       = new ActionCommand(() =>
            {
                this.Load(this.CurrentMonth.AddMonths(1));
            });
            this.PreviousDayCommand = new ActionCommand(() =>
            {
                this.Load(this.CurrentMonth.AddMonths(-1));
            });
        }
        public async Task <T> AwaitModalAsync <T>(IModalDialog <T> dialog, CancellationToken cancellationToken)
        {
            var  confirmTask        = dialog.ConfirmAsync(cancellationToken);
            bool addDialogCancelled = true;

            try
            {
                await AddDialogAsync(dialog, cancellationToken);

                addDialogCancelled = false;

                NotifyOfPropertyChange(() => AnyOpenDialogs);

                await confirmTask;
            }
            finally
            {
                if (!addDialogCancelled)
                {
                    await RemoveDialogAsync(dialog, CancellationToken.None);
                }

                NotifyOfPropertyChange(() => AnyOpenDialogs);
            }

            return(await confirmTask);
        }
        public NewOrOpenSessionTemplateCollectionViewModel(IViewModelServiceProvider serviceProvider, IModalDialog dialog)
            : base(serviceProvider)
        {
            this.dialog = dialog;
            rootGroup   = new TemplateDescriptionGroupViewModel(serviceProvider, "New project");

            // Add a default General group
            var defaultGroup = new TemplateDescriptionGroupViewModel(rootGroup, "General");

            foreach (TemplateDescription template in TemplateManager.FindTemplates(TemplateScope.Session))
            {
                var viewModel = new PackageTemplateViewModel(serviceProvider, template);
                var group     = ProcessGroup(rootGroup, template.Group) ?? defaultGroup;
                group.Templates.Add(viewModel);
            }

            recentGroup = new TemplateDescriptionGroupViewModel(serviceProvider, "Recent projects");
            var mru = EditorViewModel.Instance.MRU;

            foreach (var file in mru.MostRecentlyUsedFiles)
            {
                var viewModel = new ExistingProjectViewModel(ServiceProvider, file.FilePath);
                recentGroup.Templates.Add(viewModel);
            }

            Location = InternalSettings.TemplatesWindowDialogLastNewSessionTemplateDirectory.GetValue();
            if (string.IsNullOrWhiteSpace(Location))
            {
                Location = UPath.Combine <UDirectory>(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Xenko Projects");
            }

            BrowseForExistingProjectCommand = new AnonymousTaskCommand(serviceProvider, BrowseForExistingProject);
            SelectedGroup = rootGroup;
        }
Example #6
0
        private void AccionAsignacion(object parameter)
        {
            AsociarPacienteFisioterapeutaViewModel asociacionVM = new AsociarPacienteFisioterapeutaViewModel();

            if (iFisioAsigPaciente == 0) // crear asignacion
            {
                asociacionVM.Mode             = Mode.Add;
                asociacionVM.strTipoAction    = "Asignar";
                asociacionVM.strNombreVentana = "Asignar fisioterapeuta(s)";

                asociacionVM.SelectedKeyUno = new KeyValuePair <int, string>(-1, "-");
                asociacionVM.SelectedKeyDos = new KeyValuePair <int, string>(-1, "-");
            }
            else //actulializar asignacion
            {
                asociacionVM.Mode             = Mode.Edit;
                asociacionVM.strTipoAction    = "Asignar";
                asociacionVM.strNombreVentana = "Actualizar Asignación";

                string strNombreCompletoFisioterapueta01;
                string strNombreCompletoFisioterapueta02;

                if (strFisioAsignadoUno != null && strFisioAsignadoUno != "")
                {
                    strNombreCompletoFisioterapueta01 = PacienteDL.ObtenerNombresCompletosFisioterapeutasAsignado(Convert.ToInt32(strFisioAsignadoUno));
                    if (strNombreCompletoFisioterapueta01.Equals(""))
                    {
                        asociacionVM.SelectedKeyUno = new KeyValuePair <int, string>(-1, "-");
                    }
                    asociacionVM.SelectedKeyUno = new KeyValuePair <int, string>(Convert.ToInt32(strFisioAsignadoUno), strNombreCompletoFisioterapueta01);
                }
                else
                {
                    asociacionVM.SelectedKeyUno = new KeyValuePair <int, string>(-1, "-");
                }


                if (strFisioAsignadoDos != null && strFisioAsignadoDos != "")
                {
                    strNombreCompletoFisioterapueta02 = PacienteDL.ObtenerNombresCompletosFisioterapeutasAsignado(Convert.ToInt32(strFisioAsignadoDos));
                    if (strNombreCompletoFisioterapueta02.Equals(""))
                    {
                        asociacionVM.SelectedKeyDos = new KeyValuePair <int, string>(-1, "-");
                    }
                    asociacionVM.SelectedKeyDos = new KeyValuePair <int, string>(Convert.ToInt32(strFisioAsignadoDos), strNombreCompletoFisioterapueta02);
                }
                else
                {
                    asociacionVM.SelectedKeyDos = new KeyValuePair <int, string>(-1, "-");
                }
            }
            asociacionVM.iCodigoPaciente     = iCodigo;
            asociacionVM.strNombrePaciente   = strNombres;
            asociacionVM.strApellidoPaciente = strApellidos;
            IModalDialog dialog = ServiceProvider.Instance7.Get <IModalDialog>();

            dialog.BindViewModel(asociacionVM);
            dialog.ShowDialog();
        }
        public void BuscarReportesDialog(object parameter)
        {
            ReportesBuscarViewModel fvm    = new ReportesBuscarViewModel();
            IModalDialog            dialog = ServiceProvider.Instance12.Get <IModalDialog>();

            dialog.BindViewModel(fvm);
            dialog.ShowDialog();
        }
        //open dialog window for new appartment
        private void OpenNewAppartment()
        {
            mode = Mode.Create;
            SelectedAppartmentViewModel selectedAppartmentViewModel = new SelectedAppartmentViewModel(this, this.context);
            IModalDialog dialog = ServiceProvider.Instance.Get <IModalDialog>("appartmentImplementation");

            dialog.BindViewModel(selectedAppartmentViewModel);
            dialog.ShowDialog();
        }
Example #9
0
        internal void PushModalDialog(IModalDialog modalDialog)
        {
            if (this.CurrentToolTip != null)
            {
                this.CurrentToolTip.Hide();
            }

            this.modalDialogs.Push(modalDialog);
        }
Example #10
0
        private void ShowEditDialog()
        {
            this.Mode = ViewModel.Mode.Edit;

            IModalDialog dialog = ServiceProvider.Instance.Get <IModalDialog>();

            dialog.BindViewModel(this); //bind to this viewModel
            dialog.ShowDialog();
        }
        private void ActualizarFisioterapeutaDialog(object parameter)
        {
            FisioterapeutaActualizarViewModel fvm = new FisioterapeutaActualizarViewModel();

            fvm.SetFisioterapeutaSelecionado(fiosoterapeutaBean());
            IModalDialog dialog = ServiceProvider.Instance3.Get <IModalDialog>();

            dialog.BindViewModel(fvm);
            dialog.ShowDialog();
        }
        private void ActualizarPacienteDialog(object parameter)
        {
            PacienteActualizarViewModel pacienteActualizarViewModel = new PacienteActualizarViewModel();

            pacienteActualizarViewModel.SetPacienteActualizar(GetPaciente());
            IModalDialog dialog = ServiceProvider.Instance6.Get <IModalDialog>();

            dialog.BindViewModel(pacienteActualizarViewModel);
            dialog.ShowDialog();
        }
Example #13
0
        private void ShowHoodDialog()
        {
            // customer.Mode = Mode.Add;

            IModalDialog  dialog      = EmployeeTracker.Services.ServiceProvider.Instance.Get <IModalDialog>();
            HoodViewModel HoodAnalyst = new HoodViewModel(_axMap);

            dialog.BindViewModel(HoodAnalyst);
            dialog.ShowDialog();
        }
        //open dialog to create new occupant for given appartment
        private void OpenNewOccupant()
        {
            mode = Mode.Create;
            SelectedOccupantViewModel ocvm = new SelectedOccupantViewModel(this);

            ocvm.AppartmentId = selectedAppartment.AppartmentId;
            IModalDialog dialog = ServiceProvider.Instance.Get <IModalDialog>("occupantImplementation");

            dialog.BindViewModel(ocvm);
            dialog.ShowDialog();
        }
Example #15
0
        private void ShowAddDialog()
        {
            CustomerViewModel customer = new CustomerViewModel();

            customer.Mode = Mode.Add;

            IModalDialog dialog = ServiceProvider.Instance.Get <IModalDialog>();

            dialog.BindViewModel(customer);
            dialog.ShowDialog();
        }
Example #16
0
        public bool Show(IModalDialog dialog)
        {
            var frame = _modalDispatcher.CreateModalFrame();

            dialog.DialogClosed += (sender, args) => frame.Stop();

            _manager.Regions[RegionNames.DialogRegion].Add(dialog);

            _modalDispatcher.Run(frame);

            return dialog.Result ?? false;
        }
        private void ShowAddDialog()
        {
            NotificacionViewModel notificacion = new NotificacionViewModel();

            notificacion.Mode    = Mode.Add;
            notificacion.Proceso = this;

            IModalDialog dialog = ServiceProvider.Instance.Get <IModalDialog>();

            dialog.BindViewModel(notificacion);
            dialog.ShowDialog();
        }
Example #18
0
        private void ShowDisplayAlert(ErrorHandlerItem <T> errorHandlerItem)
        {
            IModalDialog modalDialog = (IModalDialog)Mvx.get_IoCProvider().Resolve <IModalDialog>();

            if (!string.IsNullOrWhiteSpace(this.ErrorCode))
            {
                modalDialog.DisplayErrorCodeByResourceKeysAsync(errorHandlerItem.ContentKey, errorHandlerItem.TitleKey, errorHandlerItem.ErrorCode);
            }
            else
            {
                modalDialog.DisplayAlertByResourceKeysAsync(errorHandlerItem.ContentKey, errorHandlerItem.TitleKey);
            }
        }
 //open dialog for spdt bill
 private void OpenSpdtBillDialog()
 {
     if (this.selectedAppartment != null)
     {
         SpdtBillViewModel spdtBillViewModel = new SpdtBillViewModel(this)
         {
             Id = selectedAppartment.AppartmentId,
         };
         IModalDialog dialog = ServiceProvider.Instance.Get <IModalDialog>("spdtBillDialogImplementation");
         dialog.BindViewModel(spdtBillViewModel);
         dialog.ShowDialog();
     }
 }
Example #20
0
        public void ShowDialog(IModalDialog modalDialog)
        {
            if (modalDialog == null)
            {
                throw new ArgumentNullException(nameof(modalDialog));
            }

            Application.Current.Dispatcher.Invoke(() =>
            {
                Window window = GetWindowByDialog(modalDialog);
                window.ShowDialog();
            });
        }
Example #21
0
        public void ShowDialogModal(IModalDialog dialog)
        {
            if (dialog == null)
            {
                return;
            }

            var placeHolderWindow = new PlaceHolderDialog();

            placeHolderWindow.DataContext = dialog;

            _windows.Add(placeHolderWindow);
            placeHolderWindow.ShowDialog();
        }
        //opens dialog to edit selected occupant
        private void OpenOccupantForEdit()
        {
            mode = Mode.Edit;
            SelectedOccupantViewModel ocvm = new SelectedOccupantViewModel(this)
            {
                AppartmentId = SelectedOccupant.AppartmentId, SelectedGender = SelectedOccupant.Gender,
                BirthDate    = SelectedOccupant.BirthDate, FirstName = SelectedOccupant.FirstName, LastName = SelectedOccupant.LastName,
                MiddleName   = SelectedOccupant.MiddleName, Owner = SelectedOccupant.Owner, Id = SelectedOccupant.OccupantId
            };
            IModalDialog dialog = ServiceProvider.Instance.Get <IModalDialog>("occupantImplementation");

            dialog.BindViewModel(ocvm);
            dialog.ShowDialog();
        }
 //open dialog for payment fo spdt
 private void OpenSpdtPaymentDialog()
 {
     if (this.selectedAppartment != null)
     {
         MoneyOperationViewModel paymentViewModel = new MoneyOperationViewModel(this, PaymentModeEnum.Spdt)
         {
             Id           = selectedAppartment.AppartmentId,
             MoneyAmmount = 0.0m
         };
         IModalDialog dialog = ServiceProvider.Instance.Get <IModalDialog>("paymentOperationDialogImplementation");
         dialog.BindViewModel(paymentViewModel);
         dialog.ShowDialog();
     }
 }
Example #24
0
 protected ViewModelBase()
 {
     base.\u002Ector();
     this._settings             = (IApplicationSettings)Mvx.get_IoCProvider().Resolve <IApplicationSettings>();
     this._navigationService    = (IMvxNavigationService)Mvx.get_IoCProvider().Resolve <IMvxNavigationService>();
     this._textProvider         = (IMvxTextProvider)Mvx.get_IoCProvider().Resolve <IMvxTextProvider>();
     this._userDialogs          = (IUserDialogs)Mvx.get_IoCProvider().Resolve <IUserDialogs>();
     this._modalDialog          = (IModalDialog)Mvx.get_IoCProvider().Resolve <IModalDialog>();
     this._connectivity         = (IConnectivity)Mvx.get_IoCProvider().Resolve <IConnectivity>();
     this._singleNavigation     = (ISingleNavigation)Mvx.get_IoCProvider().Resolve <ISingleNavigation>();
     this._profileDataService   = (IProfileDataService)Mvx.get_IoCProvider().Resolve <IProfileDataService>();
     this._profileDbDataService = (IProfileDbDataService)Mvx.get_IoCProvider().Resolve <IProfileDbDataService>();
     this._formsViewPresenter   = (IMvxFormsViewPresenter)Mvx.get_IoCProvider().Resolve <IMvxFormsViewPresenter>();
 }
        private void AgregarFisioterapeutaDialog(object parameter)
        {
            if (FisioterapeutaStatic.kstrRutaFoto == "")
            {
                MessageBox.Show("Aún no ha determinado la ruta de almacenamiento de las fotos. Antes de realizar este proceso dirigase a la pestaña de Rutas de Almacenamiento", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            FisioterapeutaAgregarViewModel fvm = new FisioterapeutaAgregarViewModel();
            IModalDialog dialog = ServiceProvider.Instance2.Get <IModalDialog>();

            dialog.BindViewModel(fvm);
            dialog.ShowDialog();
        }
Example #26
0
        public void ThenIShouldSeeTheSpecificModalDialogWithText(string modalDialogName, string compareType, string bodyOrTitle, string text)
        {
            IModalDialog dialog = null;

            Context.MobileApp.Do <IDetectModalDialog>(i => dialog = i.DetectModalDialog(modalDialogName));

            if (bodyOrTitle == "body")
            {
                Assert.IsTrue(dialog != null && dialog.Body.CompareWith(text, compareType.ToCompareType()));
            }
            else
            {
                Assert.IsTrue(dialog != null && dialog.Title.CompareWith(text, compareType.ToCompareType()));
            }
        }
Example #27
0
        public void ThenIShouldSeeTheSpecificModalDialog(string shouldOrShouldNot, string modalDialogName)
        {
            IModalDialog dialog = null;

            Context.MobileApp.Do <IDetectModalDialog>(i => dialog = i.DetectModalDialog(modalDialogName));

            if (shouldOrShouldNot == "should")
            {
                Assert.IsTrue(dialog != null);
            }
            else
            {
                Assert.IsFalse(dialog != null);
            }
        }
Example #28
0
        internal void PopModalDialog(IModalDialog modalDialog)
        {
            if (this.modalDialogs.Count > 0)
            {
                //if (this.modalDialogs.Peek() == modalDialog)pkubat changed
                //{
                //    this.modalDialogs.Pop();
                //}

                if (this.modalDialogs.Contains(modalDialog))
                {
                    this.modalDialogs.Remove(modalDialog);
                }
            }
        }
        private void DisplayServerUnreachableErrorMessage(ServerUnreachableException exception)
        {
            IModalDialog modalDialog = (IModalDialog)Mvx.get_IoCProvider().Resolve <IModalDialog>();
            string       errorCode1  = this.GetErrorCode(exception);

            if (exception.Response != null)
            {
                string errorCode2 = exception.Response.StatusCode.ToString() + "_" + errorCode1;
                modalDialog.DisplayErrorCodeByResourceKeysAsync("Common_NoServer_Message", "Common_NoServer_Title", errorCode2);
            }
            else
            {
                modalDialog.DisplayErrorCodeByResourceKeysAsync("Common_NoServer_Message", "Common_NoServer_Title", errorCode1);
            }
        }
        private void VerResultadoDialog(object parameter)
        {
            ResultadosVerViewModel fvm = new ResultadosVerViewModel();
            PacienteB paciente         = PacienteDL.VerPaciente(iCodigoPaciente);

            fvm.strNombresPaciente   = paciente.vNombresPaciente + " " + paciente.vApellidosPaciente;
            fvm.strApellidosPaciente = paciente.vApellidosPaciente;
            string strNivel = "";

            if (paciente.iNivelPaciente == 1)
            {
                strNivel = "I";
            }
            else if (paciente.iNivelPaciente == 2)
            {
                strNivel = "II";
            }
            else if (paciente.iNivelPaciente == 3)
            {
                strNivel = "III";
            }
            else if (paciente.iNivelPaciente == 4)
            {
                strNivel = "IV";
            }
            else if (paciente.iNivelPaciente == 5)
            {
                strNivel = "V";
            }

            fvm.strNivel               = strNivel;
            fvm.strNivelPorcentaje     = paciente.iPorcentajeNivelPaciente.ToString();
            fvm.strNombreLateralidad   = strNombreLateralidad;
            fvm.strNombreUnidad        = strNombreUnidad;
            fvm.strFecAnalisisPaciente = strFecAnalisisPaciente;
            FisioterapeutaStatic.setAngles(strListaAngulos, 1);
            FisioterapeutaStatic.strLateralidad = strNombreLateralidad;
            fvm.strListaAngulos = strListaAngulos;


            IModalDialog dialog = ServiceProvider.Instance9.Get <IModalDialog>();

            dialog.BindViewModel(fvm);
            dialog.ShowDialog();
        }
Example #31
0
 void OnModalClose(object sender, System.Windows.RoutedEventArgs e)
 {
     if (ModalContent.Children.Count == 1)
     {
         IModalDialog dlg = ModalContent.Children[0] as IModalDialog;
         if (dlg != null)
         {
             dlg.CloseButtonClick();
         }
     }
     ModalService.CloseModal();
     //this.ModalHost.Visibility = Visibility.Collapsed;
     //foreach (UIElement element in this.ModalContent.Children)
     //{
     //    if (element is IDisposable)
     //        ((IDisposable)element).Dispose();
     //}
     //this.ModalContent.Children.Clear();
 }