Browse Source
Merge pull request #11314 from workgroupengineering/fixes/CompiledBinding_Command
fix: CompiledBinding Binding Command DependsOn
pull/11330/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
3 deletions
-
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/XamlIlBindingPathHelper.cs
-
tests/Avalonia.Markup.Xaml.UnitTests/MarkupExtensions/CompiledBindingExtensionTests.cs
|
|
|
@ -701,7 +701,7 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions |
|
|
|
.GetConstructor(new() { objectType, context.Configuration.TypeSystem.GetType("System.IntPtr") })); |
|
|
|
} |
|
|
|
|
|
|
|
if (_dependsOnProperties is { Count:> 1 }) |
|
|
|
if (_dependsOnProperties is { Count:> 0 }) |
|
|
|
{ |
|
|
|
using var dependsOnPropertiesArray = context.GetLocalOfType(context.Configuration.WellKnownTypes.String.MakeArrayType(1)); |
|
|
|
codeGen |
|
|
|
|
|
|
|
@ -1690,7 +1690,7 @@ namespace Avalonia.Markup.Xaml.UnitTests.MarkupExtensions |
|
|
|
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
|
|
|
|
xmlns:local='clr-namespace:Avalonia.Markup.Xaml.UnitTests.MarkupExtensions;assembly=Avalonia.Markup.Xaml.UnitTests' |
|
|
|
x:DataType='local:MethodAsCommandDataContext'> |
|
|
|
<Button Name='button' Command='{CompiledBinding Do}' CommandParameter='{CompiledBinding Parameter, Mode=OneWay}'/> |
|
|
|
<Button Name='button' Command='{CompiledBinding Do}'/> |
|
|
|
</Window>";
|
|
|
|
var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); |
|
|
|
var button = window.FindControl<Button>("button"); |
|
|
|
@ -1963,7 +1963,7 @@ namespace Avalonia.Markup.Xaml.UnitTests.MarkupExtensions |
|
|
|
[Metadata.DependsOn(nameof(Parameter))] |
|
|
|
public bool CanDo(object parameter) |
|
|
|
{ |
|
|
|
return ReferenceEquals(null, parameter) == false; |
|
|
|
return ReferenceEquals(null, Parameter) == false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|