From b875e27844e32611d0680c3a34eb17a0b6211686 Mon Sep 17 00:00:00 2001 From: XceedBoucherS Date: Fri, 15 Sep 2017 07:44:47 -0400 Subject: [PATCH] Revert "Update Pull Request 1170 to not use C# 6 stuff." --- .../Controls/LayoutAnchorablePaneControl.cs | 2 +- .../Controls/LayoutGridControl.cs | 2 -- .../Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs | 12 +++--------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs index 15640993..8a1d8106 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs @@ -62,7 +62,7 @@ namespace Xceed.Wpf.AvalonDock.Controls protected override void OnGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e) { - if ((_model != null) && (_model.SelectedContent != null)) + if (_model?.SelectedContent != null) { _model.SelectedContent.IsActive = true; } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs index c96e26dd..94d4f831 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs @@ -72,8 +72,6 @@ namespace Xceed.Wpf.AvalonDock.Controls _model.ChildrenTreeChanged += (s, args) => { - if (args.Change != ChildrenTreeChange.DirectChildrenChanged) - return; if (_asyncRefreshCalled.HasValue && _asyncRefreshCalled.Value == args.Change) return; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs index ae47bdb1..e23ec50b 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs @@ -204,15 +204,9 @@ namespace Xceed.Wpf.AvalonDock.Controls _view = new ContentPresenter(); _view.SetBinding(ContentPresenter.ContentProperty, new Binding("Content") { Source = LayoutElement }); - if ((LayoutElement != null) && (LayoutElement.Root != null)) - { - _view.SetBinding(ContentPresenter.ContentTemplateProperty, new Binding("LayoutItemTemplate") { Source = LayoutElement.Root.Manager }); - _view.SetBinding(ContentPresenter.ContentTemplateSelectorProperty, new Binding("LayoutItemTemplateSelector") { Source = LayoutElement.Root.Manager }); - if (LayoutElement.Root.Manager != null) - { - LayoutElement.Root.Manager.InternalAddLogicalChild(_view); - } - } + _view.SetBinding(ContentPresenter.ContentTemplateProperty, new Binding("LayoutItemTemplate") { Source = LayoutElement?.Root?.Manager}); + _view.SetBinding(ContentPresenter.ContentTemplateSelectorProperty, new Binding("LayoutItemTemplateSelector") { Source = LayoutElement?.Root?.Manager }); + LayoutElement?.Root?.Manager.InternalAddLogicalChild(_view); } return _view;