Exemplo n.º 1
0
        private Control GetHeader(VisualTreeNode node)
        {
            var result = new StackPanel
            {
                Orientation = Orientation.Horizontal,
                Gap         = 8,
                Children    = new Controls
                {
                    new TextBlock
                    {
                        FontStyle = node.IsInTemplate ? FontStyle.Italic : FontStyle.Normal,
                        Text      = node.Type,
                    },
                    new TextBlock
                    {
                        [!TextBlock.TextProperty] = node.WhenAnyValue(x => x.Classes),
                    }
                }
            };

            result.PointerEnter += AddAdorner;
            result.PointerLeave += RemoveAdorner;

            return(result);
        }
Exemplo n.º 2
0
 private static Control GetHeader(VisualTreeNode node)
 {
     return(new StackPanel
     {
         Orientation = Orientation.Horizontal,
         Gap = 8,
         Children = new Controls
         {
             new TextBlock
             {
                 Text = node.Type,
                 FontStyle = node.IsInTemplate ? Media.FontStyle.Italic : Media.FontStyle.Normal,
             },
             new TextBlock
             {
                 [!TextBlock.TextProperty] = node.WhenAnyValue(x => x.Classes),
             }
         }
     });
 }