FormDesignerControl Class
Definition
Surface hosting the WPF designer.
Inheritance
Implements
Syntax
[TemplatePart(Name = "PART_DesignContent", Type = typeof(ContentControl))]
[TemplatePart(Name = "PART_Zoom", Type = typeof(ZoomControl))]
public class FormDesignerControl : DesignSurfaceBase, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, INotifyPropertyChanged, IFormDesignerControl, IFormDesignerLoader
Remarks
Form Designer supports all common editing operations such as dragging, selecting and deleting components and controls; changing their size and z-order; aligning them horizontally or vertically; and copying and pasting controls. Like Visual Studio WPF Form Designer, it serializes its content into XAML source.
Here are some of the essential features provided by the FormDesigner:
- Placing controls on the design surface and arranging them.
- Save/load forms being designed.
- Write event handlers code and run the designed form.
The DesignerCommands property provides an interface to Form Designer commands, such as Copy/Paste, Undo/Redo, Aligning and Arranging controls, etc.
The SelectedItems property contains a list of selected components or controls.
Constructors
FormDesignerControl() | Initializes a new instance of the |
Properties
AutoAddComponentAssemblyReferences | Gets or sets a boolean value indicating whether designer should automatically try to add assembly references after a control is added. |
AutoSaveToSource | Gets or sets a boolean value indicating whether designer should automatically translate changes to the source upon every change. |
ControlManipulationOptions | |
CurrentTool | Gets or sets the currently selected tool |
DesignerCommands | Represents a collection of standard designer commands like selecting, copying, pasting, moving and resizing controls. |
IsBeingLoaded | |
IsModified | Indicates if the designer content was modified. |
IsSmartDiffCodeSerializationRequired | Gets or sets method used to identify whether |
ReferencedAssemblies | Gets collection of assemblies where the controls and components used on the form being designed are declared. |
SelectedItems | Contains list of selected DesignItem. |
ServiceProvider | Provides custom support to other objects. |
Source | Gets or sets form designer Source. |
Methods
CanCancelSelectedTool() | |
CancelSelectedTool() | |
CanCopyOrCut() | Indicates whether selected items can be copied or cut. |
CanDelete() | Indicates whether selected items can be deleted. |
CanPaste() | Indicates whether clibpoard contains controls that can be pasted to the designer |
CanRedo() | Indicating whether the redo operation can be performed. |
CanSelectAll() | Indicating whether the SelectAll operation can be performed. |
CanUndo() | Indicating whether the undo operation can be performed. |
Copy() | Copies selected items content. |
CreateEventHandlerService() | |
CreateResourceResolutionService() | |
Cut() | Cuts selected items content. |
Delete() | Deletes selected items. |
Descendants(DesignItem) | Returns list child DesignItem objects. |
DescendantsAndSelf(DesignItem) | |
GetDefaultXamlLoadSettings() | |
InitializeDesigner(DesignContext) | |
LoadDesigner(String) | Initializes the designer content from the specified xaml string. |
LoadDesigner(XmlReader, XamlLoadSettings) | Initializes the designer content from the specified XmlReader. |
LoadDesignerFromFile(String) | Initializes the designer content from the specified xaml file name. |
OnApplyTemplate() | Is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate. |
OnPreviewMouseLeftButtonDown(MouseButtonEventArgs) | |
Paste() | Pastes selected items content. |
Redo() | Executes redo command. |
Reload() | Reloads form to be designed from the source. |
Save() | Translates changes made in the designer to the source. |
Save(StringBuilder) | Serializes designer to C# or Visual Basic file. |
ScrollIntoView(DesignItem) | Scrolls the specified child control into view on an auto-scroll enabled control. |
SelectAll() | Selects all controls on design surface. |
TryAddComponentAssemblyReferences(Type) | |
Undo() | Executes redo command. |
UnloadDesigner() | Unloads the designer content. |
UnselectAll() | Deselects all control on design surface. |
Events
DesignedContentChanged | Occurs when user modifies any aspect of the control being designed. |
NavigateToUserMethodRequested | Occurs when form designer is requested to navigate to the event handler. For example, when user double clicks on the control. |
ReferencedAssembliesChanged | |
SelectionChanged | Occurs when user selects different control in the designer. |
ShowPropertiesRequested | Occurs when user request to open Property Window. |
SourceChanged | Occurs when designer's source was changed. |