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 = ContentTypeFlag.None;
            IsValid         = true;

            _collapsableGrids.Clear();

            Content = null;
        }
Exemplo n.º 3
0
        public static Brush GetColorBrush(this ContentTypeFlag contentFlag)
        {
            List <Color> colors = new List <Color>();

            // Text
            if ((contentFlag & ContentTypeFlag.Text) != ContentTypeFlag.None)
            {
                colors.Add(Colors.Gray.With(c => c.A = 100));
            }

            // Image
            if ((contentFlag & ContentTypeFlag.Image) != ContentTypeFlag.None)
            {
                colors.Add(Colors.LightGreen.With(c => c.A = 100));
            }

            // Sound
            if ((contentFlag & ContentTypeFlag.Sound) != ContentTypeFlag.None)
            {
                colors.Add(Colors.LightBlue.With(c => c.A = 100));
            }

            return(new SolidColorBrush(colors.Aggregate(Color.Add)));
        }
Exemplo n.º 4
0
 protected LayoutBase(ContentTypeFlag acceptedContents)
 {
     AcceptedContents = acceptedContents;
 }
Exemplo n.º 5
0
 public static LayoutGrid Grid(ContentTypeFlag acceptedContent,
                               Rectangle?rootCors = null)
 {
     return(new LayoutGrid(acceptedContent,
                           rootCors ?? CorsFull));
 }
Exemplo n.º 6
0
 public static LayoutBase Stack(bool orientation,
                                ContentTypeFlag acceptedContent,
                                Rectangle?rootCors = null)
 {
     return(null);
 }
Exemplo n.º 7
0
 public static void SetAcceptedContent(DependencyObject obj,
                                       ContentTypeFlag value)
 {
     obj.SetValue(AcceptedContentProperty, value);
 }
Exemplo n.º 8
0
 public LayoutAuto(ContentTypeFlag acceptedContents,
                   Action <LayoutAuto> buildMethod) : base(acceptedContents)
 {
 }