Open hawkerm opened 3 years ago
@RealTommyKlein Is this you guys or framework?
@StephenLPeters - I'd say framework. This is a scenario gap in the framework's Binding
object when it's used in code-behind, as opposed to x:Bind
or markup features.
From initial look at this it's something hasn't worked on UWP XAML but did in WPF. Sounds like a gap in doing code-centric bindings with PropertyPaths to attached properties that's just never been filled in. I imagine the workaround is to structure the binding relationship with more code and less indirection through paths. Less sharing with markup that way though, of course.
Yeah, in code-behind we already have a typed construct for a definition of each Dependency Property already. So it'd be nice if PropertyPath
just had an overload which took a reference to the DependencyProperty like Grid.RowProperty
or whichever one we wanted to bind to. Then it'd be more strongly-typed, easy to discover and create paths, and work for both regular DP and attached properties as they use the same setup.
Describe the bug
Older issue, see threads like Stack Overflow and here
The
PropertyPath
class can't take a string that represents a custom attached property. It'd be nice if it could take a fully qualified path like(Microsoft.Toolkit.Uwp.UI.Controls.UniformGrid.AutoLayout)
sincexmlns
isn't a thing in the code-behind, which is the problem. Otherwise, it'd also be nice if you could just pass the specific DependencyProperty value in as an argument likeUniformGrid.AutoLayoutProperty
.Steps to reproduce the bug
PropertyPath
with a string for that attached property...Expected behavior Able to bind to a custom attached property in a
PropertyPath
from code-behind.Version Info
NuGet package version: WUX 19041 SDK