private void ComputeAcceptedContent() { if (_panelAcceptedContents.Count == 0) { return; } AcceptedContent = _panelAcceptedContents .Select(pc => pc.content) .Aggregate((c1, c2) => c1 | c2); }
public void Reset() { ClearContent(); _panelAcceptedContents.Clear(); _contentPanelMap.Clear(); AcceptedContent = ContentTypeFlags.None; IsValid = true; _collapsableGrids.Clear(); SetCurrentValue(ContentProperty, null); }
public static Brush GetColorBrush(this ContentTypeFlags contentFlags) { List <Color> colors = new List <Color>(); // Text if ((contentFlags & ContentTypeFlags.Text) != ContentTypeFlags.None) { colors.Add(Colors.Gray.With(c => c.A = 100)); } // Image if ((contentFlags & ContentTypeFlags.Image) != ContentTypeFlags.None) { colors.Add(Colors.LightGreen.With(c => c.A = 100)); } // Sound if ((contentFlags & ContentTypeFlags.Sound) != ContentTypeFlags.None) { colors.Add(Colors.LightBlue.With(c => c.A = 100)); } return(new SolidColorBrush(colors.Aggregate(Color.Add))); }
public static void SetAcceptedContent(DependencyObject d, ContentTypeFlags value) { d.SetValue(AcceptedContentProperty, value); }