|
@@ -141,20 +141,20 @@ namespace Avalonia.Styling
|
|
|
{
|
|
{
|
|
|
var description = style?.ToString();
|
|
var description = style?.ToString();
|
|
|
|
|
|
|
|
- if (sourceInstance.Subject != null)
|
|
|
|
|
|
|
+ if (sourceInstance.Mode == BindingMode.TwoWay || sourceInstance.Mode == BindingMode.OneWayToSource)
|
|
|
{
|
|
{
|
|
|
var activated = new ActivatedSubject(activator, sourceInstance.Subject, description);
|
|
var activated = new ActivatedSubject(activator, sourceInstance.Subject, description);
|
|
|
cloned = new InstancedBinding(activated, sourceInstance.Mode, BindingPriority.StyleTrigger);
|
|
cloned = new InstancedBinding(activated, sourceInstance.Mode, BindingPriority.StyleTrigger);
|
|
|
}
|
|
}
|
|
|
- else if (sourceInstance.Observable != null)
|
|
|
|
|
|
|
+ else if (sourceInstance.Mode == BindingMode.OneTime)
|
|
|
{
|
|
{
|
|
|
- var activated = new ActivatedObservable(activator, sourceInstance.Observable, description);
|
|
|
|
|
- cloned = new InstancedBinding(activated, sourceInstance.Mode, BindingPriority.StyleTrigger);
|
|
|
|
|
|
|
+ var activated = new ActivatedValue(activator, sourceInstance.Value, description);
|
|
|
|
|
+ cloned = new InstancedBinding(activated, BindingMode.OneWay, BindingPriority.StyleTrigger);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- var activated = new ActivatedValue(activator, sourceInstance.Value, description);
|
|
|
|
|
- cloned = new InstancedBinding(activated, BindingMode.OneWay, BindingPriority.StyleTrigger);
|
|
|
|
|
|
|
+ var activated = new ActivatedObservable(activator, sourceInstance.Observable ?? sourceInstance.Subject, description);
|
|
|
|
|
+ cloned = new InstancedBinding(activated, sourceInstance.Mode, BindingPriority.StyleTrigger);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|