This commit is contained in:
Stephan Maier
2024-08-27 08:10:27 +02:00
parent eb5c2fa502
commit 647f938eee
617 changed files with 73086 additions and 7137 deletions

View File

@@ -0,0 +1,49 @@
using System.Windows;
using System.Windows.Data;
namespace AutoCompleteTextBox
{
public class BindingEvaluator : FrameworkElement
{
#region "Fields"
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(string), typeof(BindingEvaluator), new FrameworkPropertyMetadata(string.Empty));
#endregion
#region "Constructors"
public BindingEvaluator(Binding binding)
{
ValueBinding = binding;
}
#endregion
#region "Properties"
public string Value
{
get => (string)GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
public Binding ValueBinding { get; set; }
#endregion
#region "Methods"
public string Evaluate(object dataItem)
{
DataContext = dataItem;
SetBinding(ValueProperty, ValueBinding);
return Value;
}
#endregion
}
}