private void Button_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e) { if (!(sender is Button button)) { return; } if ((bool)e.NewValue == true) { button.Effect = ControlsFactory.CreateDropShadowEffect(); if (button == ButtonContinue) { button.Foreground = BindingValues.Instance.BrushTextTitleForeground; } else { button.Foreground = BindingValues.Instance.BrushTextForeground; } } else { button.Effect = null; button.Foreground = BindingValues.Instance.BrushTextDisabledForeground; } }
private static void LoadDepartmentsAndDoctors(FirebirdClient firebirdClient) { Logging.ToLog("DataProvider - Получение данных для оценки врачей"); using (DataTable dataTableSurvey = firebirdClient.GetDataTable(InfoKiosk.Services.Config.Instance.SqlGetSurveyInfo)) { Logging.ToLog("DataProvider - Получено строк: " + dataTableSurvey.Rows.Count); foreach (DataRow dataRow in dataTableSurvey.Rows) { string dept = ControlsFactory.FirstCharToUpper(dataRow["DEPARTMENT"].ToString(), true); if (!Survey.ContainsKey(dept)) { Survey.Add(dept, new List <ItemDoctor>()); } string docname = dataRow["DOCNAME"].ToString(); string depNum = dataRow["DEPNUM"].ToString(); string dCode = dataRow["DCODE"].ToString(); string docPosition = dataRow["DOCPOSITION"].ToString(); ItemDoctor doc = new ItemDoctor(docname, docPosition, dept, dCode, depNum); #pragma warning disable CA1307 // Specify StringComparison if (Survey[dept].FindAll(x => x.Code.Equals(dCode)).Count == 0) #pragma warning restore CA1307 // Specify StringComparison { Survey[dept].Add(doc); } } } }
private void CreateGUI() { AddButton = ControlsFactory.CreateStandardAddCircularButton( "Προσθήκη ραντεβού πελάτη", null, DataPresenter, () => { var form = iPetrosDataModelHelpers.CreateCustomerAppointmentDataModelDataForm(); form.ShowSearchInput <CustomerDataModel, int>(x => x.CustomerId, async search => await iPetrosDI.GetDataStorage.GetCustomersAsync(0, new DateDataStorageArgs() { Search = search }), x => x.FirstName + " " + x.LastName, x => x.Id, x => null); form.ShowSearchInput <StaffMemberDataModel, int>(x => x.StaffMemberId, async search => await iPetrosDI.GetDataStorage.GetStaffMembersAsync(0, new DateDataStorageArgs() { Search = search }), x => x.FirstName + " " + x.LastName, x => x.Id, x => null); return(form); }, () => new CustomerAppointmentDataModel() { DateStart = DateTimeOffset.Now, DateEnd = DateTimeOffset.Now.AddHours(1) }, async model => await iPetrosDI.GetDataStorage.AddCustomerAppointmentAsync(model), Args); ContentGrid.Children.Add(AddButton); }
private EditQuestionControl CreateControl(Question question) { List <Answer> answers = new List <Answer>(); EditQuestionControl control = ControlsFactory.CreateQuestionControl(question, answers, Width); return(control); }
private static void LoadSchedule(FirebirdClient firebirdClient) { Logging.ToLog("DataProvider - Получение расписания врачей"); using (DataTable dataTableSchedule = firebirdClient.GetDataTable(InfoKiosk.Services.Config.Instance.SqlGetScheduleInfo)) { Logging.ToLog("DataProvider - Получено строк: " + dataTableSchedule.Rows.Count); foreach (DataRow dataRow in dataTableSchedule.Rows) { string depname = ControlsFactory.FirstCharToUpper(dataRow["DEPNAME"].ToString(), true); if (!Schedule.ContainsKey(depname)) { Schedule.Add(depname, new SortedDictionary <string, SortedDictionary <string, string> >()); } string doctor = dataRow["FULLNAME"].ToString(); if (!Schedule[depname].ContainsKey(doctor)) { Schedule[depname].Add(doctor, new SortedDictionary <string, string>()); } for (int i = 0; i < 7; i++) { Schedule[depname][doctor].Add("D" + i, dataRow["D" + i].ToString()); } } } }
public void GotoOtherDetailsView() { CurrentViewLbl.Text = "Other details"; var data = ControlsFactory.Resolve <OtherDetailsView>(); data.Revalidate(); OnControlChanged(data); }
public void GotoRecords() { CurrentViewLbl.Text = "Records"; var data = ControlsFactory.Resolve <RecordsView>(); data.Revalidate(); OnControlChanged(data); }
public void GotoAccounts() { CurrentViewLbl.Text = "Accounts"; var data = ControlsFactory.Resolve <AccountsView>(); data.Revalidate(); OnControlChanged(data); }
public void GotoEvents() { CurrentViewLbl.Text = "Events"; var data = ControlsFactory.Resolve <EventsFullView>(); data.Revalidate(); OnControlChanged(data); }
private async void button5_Click(object sender, EventArgs e) { ControlsFactory.ShellView.Controls.Clear(); var loginview = ControlsFactory.Resolve <LoginView>(); loginview.Dock = DockStyle.Fill; ControlsFactory.ShellView.Controls.Add(loginview); await HealthCenterService.SetLogoutTime(AccountContextService.LastLogId, DateTime.Now); }
public Game1() { _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; IsMouseVisible = true; _screenManager = new ScreenManager(); Components.Add(_screenManager); var controlsFactory = new ControlsFactory(Content); Services.AddService(controlsFactory); }
private void toolStripButton2_Click(object sender, EventArgs e) { var pg = ControlsFactory.Resolve <ManageCategoryPage>(); var data = new PersonCategory(); pg.GetModelData(data); DialogActivator.OpenDialog(pg, "New Category", () => { HealthCenterService.CreateCategory(data); }); }
public void ReValidate() { var EventsFullView = ControlsFactory.Resolve <EventsFullView>(); var RecordsView = ControlsFactory.Resolve <RecordsView>(); var AccountsView = ControlsFactory.Resolve <AccountsView>(); var OtherDetailsView = ControlsFactory.Resolve <OtherDetailsView>(); EventsFullView.Revalidate(); RecordsView.Revalidate(); AccountsView.Revalidate(); AccountsView.Revalidate(); }
private void toolStripButton1_Click(object sender, EventArgs e) { var pg = ControlsFactory.Resolve <ManageAccountPage>(); var data = new Account(); pg.GetModelData(data); DialogActivator.OpenDialog(pg, "New account detail", () => { HealthCenterService.CreateAccount(data); }); }
private static void SetImage(ItemPatient patient, bool isOk) { if (patient.CheckStateImage != null) { if (!isOk) { patient.CheckStateImage.Source = ControlsFactory.GetImage(ControlsFactory.ImageType.NotificationRegistry); } patient.CheckStateImage.Visibility = Visibility.Visible; } }
public LoadingScreen(Game1 game, Action action) : base(game) { _factory = game.Services.GetService <ControlsFactory>(); _desktop = new Desktop(game.Batch); var label = _factory.CreateLabel(fontName: "fonts/commodore64"); label.OffsetFrom = Anchors.Center; label.Text = "Loading..."; label.ComputeSize(Vector2.Zero, Autosize.Content); _desktop.Root.Children.Add(label); afterAction = action; }
/// <summary> /// Creates and adds the required GUI elements /// </summary> private void CreateGUI() { // Create the add button AddButton = ControlsFactory.CreateStandardAddCircularButton(); AddButton.Command = new RelayCommand(async() => { // Create the form var form = CeidDiplomatikiDataModelHelpers.CreatePageMapDataForm(); // Set the model form.Model = new PageMap(); // Show the dialog var dialogResult = await DialogHelpers.ShowConventionalAddDialogAsync(this, "Page creation", null, form); // If we didn't get positive feedback... if (!dialogResult.Feedback) { // Return return; } // Update the values of the model form.UpdateModelValues(); // Get the manager var manager = CeidDiplomatikiDI.GetCeidDiplomatikiManager; // Register it manager.Register(form.Model); // Save the changes var result = await manager.SaveChangesAsync(); // If there was an error... if (!result.Successful) { // Show the error await result.ShowDialogAsync(this); // Return return; } // Add it to the presenter DataPresenter.Add(form.Model); }); // Add it to the content grid ContentGrid.Children.Add(AddButton); }
/// <summary> /// Creates and adds the required GUI elements /// </summary> private void CreateGUI() { // Create the add button AddButton = ControlsFactory.CreateStandardAddCircularButton(); AddButton.Command = new RelayCommand(async() => { // Create the form var form = new DataForm <DataGridPresenterMap>(new DataGridPresenterMap(QueryMap)) { Mapper = CeidDiplomatikiDataModelHelpers.DataGridPresenterMapMapper.Value } .ShowInput(x => x.Name, settings => { settings.Name = CeidDiplomatikiDataModelHelpers.DataGridPresenterMapMapper.Value.GetTitle(x => x.Name); settings.IsRequired = true; }) .ShowInput(x => x.Description, settings => settings.Name = CeidDiplomatikiDataModelHelpers.DataGridPresenterMapMapper.Value.GetTitle(x => x.Description)) .ShowStringColorInput(x => x.Color, settings => settings.Name = CeidDiplomatikiDataModelHelpers.DataGridPresenterMapMapper.Value.GetTitle(x => x.Color)); // Show an add dialog var dialogResult = await DialogHelpers.ShowConventionalAddDialogAsync(this, "Data grid creation", null, form); // If we didn't get positive feedback... if (!dialogResult.Feedback) { // Return return; } // Get the manager var manager = CeidDiplomatikiDI.GetCeidDiplomatikiManager; // Register it QueryMap.Add(form.Model); // Save the changes var result = await manager.SaveChangesAsync(); // If there was an error... if (!result.Successful) { // Show the error await result.ShowDialogAsync(this); // Return return; } // Add the model DataPresenter.Add(form.Model); }); // Add it to the content grid ContentGrid.Children.Add(AddButton); }
/// <summary> /// Creates and returns the GUI in a form of a <see cref="FrameworkElement"/> /// </summary> /// <returns></returns> protected override FrameworkElement CreateBaseGUIElement() { // Create the content stack panel ContentStackPanel = new SeparatedStackPanelItemsControl() { Orientation = Orientation.Vertical, Margin = new Thickness(LargeUniformMargin), }; // Wrap it in a scroll viewer ContentScrollViewer = ControlsFactory.WrapInScrollViewer(ContentStackPanel); // Return the scroll viewer return(ContentScrollViewer); }
private void CreateGUI() { AddButton = ControlsFactory.CreateStandardAddCircularButton( "Προσθήκη υπαλλήλου", null, DataPresenter, () => { return(iPetrosDataModelHelpers.CreateCustomerDataModelDataForm()); }, () => new CustomerDataModel(), async model => await iPetrosDI.GetDataStorage.AddCustomerAsync(model), Args); ContentGrid.Children.Add(AddButton); }
private void dtgvailment_CellClick(object sender, DataGridViewCellEventArgs e) { switch (e.ColumnIndex) { case 0: var pg = ControlsFactory.Resolve <ManageAilmentPage>(); var data = (Ailments)AilmentListBinding.Current; pg.GetModelData(data); DialogActivator.OpenDialog(pg, "Modify Ailment", () => { HealthCenterService.ModifyAilment(data); }); break; } }
private void navBarControl1_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { try { currontSecurityControlBase = ControlsFactory.Show(e.Link, this.panelControl1); //Esto se hace de esta manera ya que el tree listo no se carga correctamente la primera vez que se levanta el control if (currontSecurityControlBase.GetType() == typeof(RulesEditControl)) { ((RulesEditControl)currontSecurityControlBase).PopulateAsync(); } } catch (Exception ex) { base.MessageViewInfo.Show(Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex)); } }
private async void Login() { var data = await HealthCenterService.Login(txt_UserName.Text, Txt_Password.Text); if (data != null) { if (data.AccountStatus == AccountStatus.Active) { var lastLogId = await HealthCenterService.CreateAccountLog(new AccountLogs { AccountId = data.Id }); AccountContextService.SetAccount(data, lastLogId); ControlsFactory.ShellView.Controls.Clear(); var nav = ControlsFactory.Resolve <NavigationView>(); AccessTypeHandler.SetType(data.Type); nav.ReValidate(); if (data.Type != AccountType.Administrator) { nav.button3.Visible = false; } else { nav.button3.Visible = true; nav.button3.Enabled = true; } nav.AccountType = data.Type; nav.Dock = DockStyle.Fill; ControlsFactory.ShellView.Controls.Add(nav); } else { MessageBox.Show("Account inactive.. please contact administrator", "Access denied!"); } } else { MessageBox.Show("Access denied", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private static void LoadServices(FirebirdClient firebirdClient, bool isGui = false) { Logging.ToLog("DataProvider - Получение информации о ценах и услугах"); using (DataTable dataTablePrice = firebirdClient.GetDataTable( InfoKiosk.Services.Config.Instance.SqlGetPriceInfo, new Dictionary <string, object> { { "@filialID", InfoKiosk.Services.Config.Instance.SqlGetPriceInfoFilialID } }, isGui)) { Logging.ToLog("DataProvider - Получено строк: " + dataTablePrice.Rows.Count); Services = new SortedDictionary <string, List <ItemService> >(); foreach (DataRow dataRow in dataTablePrice.Rows) { string cost = dataRow["COST"].ToString(); if (string.IsNullOrEmpty(cost) || !int.TryParse(cost, out int costValue)) { continue; } string group = ControlsFactory.FirstCharToUpper(dataRow["GROUP"].ToString(), true); if (!Services.ContainsKey(group)) { Services.Add(group, new List <ItemService>()); } string serviceName = dataRow["SERVICE_NAME"].ToString(); string serviceKodoper = dataRow["SERVICE_CODE"].ToString(); string serviceSchid = dataRow["SCHID"].ToString(); string priority = dataRow["PRIORITY"].ToString(); Services[group].Add(new ItemService(serviceName, costValue, serviceSchid, serviceKodoper, priority)); } } foreach (string key in Services.Keys) { Services[key].Sort(); } }
private void dtgvAcc_CellClick(object sender, DataGridViewCellEventArgs e) { var data = (Account)AccountListBinding.Current; switch (e.ColumnIndex) { case 0: AccountLogsListBinding.DataSource = data.Logs.ToList(); dtgvlogs.DataSource = AccountLogsListBinding; break; case 1: var pg = ControlsFactory.Resolve <ManageAccountPage>(); pg.GetModelData(data); DialogActivator.OpenDialog(pg, "New account detail", () => { HealthCenterService.ModifyAccount(data); }); break; } }
private void CreateGUI() { AddButton = ControlsFactory.CreateStandardAddCircularButton( "Προσθήκη υπαλλήλου", null, DataPresenter, () => { return(iPetrosDataModelHelpers.CreateStaffMemberDataModelDataForm() .ShowSelectEnumSingleOptionInput(x => x.Type, (dataForm, propertyInfo) => new DropDownMenuEnumOptionsFormInput <StaffMemberType>(dataForm, propertyInfo, new List <StaffMemberType>() { StaffMemberType.Moderator, StaffMemberType.StaffMember }, x => x.ToLocalizedString()), settings => settings.IsRequired = true)); }, () => new StaffMemberDataModel(), async model => await iPetrosDI.GetDataStorage.AddStaffMemberAsync(model), Args); AddButton.Visibility = iPetrosDI.ConnectedUser.Type == StaffMemberType.Admin ? Visibility.Visible : Visibility.Collapsed; ContentGrid.Children.Add(AddButton); }
private void CreateLabelAndComboBox(string text) { ControlsFactory controlsFactory = new ControlsFactory(); int pointY = getLocationY(); Label label = controlsFactory.CreateLabelForFilter(pointY, text); CheckBoxComboBox combo = controlsFactory.CreateComboBoxForFilter(pointY, text); if (tryFillComboBox(text, combo)) { int width = getComboBoxWith(combo, label.Text); combo.Width = width + 50; label.Width = width; _mainForm.Controls.Add(combo); comboList.Add(combo); _mainForm.Controls.Add(label); labelList.Add(label); } }
/// <summary> /// Creates and adds the required GUI elements /// </summary> private void CreateGUI() { // Create the add button AddButton = ControlsFactory.CreateStandardAddCircularButton(); AddButton.Command = new RelayCommand(async() => { // Disable the button AddButton.IsEnabled = false; // Get the analyzer var analyzer = CeidDiplomatikiDI.GetDatabaseAnalyzer(DatabaseOptions.Provider); // Get the connection string DatabaseOptions.TryGetConnectionString(out var connectionString); // Get all the tables var tables = analyzer.GetTables(Database.DatabaseName); // Get all the foreign key columns var foreignKeyColumns = analyzer.GetForeignKeyColumns(Database.DatabaseName, null); // Create a steps presenter var stepsPresenter = new StepsPresenter() { AllowArbitraryNavigation = false }; // Create a node component var nodeComponent = new NodeComponent <IDbProviderTable>(tables, (table) => { // Get the foreign keys of the table var foreignKeys = foreignKeyColumns.Where(x => x.TableName == table.TableName).ToList(); // Get the tables whose primary key is related to one of the foreign keys var foreignToPrimaryKeyTables = tables.Where(x => foreignKeys.Any(y => y.ReferencedTableName == x.TableName)).ToList(); // Get the foreign keys that are related to the primary key of the table var relatedForeignKeys = foreignKeyColumns.Where(x => x.ReferencedTableName == table.TableName).ToList(); // Get the tables var primaryToForeignKeyTables = tables.Where(x => relatedForeignKeys.Any(y => y.TableName == x.TableName)).ToList(); return(foreignToPrimaryKeyTables.Concat <IDbProviderTable, IDbProviderTable>(primaryToForeignKeyTables).Distinct()); }, table => table.TableName); var nodeComponentScrollViewer = new ScrollViewer() { Content = nodeComponent, HorizontalScrollBarVisibility = ScrollBarVisibility.Visible }; // Add it to the steps presenter stepsPresenter.Add("Query", nodeComponentScrollViewer, element => nodeComponent.NodePath.Model != null); // Create the form var form = new DataForm <QueryMap>() .ShowInput(x => x.Name, settings => { settings.Name = CeidDiplomatikiDataModelHelpers.QueryMapMapper.Value.GetTitle(x => x.Name); settings.IsRequired = true; }) .ShowInput(x => x.Description, settings => settings.Name = CeidDiplomatikiDataModelHelpers.QueryMapMapper.Value.GetTitle(x => x.Description)) .ShowStringColorInput(x => x.Color, settings => settings.Name = CeidDiplomatikiDataModelHelpers.QueryMapMapper.Value.GetTitle(x => x.Color)); // Add it to the steps presenter stepsPresenter.Add("Info", form, (element) => element.Validate()); // Show a dialog var dialogResult = await DialogHelpers.ShowStepsDialogAsync(this, "Query map creation", null, stepsPresenter, IconPaths.TablePath); // If we didn't get positive feedback... if (!dialogResult.Feedback) { // Re enable the button AddButton.IsEnabled = true; // Return return; } // Get the selected tables tables = nodeComponent.NodePath.DistinctModels; // Get the pairs var pairs = nodeComponent.NodePath.Pairs; // Get the node path var nodePath = nodeComponent.NodePath; // Get the columns of the table var columns = analyzer.GetColumns(DatabaseOptions.DatabaseName, null).Where(x => tables.Any(y => y.TableName == x.TableName)).ToList(); // The joins collection var joins = new List <JoinMap>(); // For every pair... foreach (var pair in pairs) { JoinMap joinMap; if (foreignKeyColumns.Any(x => x.TableName == pair.Value.Model.TableName && x.ReferencedTableName == pair.Key.Model.TableName)) { // Get the foreign key column var foreignKeyColumn = foreignKeyColumns.First(x => x.TableName == pair.Value.Model.TableName && x.ReferencedTableName == pair.Key.Model.TableName); // Get the principle column var principleColumn = columns.First(x => x.ColumnName == foreignKeyColumn.ReferencedColumnName); // Get the foreign key column var referencedColumn = columns.First(x => x.ColumnName == foreignKeyColumn.ColumnName); // Create the join map joinMap = new JoinMap(pair.Key.Model, principleColumn, pair.Value.Model, referencedColumn, pair.Key.Index, false); } else { // Get the foreign key column var foreignKeyColumn = foreignKeyColumns.First(x => x.ReferencedTableName == pair.Value.Model.TableName && x.TableName == pair.Key.Model.TableName); // Get the principle column var principleColumn = columns.First(x => x.ColumnName == foreignKeyColumn.ColumnName); // Get the foreign key column var referencedColumn = columns.First(x => x.ColumnName == foreignKeyColumn.ReferencedColumnName); // Create the join map joinMap = new JoinMap(pair.Key.Model, principleColumn, pair.Value.Model, referencedColumn, pair.Key.Index, true); } // Add it to the joins joins.Add(joinMap); } // Create the model var model = QueryMap.FromDataModel(DatabaseOptions, Database, tables, columns, joins); // Set it to the form form.Model = model; // Update its values form.UpdateModelValues(); // Get the manager var manager = CeidDiplomatikiDI.GetCeidDiplomatikiManager; // Register the model await manager.RegisterAsync(model); // Save the changes var result = await manager.SaveChangesAsync(); // If there was an error... if (!result.Successful) { // Show the error await result.ShowDialogAsync(this); // Re enable the button AddButton.IsEnabled = true; // Return return; } // Add it to the presenter DataPresenter.Add(model); // Re enable the button AddButton.IsEnabled = true; }); // Add it to the content grid ContentGrid.Children.Add(AddButton); }
private void DrawPatients() { int row = 0; foreach (ItemPatient patient in patients) { if (row > 1) { GridMultiplePatientsInner.RowDefinitions.Add(new RowDefinition()); } Grid grid = new Grid { HorizontalAlignment = HorizontalAlignment.Stretch }; grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); ColumnDefinition col0 = new ColumnDefinition { Width = new GridLength(90, GridUnitType.Star) }; grid.ColumnDefinitions.Add(col0); ColumnDefinition col1 = new ColumnDefinition { Width = new GridLength(10, GridUnitType.Star) }; grid.ColumnDefinitions.Add(col1); string textTop = patient.Name; string textBottom = "дата рождения: " + patient.Birthday.ToLongDateString(); TextBlock textBlockTop = ControlsFactory.CreateTextBlock(textTop); textBlockTop.Foreground = BindingValues.Instance.BrushTextForeground; textBlockTop.Margin = new Thickness(20, 0, 0, 0); TextBlock textBlockBottom = ControlsFactory.CreateTextBlock(textBottom); textBlockBottom.Foreground = BindingValues.Instance.BrushTextDisabledForeground; textBlockBottom.Margin = new Thickness(20, 0, 0, 0); Grid.SetRow(textBlockBottom, 1); Image image = ControlsFactory.CreateImage( ControlsFactory.ImageType.NotificationOk, horizontalAlignment: HorizontalAlignment.Right, margin: new Thickness(20)); Grid.SetColumn(image, 1); Grid.SetRowSpan(image, 2); image.Visibility = Visibility.Hidden; grid.Children.Add(textBlockTop); grid.Children.Add(textBlockBottom); grid.Children.Add(image); Button button = new Button { Tag = patient, Style = BindingValues.Instance.StyleRoundCornerStretch, Content = grid, Margin = new Thickness(20) }; button.Effect = ControlsFactory.CreateDropShadowEffect(); button.Click += ButtonPatient_Click; Grid.SetRow(button, row); GridMultiplePatientsInner.Children.Add(button); button.HorizontalContentAlignment = HorizontalAlignment.Stretch; patient.CheckStateImage = image; row++; } }
public PageNotification(NotificationType type, string replacement = "", bool returnBack = false, Exception exception = null, bool?isQueryException = null) { InitializeComponent(); Console.WriteLine(@"http://CONSTRUCT_PageNotification.type." + type); Logging.ToLog("PageNotification - Отображение страницы типа: " + type); CurrentNotificationType = type; this.returnBack = returnBack; string textTop = string.Empty; string textBottom = string.Empty; ControlsFactory.ImageType imageType = ControlsFactory.ImageType.NotificationRegistry; string textToShow = string.Empty; title = Properties.Resources.title_notification; this.isQueryException = isQueryException; switch (type) { case NotificationType.Welcome: textToShow = Properties.Resources.notification_welcome; title = Properties.Resources.title_welcome; MediaElementWelcomeAnimation.Visibility = Visibility.Visible; TextBlockAboutDeveloper.Visibility = Visibility.Visible; GridImage.Visibility = Visibility.Hidden; KeepAlive = true; isError = false; break; case NotificationType.NumberNotFound: textToShow = Properties.Resources.notification_nothing_found; imageType = ControlsFactory.ImageType.NotificationNumberNotFound; break; case NotificationType.NoAppointmentsForNow: textToShow = Properties.Resources.notification_no_appointmetns_for_now; imageType = ControlsFactory.ImageType.NotificationAppointmentsNotAvailable; break; case NotificationType.NameNotCorrect: textToShow = Properties.Resources.notification_wrong_name; imageType = ControlsFactory.ImageType.NotificationWrongNumber; break; case NotificationType.FirstVisit: textToShow = Properties.Resources.notification_first_visit; imageType = ControlsFactory.ImageType.NotificationFirstVisit; break; case NotificationType.VisitRegistryToCheckIn: textToShow = Properties.Resources.notification_need_go_to_registry; ButtonInfo.Visibility = Visibility.Visible; ButtonInfo.Style = BindingValues.Instance.StyleRoundCorner; break; case NotificationType.DbError: textToShow = Properties.Resources.notification_db_not_available; title = Properties.Resources.title_welcome; TextBlockAboutDeveloper.Visibility = Visibility.Visible; imageType = ControlsFactory.ImageType.NotificationDbError; TextBlockTapToContinue.Visibility = Visibility.Collapsed; TextBlockBottom.Margin = new Thickness(0); isError = true; SetupErrorNotification(exception); break; case NotificationType.Cash: imageType = ControlsFactory.ImageType.NotificationCash; textToShow = Properties.Resources.notification_cash; break; case NotificationType.CheckInFailed: imageType = ControlsFactory.ImageType.NotificationDbError; textToShow = Properties.Resources.notification_check_in_failed; TextBlockAboutDeveloper.Visibility = Visibility.Visible; isError = true; break; case NotificationType.AlreadyChecked: imageType = ControlsFactory.ImageType.NotificationRegistry; textToShow = Properties.Resources.notification_already_checked; break; default: break; } ImageCenter.Source = ControlsFactory.GetImage(imageType); string[] splittedTextToShow = textToShow.Split(new string[] { "\r\n\r\n" }, StringSplitOptions.None); TextBlockTop.Text = splittedTextToShow[0].Replace("*", replacement); if (splittedTextToShow.Length > 1) { TextBlockBottom.Text = splittedTextToShow[1]; } DataContext = BindingValues.Instance; IsVisibleChanged += (s, e) => { if ((bool)e.NewValue) { BindingValues.Instance.SetUpMainWindow(title, true, isError); if (CurrentNotificationType == NotificationType.DbError) { return; } Console.WriteLine("---PageNotification_PreviewMouseDown subscribe"); MainWindow.Instance.PreviewMouseDown += PageNotification_PreviewMouseDown; } else { Console.WriteLine("---PageNotification_PreviewMouseDown unsubscribe"); MainWindow.Instance.PreviewMouseDown -= PageNotification_PreviewMouseDown; } }; }