Пример #1
0
        protected override void OnUnloaded()
        {
            _messageControl.DiagnosticClicked -= EhDiagnosticClicked;
            _messageControl = null;

            base.OnUnloaded();
        }
Пример #2
0
        public CodeEditorWithDiagnostics() : base()
        {
            if (RowDefinitions.Count < 3)
            {
                RowDefinitions.Add(new RowDefinition {
                    Height = new GridLength(0, GridUnitType.Star)
                });
            }
            if (RowDefinitions.Count < 4)
            {
                RowDefinitions.Add(new RowDefinition {
                    Height = new GridLength(0.33, GridUnitType.Star), MinHeight = MinHeightDiagnosticWindow
                });
            }

            var gridSplitter = new GridSplitter
            {
                Height = 4,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Top
            };

            SetRow(gridSplitter, 3);
            Children.Add(gridSplitter);

            _messageControl = new DiagnosticMessageControl
            {
                Margin = new Thickness(0, 4, 0, 0)
            };
            _messageControl.SetValue(Grid.RowProperty, 3);
            _messageControl.DiagnosticClicked += EhDiagnosticClicked;
            Children.Add(_messageControl);
        }