DocumentContent - resizing

Apr 8, 2010 at 4:31 PM

 

                GameDeskControl doc = new GameDeskControl();
                doc.DataContext = doc;
                doc.Title = "Document " + (i);
                doc.InfoTip = "Info tipo for " + doc.Title;
                doc.ContentTypeDescription = "Sample document";
                doc.Closing += new EventHandler<System.ComponentModel.CancelEventArgs>(doc_Closing);
                doc.Closed += new EventHandler(doc_Closed);                

 

 

 doc.SizeChanged+=new SizeChangedEventHandler(doc.Resize);

                MyDocs.Add(doc)H

              Hello, I'm trying to make adjusments of DocumentContent when user resize the DocumentPane. I'm using this code to instatiate DocumentContents:

 

                GameDeskControl doc = new GameDeskControl();  // this is really the DemoDocument from the sample provided with AvalonDock

                doc.DataContext = doc;

                doc.Title = "Document " + (i);

                doc.InfoTip = "Info tipo for " + doc.Title;

                doc.ContentTypeDescription = "Sample document";

                doc.Closing += new EventHandler<System.ComponentModel.CancelEventArgs>(doc_Closing);

                doc.Closed += new EventHandler(doc_Closed);                

                doc.SizeChanged+=new SizeChangedEventHandler(doc.Resize);

                MyDocs.Add(doc);

but the method doc.Resize is never called.

Approach 2: It would not be a problem if I know how to find out client-area of DocumentPane (i.e. DocumentContent) because SizeChangedEventHandler of DocumentPane is called properly. 

Approach 3: doc.Height, doc.Width use values - doc.Width contain NaN value.

Can somebody tell me what is wrong or how to solve the problem?

Thanks!