Browse Source
Merge pull request #1760 from AvaloniaUI/fixes/1754-setter-bindingmode-default
Allow BindingMode.Default in Setter bindings.
pull/1761/head
danwalmsley
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
9 deletions
-
src/Avalonia.Styling/Styling/Setter.cs
|
|
|
@ -158,18 +158,11 @@ namespace Avalonia.Styling |
|
|
|
var activated = new ActivatedObservable(activator, sourceInstance.Observable, description); |
|
|
|
return InstancedBinding.OneWay(activated, BindingPriority.StyleTrigger); |
|
|
|
} |
|
|
|
case BindingMode.OneWayToSource: |
|
|
|
{ |
|
|
|
var activated = new ActivatedSubject(activator, sourceInstance.Subject, description); |
|
|
|
return InstancedBinding.OneWayToSource(activated, BindingPriority.StyleTrigger); |
|
|
|
} |
|
|
|
case BindingMode.TwoWay: |
|
|
|
default: |
|
|
|
{ |
|
|
|
var activated = new ActivatedSubject(activator, sourceInstance.Subject, description); |
|
|
|
return InstancedBinding.TwoWay(activated, BindingPriority.StyleTrigger); |
|
|
|
return new InstancedBinding(activated, sourceInstance.Mode, BindingPriority.StyleTrigger); |
|
|
|
} |
|
|
|
default: |
|
|
|
throw new NotSupportedException("Unsupported BindingMode."); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|