Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

New Post: finding the layoutdocument with IsLastFocusedDocument==true

$
0
0

Hi

I have a LayoutDocumentPane and I need to track the contained layoutDocument that has focus (IsLastFocusedDocument==true) when ever it changes. The method should also work when the layoutdocuments have been undocked.

Currently my solution is to assign a propertyChanged event to each layoutdocument and then filter using the below code:

var tmp = dockingManager.Layout.Descendents().OfType();
int numDoc = tmp.Count();
for (int i = 0; i < numDoc; i++)
   if (tmp.ElementAt(i).IsLastFocusedDocument)
     updateSomething();

but when doing this the event assigned to each layoutdocument will call the updateSomethin() method which should only be called once. Can someone please tell me how to do this ?

Thx


Viewing all articles
Browse latest Browse all 2690

Trending Articles