This project is read-only.

DocumentContent Width and Height

Nov 11, 2009 at 7:57 PM

Does anyone know how to return the width and height of the content of a DocumentContent? I need to know what the visible area is of cont4 in the following code:

 

DocumentContent cont4 = new DocumentContent();

            cont4.Name = "cont4";

            cont4.Content = mainCanvas;

            cont4.Title = "Document";

            pane4.Items.Add(cont4);

            dockManager.Show(cont4);

 

DocumentContent cont4 = new DocumentContent();
            cont4.Name = "cont4";
            //mainCanvas.Name = "MyDesignerCanvas";
            mainCanvas.AllowDrop = true;
            mainCanvas.Background = Brushes.LightSlateGray;
            //mainCanvas.Width = WidthProperty.;
            //mainCanvas.Height = (double)HeightProperty;
                      
            cont4.Content = mainCanvas;
            cont4.Title = "Document";
            pane4.Items.Add(cont4);
            dockManager.Show(cont4);

 

I've tried obvious functions like Height, ActualHeight etc., and they all return either 0 or NaN. Any thoughts anyone?

Thanks a million in advance.

Derek