WPF MVVM in xaml binding viewmodel in property and setting Converter

There is this demand is to pass viewmodel of several elements in the view, multibinding how to write, after a round of online search found that almost all nultibinding used mutual transfer between interface elements.

Learn about, record it

But in fact this problem very pseudo

<Button.Content>
                                                    <MultiBinding Converter="{StaticResource getRangeString}">
                                                        <Binding Path="nowQuaryCondition.ageLower"></Binding>
                                                        <Binding Path="nowQuaryCondition.ageUpper"></Binding>
                                                    </MultiBinding>
                                                </Button.Content>

Like this can be, and just need to affirm the right DataContext in front xaml file can be called directly by the Path property to the property we need

Published 19 original articles · won praise 2 · Views 5155

Guess you like

Origin blog.csdn.net/gunjiu4462/article/details/103840595