/// <summary> /// Установка информации о проекте /// </summary> /// <param name="thisWindow">Текущее окно</param> /// <param name="nameProject">Имя проекта</param> /// <param name="datePub">Дата публикации</param> /// <param name="rating">Рейтинг</param> /// <param name="countVote">Количество голосов</param> /// <param name="note">Описание</param> /// <param name="hrefImage">Ссылка на картинку</param> /// <param name="viewApp">Категория проекта</param> public static void SetInfoForSettingsPanel(YourProject thisWindow, string nameProject, string datePub, double rating, int countVote, string note, string hrefImage, int viewApp) { #region Анимация панели thisWindow.settingsPanel.BeginAnimation(MarginProperty, StyleUIE.AnimationObject(thisWindow.settingsPanel, TimeSpan.FromSeconds(0.33), new Thickness(0, thisWindow.settingsPanel.Margin.Top, 0, 0))); #endregion string[] exp = nameProject.Split('.'); thisWindow.nameProjTB.Text = nameProject.Replace("." + exp[exp.Length - 1], string.Empty); thisWindow.nameProjTB.Tag = nameProject; thisWindow.nameProjTB.MaxLength = 45 - (exp[exp.Length - 1].Length + 1); thisWindow.expasionText.Text = "." + exp[exp.Length - 1]; thisWindow.dateProjLB.Content = $"Date : {datePub}"; thisWindow.ratingProjLB.Content = $"Rating : {rating}"; thisWindow.countVoteProjLB.Content = $"Count Vote : {countVote}"; if (!hrefImage.Equals(string.Empty) || hrefImage != null) { thisWindow.hrefImageTb.Text = hrefImage; try { thisWindow.imageProj.Fill = new ImageBrush(new BitmapImage(new Uri(hrefImage, UriKind.Absolute))); } catch { } } thisWindow.noteTextBox.Document.Blocks.Clear(); if (!note.Equals(string.Empty) || note != null) { thisWindow.noteTextBox.AppendText(note); } if (viewApp > 0) { thisWindow.comboBoxTypeProj.SelectedIndex = viewApp - 1; } #region Устанавливаем новый рейтинг у проекта double oldRating = (thisWindow.listViewProjects.SelectedItem as MyItemProject).ratingProject; if (rating != oldRating) { int index = thisWindow.listViewProjects.SelectedIndex; StackPanel panelStar = listPanelStars[index]; DrawStarsForProject(panelStar, rating); } #endregion }
/// <summary> /// Появление всплывающего окна /// </summary> /// <param name="sender">Button</param> /// <param name="e">Click</param> private void ShowPopupPanel(object sender, RoutedEventArgs e) { contextButBorder.Visibility = Visibility.Hidden; panelPopup.Visibility = Visibility.Visible; EventHandler handler = (s, es) => { strelkaPopup.Visibility = Visibility.Visible; }; panelPopup.BeginAnimation(MarginProperty, StyleUIE.AnimationObject(panelPopup, TimeSpan.FromSeconds(0.20), new Thickness(this.ActualWidth - (panelPopup.ActualWidth + 5), 10, 0, 0), handler)); }
/// <summary> /// Hide панели с настройками проекта /// </summary> private void SetHiddenSettingsPanel() { #region Анимация панели thisWindow.settingsPanel.BeginAnimation(MarginProperty, StyleUIE.AnimationObject(thisWindow.settingsPanel, TimeSpan.FromSeconds(0.33), new Thickness(0, settingsPanel.Margin.Top, -settingsPanel.ActualWidth - 5, 0), new EventHandler((sen, e) => { settingsPanel.Visibility = Visibility.Hidden; }))); #endregion nameProjTB.IsEnabled = false; comboBoxTypeProj.SelectedIndex = -1; noteTextBox.Document.Blocks.Clear(); }