Hello,
I have one DocumentPane, to wich I add Items like this:
var tv = sender as TreeViewItem;
Do I something wrong or is this a Bug?
I have one DocumentPane, to wich I add Items like this:
var tv = sender as TreeViewItem;
var tvNew = tv.TryFindFromPoint<TreeViewItem>(e.GetPosition(tv));
if (tvNew.DataContext is PlantDTO)
{
e.Handled = true;
var plant = (PlantDTO) tvNew.DataContext;
var mainWindow = MainWindow.Instance;
var documentPane = mainWindow.DockManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
var doc = new LayoutDocument() {Content = new MfcPlcDesigner(null, plant)};
doc.Title = "Technology Scheme (" + plant.Name + ")";
documentPane.Children.Add(doc);
doc.IsActive = true;
}
The Problem is now, That not the currently Added LayoutDocument is in Foreground, no the last one wich was Active! But when I look at the LastFocusedDocument Property, this is set to my new one!Do I something wrong or is this a Bug?