-
Notifications
You must be signed in to change notification settings - Fork 49
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
docs: Add Binding to DataTemplates docs #2292
base: main
Are you sure you want to change the base?
Conversation
05314c1
to
4258557
Compare
@Mergifyio backport release/stable/4.1 |
🟠 Waiting for conditions to match
|
@dansiegel, @nickrandolph if you can give a last review before we merge please |
private Button CreateRemoveButton() => new Button() | ||
.Content("Delete") | ||
.CommandParameter(x => x | ||
.RelativeSource<Button>(RelativeSourceMode.TemplatedParent) |
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.
We have an inconsistency issue here:
RelativeSource as TemplatedParent
works on Windows but not on Uno
RelativeSource as Self
works on Uno but not on Windows
Should be fixed by unoplatform/uno#12732
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.
Uno issue: unoplatform/uno#16940
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.
@eriklimakc @dansiegel I'm not sure what this example is supposed to demonstrate? Is this supposed to be the equivalent of CommandParameter="{Binding }" in XAML?
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.
Yes I believe it is how you would accomplish CommandParameter="{Binding }"
when you are in an extracted method that doesn't have a reference to the datacontext
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.
Yes, it's to achieve what @kazo0 mentioned and in the next example we also mention the possiblity of doing .CommandParameter(x => x.Binding())
to have the same result without RelativeSource
.
@eriklimakc is this PR still needed, are we waiting on something before it can be ready to merge? |
@kazo0 this PR is waiting for the templated-parent rework that Xiao is working on unoplatform/uno#17645 to have this fixed #2292 (comment) |
This may be unblocked now that unoplatform/uno#17645 was merged. |
GitHub Issue (If applicable): closes #679
PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Internal Issue (If applicable):