-
Notifications
You must be signed in to change notification settings - Fork 1.2k
MarkupExtension use interface instead of abstract class #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
That's a great improvement that we can make an existed class used like a MarkupExtension. |
src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/RefOnly/LooseTypeExtensions.cs
Outdated
Show resolved
Hide resolved
Why u didn't use MarkupExtension now in all Classes? I think you need to check for IMarkupExtension everywhere. @h82258652 |
This is a design change along with the addition of a public type. I would recommend opening an issue for this and discussing the design, so that we could ensure that this is the approach we want to take. It will also allow interested folks to chime in with their input. Marking this as NO MERGE for now, until we have consensus on the approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my $0.02. I think to make this non-breaking you need a new class in-between, and that's a lot of API to add that would need full design/review of the product owners. It's probably good to discuss the design and get buy-off in the issue first.
public IServiceProvider ServiceProvider { get; private set; } | ||
|
||
internal XamlSetMarkupExtensionEventArgs(XamlMember member, | ||
MarkupExtension value, IServiceProvider serviceProvider, object targetObject) | ||
IMarkupExtension value, IServiceProvider serviceProvider, object targetObject) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change
base(member, value) | ||
{ | ||
ServiceProvider = serviceProvider; | ||
} | ||
|
||
public MarkupExtension MarkupExtension { get { return Value as MarkupExtension; } } | ||
public IMarkupExtension MarkupExtension { get { return Value as IMarkupExtension; } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change.
Perhaps injecting a base class between this class and XamlSetValueEventArgs that adds the interface version, and leave XamlSetMarkupExtensionEventArgs alone (apart from now inheriting from the intermediate class).
@@ -9,17 +9,17 @@ namespace System.Windows.Markup | |||
public class XamlSetMarkupExtensionEventArgs : XamlSetValueEventArgs | |||
{ | |||
public XamlSetMarkupExtensionEventArgs(XamlMember member, | |||
MarkupExtension value, IServiceProvider serviceProvider) : | |||
IMarkupExtension value, IServiceProvider serviceProvider) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change
issue