public CaseControlDetailsSideBar(CaseControl caseControl) { InitializeComponent(); this.DataContext = this; InitializeDetails(caseControl); }
public CaseControlDetails(CaseControl caseControl) { InitializeComponent(); this.DataContext = this; InitializeDetails(caseControl); BuildAttachments(caseControl); }
private void InitializeDetails(CaseControl caseControl) { Canvas.SetLeft(this, caseControl.Left); Canvas.SetTop(this, caseControl.Top); Canvas.SetZIndex(this, caseControl.ZIndex - 1); subject.Text = caseControl.Case.Subject; this.ToolTip = caseControl.Case.Description; caseControl.PropertyChanged += CaseControl_PropertyChanged; }
private void BuildAttachments(CaseControl caseControl) { int sideMarginLeft = 8; int sideMarginRight = 182; //8,0,182,-6 foreach (var attachment in caseControl.Case.Attachments) { attachmentsGrid.Children.Add(new AttachmentButton(attachment, new Thickness(sideMarginLeft, 0, sideMarginRight, -6))); sideMarginLeft += 17; sideMarginRight -= 17; } }
private void InitializeDetails(CaseControl caseControl) { DetailsOpen = FindResource("DetailsOpen") as Storyboard; DetailsClose = FindResource("DetailsClose") as Storyboard; Canvas.SetLeft(this, caseControl.Left); Canvas.SetTop(this, caseControl.Top); Canvas.SetZIndex(this, caseControl.ZIndex - 1); subject.Text = caseControl.Case.Subject; description.Text = caseControl.Case.Description; if (caseControl.Case.GetType() == typeof(SFCase)) { owner.Content = (caseControl.Case as SFCase).Owner?.Name; substatus.Content = (caseControl.Case as SFCase).SubStatus; creator.Content = (caseControl.Case as SFCase).CreatedBy?.Name; dtcreated.Content = (caseControl.Case as SFCase).CreatedDate; switch ((caseControl.Case as SFCase).Priority) { case "Low": priority.Background = new SolidColorBrush(Color.FromRgb(8, 203, 17)); break; case "Med": priority.Background = new SolidColorBrush(Color.FromRgb(232, 255, 1)); break; case "High": priority.Background = new SolidColorBrush(Color.FromRgb(255, 105, 1)); break; case "Critical": priority.Background = new SolidColorBrush(Color.FromRgb(255, 1, 1)); break; default: break; } } caseControl.PropertyChanged += CaseControl_PropertyChanged; stackPanel.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); CalculatedHeight = stackPanel.DesiredSize.Height; }
public static void RemoveCase(this UIElementCollection uIElementCollection, SFConnectorUI.CaseView.CaseControl caseControl) { caseControl.TriggerCaseDetails(true); uIElementCollection.Remove(caseControl); }