Browse Source
Merge pull request #11158 from AvaloniaUI/onformfactor_fix
Fix OnFormFactor use in DataTemplates
pull/11193/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
src/Markup/Avalonia.Markup.Xaml/XamlIl/Runtime/XamlIlRuntimeHelpers.cs
|
|
|
@ -50,6 +50,7 @@ namespace Avalonia.Markup.Xaml.XamlIl.Runtime |
|
|
|
private readonly IServiceProvider? _parentProvider; |
|
|
|
private readonly List<IResourceNode>? _parentResourceNodes; |
|
|
|
private readonly INameScope _nameScope; |
|
|
|
private IRuntimePlatform? _runtimePlatform; |
|
|
|
|
|
|
|
public DeferredParentServiceProvider(IServiceProvider? parentProvider, List<IResourceNode>? parentResourceNodes, |
|
|
|
object rootObject, INameScope nameScope) |
|
|
|
@ -80,6 +81,12 @@ namespace Avalonia.Markup.Xaml.XamlIl.Runtime |
|
|
|
return this; |
|
|
|
if (serviceType == typeof(IAvaloniaXamlIlControlTemplateProvider)) |
|
|
|
return this; |
|
|
|
if (serviceType == typeof(IRuntimePlatform)) |
|
|
|
{ |
|
|
|
if(_runtimePlatform == null) |
|
|
|
_runtimePlatform = AvaloniaLocator.Current.GetService<IRuntimePlatform>(); |
|
|
|
return _runtimePlatform; |
|
|
|
} |
|
|
|
return _parentProvider?.GetService(serviceType); |
|
|
|
} |
|
|
|
|
|
|
|
|