Skip to content

Creating Bindings in Code with Complex Path including Attached Property #18355

Answered by EldHasp
EldHasp asked this question in Q&A
Discussion options

You must be logged in to vote

I found a solution using NuGet package System.Reactive.Linq:

// <Button Command="{Binding $self.(root:Helper.CommandVM).InsertFrameCommand}"/>
btn.Bind(Button.CommandProperty, btn.GetObservable(Helper.CommandVMProperty)
                                    .Select(vm => vm?.InsertFrameCommand)
                                    .ToBinding());

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@EldHasp
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by EldHasp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants