-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
namespace System.Windows.Markup | ||
{ | ||
/// <summary> | ||
/// Base interface for all Xaml markup extensions. | ||
/// </summary> | ||
public interface IMarkupExtension | ||
{ | ||
/// <summary> | ||
/// Return an object that should be set on the targetObject's targetProperty | ||
/// for this markup extension. | ||
/// </summary> | ||
/// <param name="serviceProvider">Object that can provide services for the markup extension.</param> | ||
/// <returns> | ||
/// The object to set on this property. | ||
/// </returns> | ||
object ProvideValue(IServiceProvider serviceProvider); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,17 +9,17 @@ namespace System.Windows.Markup | |
public class XamlSetMarkupExtensionEventArgs : XamlSetValueEventArgs | ||
{ | ||
public XamlSetMarkupExtensionEventArgs(XamlMember member, | ||
MarkupExtension value, IServiceProvider serviceProvider) : | ||
IMarkupExtension value, IServiceProvider serviceProvider) : | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Breaking change. |
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Breaking change |
||
: this(member, value, serviceProvider) | ||
{ | ||
TargetObject = 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