|
|
@ -6,25 +6,29 @@ using Perspex.Markup.Xaml.Data; |
|
|
|
|
|
|
|
|
namespace Perspex.Markup.Xaml.MarkupExtensions |
|
|
namespace Perspex.Markup.Xaml.MarkupExtensions |
|
|
{ |
|
|
{ |
|
|
public class RelativeSourceExtension : MarkupExtension |
|
|
public class BindingExtension : MarkupExtension |
|
|
{ |
|
|
{ |
|
|
public RelativeSourceExtension() |
|
|
public BindingExtension() |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public RelativeSourceExtension(RelativeSourceMode mode) |
|
|
public BindingExtension(string path) |
|
|
{ |
|
|
{ |
|
|
Mode = mode; |
|
|
Path = path; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public override object ProvideValue(MarkupExtensionContext extensionContext) |
|
|
public override object ProvideValue(MarkupExtensionContext extensionContext) |
|
|
{ |
|
|
{ |
|
|
return new RelativeSource |
|
|
return new Binding |
|
|
{ |
|
|
{ |
|
|
|
|
|
Converter = Converter, |
|
|
Mode = Mode, |
|
|
Mode = Mode, |
|
|
|
|
|
SourcePropertyPath = Path, |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public RelativeSourceMode Mode { get; set; } |
|
|
public IValueConverter Converter { get; set; } |
|
|
|
|
|
public BindingMode Mode { get; set; } |
|
|
|
|
|
public string Path { get; set; } |
|
|
} |
|
|
} |
|
|
} |
|
|
} |