Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: Problem with Avalondock IsActive

$
0
0
Hello,

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?

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>