FlexDocument
class
It
is a customized dockable FlexDocument object. The user can drag a
FlexDocument object and dock it at any place. Can also drag a
FlexDocument object into a sheet and make it one of the pages of the
sheet.
Examples
The
following example shows how to create a FlexDocument object.
public partial class MyChildDocument : FlexDocument
{
//
***** //
}
public partial class Window1 : LinsMDIWindow
{
public
Window1()
{
InitializeComponent();
//
Create a child document.
MyChildDocument
myChild =
new MyChildDocument();
//
Show the document.
MyChild.ShowDocument();
}
}
§
Constructors
1) public
FlexDocument()
Remarks
Initialize
a new instance of FlexDocument.
§
Members
1) public Rect Bounds { get; }
Remarks
Retrieve
both the size and the location of the document including its non-client
elements, in pixels, relative to its parent.
2) public
Rect
BoundsAtMDIFrame { get; }
Remarks
Retrieve
both the size and the location of the document including its non-client
elements, in pixels, relative to MDI frame.
3) public UIElement Content { get; set; }
Remarks
Gets
or sets the content of the document.
4) public virtual FLEX_DOCKING_ALIGN Dock { get; set;
}
Remarks
Gets
or sets which border of the main frame is to be docked to and determines how a
control is resized with its parent.
It can be one of the following values,
§
NONE:
The
control is not docked.
§
TOP:
The
control's top edge is docked to the top of its containing control.
§
BOTTOM:
The
control's bottom edge is docked to the bottom of its containing
control.
§
LEFT:
The
control's left edge is docked to the left edge of its containing
control.
§
RIGHT:
The
control's right edge is docked to the right edge of its containing
control.
5) public virtual WindowState DocumentState { get; set;
}
Remarks
Gets
or sets the state of the document;
it can be one of the following values
§
Normal:
The
document is restored.
§
Minimized:
The
document is minimized.
§
Maximized:
The
document is maximized.
6) public FLEX_DOCUMENTSTYLE DocumentStyle { get; }
Remarks
Retrieve
the style of the document;
it can be one of the following values
§
FLEX_DOCUMENT_REGULAR:
The
document is a normal document.
§
FLEX_DOCUMENT_TABPAGE:
The
document is one page of a FlexDocumentTabSheet
sheet.
7) public double Height { get; set; }
Remarks
Gets
or sets the height of the document.
UpdateSize() needs to be called for performing
the size change. This field will be ignored, if one of the following conditions
is true,
a)
The Dock attribute of the document is FLEX_DOCKING_ALIGN
.LEFT or FLEX_DOCKING_ALIGN
.RIGHT.
b)
The document is one page of a FlexDocumentTabSheet.
8) public virtual ImageSource Icon { get; set; }
Remarks
Gets
or sets the icon of the document.
9) public long ID { get; set; }
Remarks
Every
FlexDocument object should have a unique ID. If the user does not assign
a number to the ID, a unique number which is larger than FlexConstants.m_nUserDefinedControlStartID
(10,000,000) will be automatically generated and assigned to it. If the ID
is between FlexConstants.m_nUserDefinedControlStartID
(1000) and
FlexConstants.m_nUserDefinedControlStartID
(10,000,000),
then its layout will be persistent; otherwise, its layout will not be saved. You
can always use LinsUIWPFDockingManager.GetDocumentFromAllPlacesByID()
to retrieve its instance, once it is created
10)public FlexMenu MainMenu { get; set; }
Remarks
Set
the menu of this document. If it is set to null,
the menu will be removed from the document.
11)public FlexRibbonMenu MainRibbonMenu { get; set;
}
Remarks
Set
the ribbon menu of this document. If it is set to null,
the ribbon menu will be removed from the document.
12)public virtual bool
NoAnimate { get; set; }
Remarks
Gets
or sets the animation ability of the document.
13)public virtual
string Title { get; set; }
Remarks
Gets
or sets the caption of the document.
14)public double Width
{ get; set; }
Remarks
Gets
or sets the width of the document.
UpdateSize() needs to be called for performing
the size change. This field will be ignored, if one of the following conditions
is true,
a)
The Dock attribute of the document is FLEX_DOCKING_ALIGN
.TOP or FLEX_DOCKING_ALIGN
.BOTTOM.
b)
The document is one page of a FlexDocumentTabSheet.
§
Methods
1) public
virtual void Close()
Remarks
Close
the document.
2) public void EnsureVisible()
Remarks
Move
the document into view area if it is outside the view area.
3) public virtual bool HitTest(
Point
ptMousePosAtMDIFrame)
Parameters
ptMousePosAtMDIFrame
Type:
Point
A
location which is in MDI Frame coordinate.
Remarks
Test
whether the point, ptMousePosAtMDIFrame,
which is in MDI Frame coordinate, is inside this document includes the
non-client area.
4) public virtual void RemoveToolBar(
FlexToolBar
toolbar)
Parameters
toolbar
Type:
FlexToolBar
The
toolbar is going to be removed from this document.
Remarks
This
removes a toolbar from this document.
5) public void SetLocation(
Point
ptLoc)
Parameters
ptLoc
Type:
Point
A
location which is relative its parent coordinates.
Remarks
Set
the location of the document, in pixels, relative to its parent.
When the document is docked or is a page of a sheet, this method will be
invalid.
6) public void SetLocationAtMDIFrame(
Point
ptMousePosAtMDIFrame)
Parameters
ptMousePosAtMDIFrame
Type:
Point
A
location which is relative to MDI Frame coordinates.
Remarks
Set
the location of the document, in pixels, relative to MDI Frame.
When the document is docked or is a page of a sheet, this method will be
invalid.
7) public virtual bool ShowDocument()
Remarks
This
make the FlexDocument object visible.
8) public virtual void UpdateSize()
Remarks
When
width or height of a document is changed, this method needs to be called to
performing the change.
§
Events
1) public
event ContentChangedEventhandler
ContentChanged
Remarks
This
event is fired when the content is changed.
Create a Document,
Features,
FlexDocumentTabSheet,
How To,
Index,
Instruction,
LinsUIWPFDockingManager,
LinsUIWPFUtil
No comments:
Post a Comment