-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(FrameworkElement): [macOS] Ensure we set parent to a DependencyObject #5183
Conversation
_superViewRef = new WeakReference<NSView>(superView); | ||
SyncBinder(superView, newWindow); | ||
((IDependencyObjectStoreProvider)this).Store.Parent = superView; | ||
_superViewRef = new WeakReference<NSView>(parent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not sure about what should be set here, the "real" Superview or the ancestor that we may have found that is a DependencyObject
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure either - it only seems to be checked here, and TBH I'm not clear on what the intent of the check is.
Any thoughts @jeromelaban ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An actual dependency object should be set, otherwise the DependencyObjectStore may not be able to traverse to the root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But even for the _superViewRef
? We shouldn't set that to the actual Superview regardless of it being a DependencyObject?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kazo0 I would leave it as you have it, setting it to parent
(the actual dependency object), but I'm still not sure what the check is even for.
The build 24574 found UI Test snapshots differences: Details
|
_superViewRef = new WeakReference<NSView>(superView); | ||
SyncBinder(superView, newWindow); | ||
((IDependencyObjectStoreProvider)this).Store.Parent = superView; | ||
_superViewRef = new WeakReference<NSView>(parent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An actual dependency object should be set, otherwise the DependencyObjectStore may not be able to traverse to the root.
@@ -103,6 +105,26 @@ namespace <#= mixin.NamespaceName #> | |||
this.Log().Error($"Failed to process MoveToWindow for {GetType()}", e); | |||
} | |||
} | |||
|
|||
private static DependencyObject GetDependencyObjectAncestor(NSView firstGuess) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's FindFirstParent<DependencyObject>()
that does this.
7190e00
to
81bb0b3
Compare
The build 24592 found UI Test snapshots differences: Details
|
The build 24592 found UI Test snapshots differences: Details
|
_superViewRef = new WeakReference<NSView>(superView); | ||
SyncBinder(superView, newWindow); | ||
((IDependencyObjectStoreProvider)this).Store.Parent = superView; | ||
_superViewRef = new WeakReference<NSView>(parent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kazo0 I would leave it as you have it, setting it to parent
(the actual dependency object), but I'm still not sure what the check is even for.
closes unoplatform/Uno.Gallery#129
closes unoplatform/Uno.Gallery#130
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Bindings are not propagated properly when using a ScrollViewer since the FrameworkElement Implementation of
ViewDidMoveToWindow
tries to set theWhat is the new behavior?
Bindings are properly propagated
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.