Class FormDesignerControl
- Namespace
- Alternet.FormDesigner.Wpf
- Assembly
- Alternet.FormDesigner.Wpf.v10.dll
Surface hosting the WPF designer.
[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
- Inheritance
-
FormDesignerControl
- Implements
- Extension Methods
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
FormDesignerControl
class with default settings.
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
Gets or sets manipulation options allowed for the controls on the designer surface.
- 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
Get a value indicating whether the designer has not fully loaded its content.
- IsModified
Indicates if the designer content was modified.
- IsSmartDiffCodeSerializationRequired
Gets or sets method used to identify whether
FormDesignerControl
content should be saved only by taking into account code difference.
- 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()
Indicates whether the current designer tool can be canceled.
- 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.
- CancelSelectedTool()
Cancels current designer tool and returns it to the default state.
- Copy()
Copies selected items content.
- Cut()
Cuts selected items content.
- Delete()
Deletes selected items.
- Descendants(DesignItem)
Returns list child DesignItem objects.
- DescendantsAndSelf(DesignItem)
Returns a list that contains a given item and its child DesignItem objects.
- 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)
Invoked when an unhandled PreviewMouseLeftButtonDown routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
- 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.
- 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
Occurs when ReferencedAssemblies is changed.
- 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.