csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
// Copyright (c) The Perspex Project. All rights reserved.
|
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|
|
|
using OmniXaml;
|
|
using Perspex.Data;
|
|
using Perspex.Markup.Xaml.Data;
|
|
|
|
namespace Perspex.Markup.Xaml.MarkupExtensions
|
|
{
|
|
public class BindingExtension : MarkupExtension
|
|
{
|
|
public BindingExtension()
|
|
{
|
|
}
|
|
|
|
public BindingExtension(string path)
|
|
{
|
|
Path = path;
|
|
}
|
|
|
|
public override object ProvideValue(MarkupExtensionContext extensionContext)
|
|
{
|
|
return new Binding
|
|
{
|
|
Converter = Converter,
|
|
ConverterParameter = ConverterParameter,
|
|
ElementName = ElementName,
|
|
Mode = Mode,
|
|
Path = Path,
|
|
Priority = Priority,
|
|
};
|
|
}
|
|
|
|
public IValueConverter Converter { get; set; }
|
|
public object ConverterParameter { get; set; }
|
|
public string ElementName { get; set; }
|
|
public BindingMode Mode { get; set; }
|
|
public string Path { get; set; }
|
|
public BindingPriority Priority { get; set; } = BindingPriority.LocalValue;
|
|
public object Source { get; set; }
|
|
}
|
|
}
|