-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathTemplateBinding.cs
More file actions
37 lines (30 loc) · 1.08 KB
/
TemplateBinding.cs
File metadata and controls
37 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public sealed class TemplateBinding
{
public TemplateBinding(string targetName, DependencyProperty targetProperty, DependencyProperty sourceProperty)
: this(targetName, targetProperty, sourceProperty, null, null)
{
}
public TemplateBinding(
string targetName,
DependencyProperty targetProperty,
DependencyProperty sourceProperty,
object? fallbackValue,
object? targetNullValue = null)
{
TargetName = targetName;
TargetProperty = targetProperty;
SourceProperty = sourceProperty;
FallbackValue = fallbackValue;
TargetNullValue = targetNullValue;
}
public string TargetName { get; }
public DependencyProperty TargetProperty { get; }
public DependencyProperty SourceProperty { get; }
public object? FallbackValue { get; }
public object? TargetNullValue { get; }
public void UpdateSource(string sourceName, DependencyProperty sourceProperty)
{
SourceProperty = sourceProperty;
// Trigger re-binding if necessary (implementation left out)
}
}