diff --git a/src/Uno.UI/UI/Xaml/ResourceResolver.cs b/src/Uno.UI/UI/Xaml/ResourceResolver.cs index 2b78f05da23e..e9754b489711 100644 --- a/src/Uno.UI/UI/Xaml/ResourceResolver.cs +++ b/src/Uno.UI/UI/Xaml/ResourceResolver.cs @@ -189,7 +189,8 @@ internal static void ApplyResource(DependencyObject owner, DependencyProperty pr /// internal static bool ApplyVisualStateSetter(SpecializedResourceDictionary.ResourceKey resourceKey, object context, BindingPath bindingPath, DependencyPropertyValuePrecedences precedence) { - if (TryStaticRetrieval(resourceKey, context, out var value)) + if (TryStaticRetrieval(resourceKey, context, out var value) + && bindingPath.DataContext != null) { var property = DependencyProperty.GetProperty(bindingPath.DataContext.GetType(), bindingPath.LeafPropertyName); if (property != null && bindingPath.DataContext is IDependencyObjectStoreProvider provider)