GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoView Class / Document Property
In This Topic
    Document Property (GoView)
    In This Topic
    Gets or sets the document that this view is displaying.
    Syntax
    [Browsable(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public virtual GoDocument Document {get; set;}

    Property Value

    The initial value is created by a call to CreateDocument. The value must not be null.
    Remarks

    The document serves as the container of graphical objects that you want to display. Normally you should create graphical objects (instances of subclasses of GoObject) and add them to the document, in order to make them visible to the user. Although often there will be one view for each document, there are can be more than one view displaying the same document, or sometimes no views at all for a document. Each view will have its own state, such as scroll position and selection. The document holds all of the state that should be shared by all views.

    Setting this property to a different document will stop any ongoing editing in this view, clear out the selection, make this view's OnDocumentChanged method the event handler for the new document, and call InitializeLayersFromDocument to set up the document layers in this view.

    See Also