c# - Use Binding in Resource without styles -


this question has answer here:

i have multibinding defined follows:

<multibinding stringformat="{0}_{1}">     <binding path="..." />     <binding path="..." /> </multibinding> 

i need use in multiple places, , want define in resources, as:

<multibinding x:name="mydefaultbinding" stringformat="...">     <!-- etc --> </multibinding> 

however, cannot work out how use it. tried staticresource like:

<textblock text="{staticresource mydefaultbinding}"             style="{staticresource someotherstyle}" /> 

this gave me compile error: "invalid resource type: expected type 'string', actual type 'multibinding'.".

when tried access using binding like:

<textblock text="{binding source={staticresource mydefaultbinding}}"             style="{staticresource someotherstyle}" /> 

it compiles, @ runtime text in textblock set "system.windows.data.multibinding" instead of expected value.

i've seen suggestions propose wrapping multibinding in style, have other shared styles defined on controls need use binding.

can evalute binding defined in resources without wrapping in style?

you can't reuse binding resource as-is create markup extension applies resource suggested here:

binding resource


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -