mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-20 22:05:07 +00:00
Added DependencyPropertyHelper.AddOwner
This commit is contained in:
parent
f78bcb33fa
commit
a3d25b5084
12 changed files with 119 additions and 133 deletions
|
|
@ -74,11 +74,27 @@ namespace MapControl
|
|||
Action<TOwner, TValue, TValue> changed) where TOwner : AvaloniaObject
|
||||
{
|
||||
var property = source.AddOwner<TOwner>();
|
||||
|
||||
property.Changed.AddClassHandler<TOwner, TValue>((o, e) => changed(o, e.OldValue.Value, e.NewValue.Value));
|
||||
|
||||
return property;
|
||||
}
|
||||
|
||||
public static StyledProperty<TValue> AddOwner<TOwner, TValue>(
|
||||
string _, // for compatibility with WinUI/UWP DependencyPropertyHelper
|
||||
StyledProperty<TValue> source) where TOwner : AvaloniaObject
|
||||
{
|
||||
return AddOwner<TOwner, TValue>(source);
|
||||
}
|
||||
|
||||
public static StyledProperty<TValue> AddOwner<TOwner, TValue>(
|
||||
string _, // for compatibility with WinUI/UWP DependencyPropertyHelper
|
||||
StyledProperty<TValue> source,
|
||||
Action<TOwner, TValue, TValue> changed) where TOwner : AvaloniaObject
|
||||
{
|
||||
return AddOwner(source, changed);
|
||||
}
|
||||
|
||||
public static void SetBinding(this AvaloniaObject target, AvaloniaProperty property, Binding binding)
|
||||
{
|
||||
target.Bind(property, binding);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue