private StandardColumnInfo[] CreateStandardColumns() { var columns = new[] { new StandardColumnInfo(Serial, r => true), new StandardColumnInfo(Package, r => true), new StandardColumnInfo(Asset, r => true), new StandardColumnInfo(Id, r => !string.IsNullOrWhiteSpace(r.Id)), new StandardColumnInfo(Source, r => true), new StandardColumnInfo(Target, r => true), new StandardColumnInfo(Asset2, r => !string.IsNullOrWhiteSpace(r.Asset2)), new StandardColumnInfo(Id2, r => !string.IsNullOrWhiteSpace(r.Id2)), new StandardColumnInfo(Target2, r => !GlossyString.IsNullOrEmpty(r.Target2)), new StandardColumnInfo(Notes, r => !string.IsNullOrWhiteSpace(r.Notes)), new StandardColumnInfo(TagList, r => true), }; #if DEBUG if (columns.Length != dataGrid.Columns.Count) { throw new ApplicationException("Extra DataGridColumn in XAML."); } #endif return(columns); }
public static void OnGlossyTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var control = d as GlossyTextBlock; var inlines = control.Paragraph.Inlines; inlines.Clear(); var gs = e.NewValue as GlossyString; if (!GlossyString.IsNullOrEmpty(gs)) { foreach (var run in gs.AsCollection().Select(GlossyPairToRun).Where(r => r != null)) { inlines.Add(run); } } }
private StandardColumnInfo[] CreateStandardColumns() { return(new[] { new StandardColumnInfo(Serial, r => true), new StandardColumnInfo(Asset, r => true), new StandardColumnInfo(Id, r => !string.IsNullOrWhiteSpace(r.Id)), new StandardColumnInfo(Source, r => true), new StandardColumnInfo(Target, r => true), new StandardColumnInfo(Asset2, r => !string.IsNullOrWhiteSpace(r.Asset2)), new StandardColumnInfo(Id2, r => !string.IsNullOrWhiteSpace(r.Id2)), new StandardColumnInfo(Target2, r => !GlossyString.IsNullOrEmpty(r.Target2)), new StandardColumnInfo(Notes, r => !string.IsNullOrWhiteSpace(r.Notes)), new StandardColumnInfo(TagList, r => true), }); }