Open UsuarioBeta opened 3 years ago
Can confirm this is happening in .NET 4.8, consistently when trying to set either Triggers or Behaviors on a DataGrid. I'm wondering if this is caused by the fact that both Triggers
and Behaviors
(Their properties in Interaction.cs
), are private or the fact that the name supplied to them is ShadowTriggers
and ShadowBehaviors
? I've only just started looking into this as it is a major blocker.
Experiencing similar issues; unable to load class, where my attached property is declared, etc. From the same assembly, as at least one other issue, temporary projects, etc, have supposedly addressed.
At least in my case, I really am loathe to introduce yet another project to salve the issue, which is leading to somewhat of a wide footprint 3P dependencies, albeit somewhat mission critical, i.e. SkiaSharp
, SKElement
(WPF views), etc, as the error is already in kind of a building block layer to begin with, in the overall solution scheme of things.
Does the bug reproduce also in WPF for .NET Framework 4.8?: Inconsistently
Problem description: Loading a XAML resource using Application.LoadComponent will, in some situations, throw an exception when the XAML resource contains an AttachedProperty somewhere inside it.
This is a quick summary of how this issue was found and the attempts made to narrow it's source:
The issue was first encountered in a F# WPF application while adding a Interaction.Behaviors (from microsoft/XamlBehaviorsWpf) to a custom Control.
Upon inquiry to the aforementioned XamlBehaviorsWpf GitHub (here), it was determined that this issue was reproducible in C# and reproducible using a simple dummy attached property.
While trying to determine whether this issue was reproducible in both .NET Core 3.0 and .NET Framework 4.8, I found that it may be actually something more subtle causing this exception to be thrown, as it would inconsistently occur between F# and C#, between .NET Core 3.0 and .NET Framework 4.8 and between Interaction.Triggers and a dummy AttachedProperty. These attempts are all included in the repro solution, and I tried to make it easy to understand both the attempt and the result. This is a summary:
C# Project, .NET Core 3.0, Dummy AttachedProperty: Fails
C# Project, .NET Framework 4.8, Dummy AttachedProperty: Passes
F# Project, .NET Core 3.0, Dummy AttachedProperty: Passes
F# Project, .NET Framework 4.8, Dummy AttachedProperty: Passes
C# Project, .NET Core 3.0, Interactions.Triggers: Passes
C# Project, .NET Framework 4.8, Interactions.Triggers: Passes
F# Project, .NET Core 3.0, Interactions.Triggers: Fails
F# Project, .NET Framework 4.8, Interactions.Triggers: Fails
microsoft/XamlBehaviorsWpf is written in C#.
Actual behavior:
Expected behavior: The resource to be loaded correctly, without throwing exceptions. Minimal repro: ReproWithBasicProperty.zip