Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

changed implementation of PanelSelectionHandler so that custom panelsele... #521

Merged

Conversation

tbulle
Copy link

@tbulle tbulle commented Aug 6, 2014

...ctionhandlers can inherit that class if they are built in the same project. Also added a Partial Selectionhandler that selects objects that are partially selected if both mousebuttons are pressed.

PartialPanelSelectionHandler is activated by adding a custom extension in your project like this:

[ExtensionFor(typeof(Panel), OverrideExtension = typeof(PanelSelectionHandler))]
public class CustomPartialPanelSelectionHandler : PartialPanelSelectionHandler
{
}

gumme and others added 30 commits June 17, 2013 11:49
…n declaring a property as XAML element, and NOT the name of the type that declares the property.
…pile whole SharpDevelop solution before loose referenced projects can compile.
…declared in the document root.

As prefix for the XML-namespaces it primarily uses the value from XmlnsPrefixAttribute if it exists for the XML-namespace, otherwise a "ControlsX" name is generated, where X is the first free value.
… that really represents attached properties when an attached property is used.

When setting a property value as attribute, fixed so namespace prefix is only used for attached properties, and if no prefix is defined for a non-default namespace a new unique prefix is generated.
…ss will be executed.

Made some modifications to XamlParser so it aligns with the official XamlReader and the SimpleLoadTests will pass.
…ss will be executed.

Made some modifications to XamlParser so it aligns with the official XamlReader and the WhitespaceTests will pass.
…rgetObject (for example when adding Bindings to the MultiBinding.Bindings property).
… type string named Name to represent a name in XAML namescope, and this caused trouble with types with a property named Name that did not represent a XAML name. In this case the value of the property tried to be registered as name to the namescope and this caused either the value to be occupied as name, or threw an exception if name already was taken or the value consisted of characters forbidden in XAML names causing the value to not be set at all.

To solve this the value of a Name property is only registered to namescope if the property represents a XAML name (defined by RuntimeNamePropertyAttribute).

Also added a Name property to XamlObject that always sets the name to x:Name attribute, but gets it from either x:Name or the property that represents the XAML name if it exists (both are valid places for name registration).

Fixed a bug in XamlParser where x:Name value was not registered in its namescope.

All other changes (for example changes in PropertyGrid/XamlDesignItem) was to support the Name fixes described above.
… instead of a NullReferenceException in the case where the document failed to load.
… attribute that does not belong to a namespace, otherwise it will overwrite the value in another attribute with same name but in another namespace if it finds one.
…on types outside default XAML namespace.

Fixing this in CreatePropertyElement method also fixed another bug for AddChildNodeToProperty method that was fixed earlier in InsertNodeInCollection method with commit comment as follows:
"Its WPF standard to use parent type name as prefix before the dot when declaring a property as XAML element, and NOT the name of the type that declares the property."
…t to compile whole SharpDevelop solution before loose referenced projects can compile."

This reverts commit ad869ad.
This is necessary after the fix in commit 295f625.
Before that commit the ReportErrors was semi-optional; When loading was successful ReportErrors was never called (ReportErrors optional), but when document failed to be created a NullReferenceException was thrown because ReportErrors did not have a delegate.

See also commit 006558f, that throws a more friendly exception than NullReferenceException when document fails to load.
…signItemProperty and that it writes as expected to XAML.
…ons. In either case, prefix should not be used for a normal property in markup extensions.
…checks if the referenced resource is declared locally, and it its declared locally it forces the markup extension to be printed as element and not as shorthand XAML markup extension code. This is so the StaticResource can find the correct resource.

Also fixed so Resources element is always left first among the child elements when inserting new child.
…ed after the markup extension was set on a property, and these property changes effect how the markup extension can be printed in XAML, the markup extension was not updated properly.
Conflicts:
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/PropertyGrid.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignContext.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/NameScopeHelper.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/WpfDesign.XamlDom.csproj
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlConstants.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/PropertyNode.cs
All conflicts resolved using remote version of the files.
…f they are already present in the root where the snippet is pasted.

Added a test "PasteCustomControlUsingMixedTypes" that failed before this fix.
gumme and others added 22 commits February 27, 2014 15:10
Conflicts:
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
Conflicts:
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
Conflicts:
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/SizeDisplay.cs
	src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
…electionhandlers can inherit that class if they are built in the same project. Also added a Partial Selectionhandler that selects objects that are partially selected if both mousebuttons are pressed.

PartialPanelSelectionHandler is activated by adding a custom extension in your project like this:

[ExtensionFor(typeof(Panel), OverrideExtension = typeof(PanelSelectionHandler))]
public class CustomPartialPanelSelectionHandler : PartialPanelSelectionHandler
{
}
@jogibear9988
Copy link
Member

I think you made some mistakes in this Pull req! Or do you really want to change 41 Files, even many of them have nothing to do with WPF Designer?

…DesignerPartialPanelSelectionHandler"

This reverts commit 352d2dc, reversing
changes made to aa59343.
@tbulle
Copy link
Author

tbulle commented Aug 11, 2014

Sorry, that is correct I do not want to alter 41 files. I have reverted the unwanted changes so the request should be correct now

@jogibear9988
Copy link
Member

what do you do in your project with the CustomPartialPanelSelectionHandler?

siegfriedpammer added a commit that referenced this pull request Aug 23, 2014
…ndler

changed implementation of PanelSelectionHandler so that custom panelsele...
@siegfriedpammer siegfriedpammer merged commit cfa59ea into icsharpcode:master Aug 23, 2014
@dgrunwald
Copy link
Member

Note: because the merge included the history of the unrelated commits that were accidentally included in this request; I un-did the merge using a force push.
We'll repeat the merge without that extra history soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants