Browse Source

AvalonDock Fixed some null reference exceptions

pull/1170/head
John Stewien 9 years ago
parent
commit
0f3f8be154
  1. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs
  2. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs

5
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs

@ -62,7 +62,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
protected override void OnGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e) protected override void OnGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e)
{ {
_model.SelectedContent.IsActive = true; if (_model?.SelectedContent != null)
{
_model.SelectedContent.IsActive = true;
}
base.OnGotKeyboardFocus(e); base.OnGotKeyboardFocus(e);
} }

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs

@ -204,9 +204,9 @@ namespace Xceed.Wpf.AvalonDock.Controls
_view = new ContentPresenter(); _view = new ContentPresenter();
_view.SetBinding(ContentPresenter.ContentProperty, new Binding("Content") { Source = LayoutElement }); _view.SetBinding(ContentPresenter.ContentProperty, new Binding("Content") { Source = LayoutElement });
_view.SetBinding( ContentPresenter.ContentTemplateProperty, new Binding( "LayoutItemTemplate" ) { Source = LayoutElement.Root.Manager } ); _view.SetBinding(ContentPresenter.ContentTemplateProperty, new Binding("LayoutItemTemplate") { Source = LayoutElement?.Root?.Manager});
_view.SetBinding( ContentPresenter.ContentTemplateSelectorProperty, new Binding( "LayoutItemTemplateSelector" ) { Source = LayoutElement.Root.Manager } ); _view.SetBinding(ContentPresenter.ContentTemplateSelectorProperty, new Binding("LayoutItemTemplateSelector") { Source = LayoutElement?.Root?.Manager });
LayoutElement.Root.Manager.InternalAddLogicalChild( _view ); LayoutElement?.Root?.Manager.InternalAddLogicalChild(_view);
} }
return _view; return _view;

Loading…
Cancel
Save