wpf - Explicitly setting/ignoring visibility at design-time in VS2013? -


i'm designing form complex backing model in wpf. of form controls rely on multiple options being set on underlying view model, i've set example

<textblock.visibility>   <multibinding converter="{staticresource andmultivaluevisibilityconverter}">     <binding path="relevantsystemoption" />     <binding path="relevantlicensekeyoption"/>   </multibinding> </textblock.visibility> 

andmultivaluevisibilityconverter takes booleans , makes visible if they're true, reference.

this turns control's visibility off @ design time, don't want.

i'm aware of ability of expression blend , design-time attributes make layout determinations can ignored @ run-time. d:ishidden isn't being respected, , d:layoutoverrides doesn't work on visibility since it's dynamic property.

i'd rather not dummy entire backing model d:datacontext. if have to, there easier way force particular control , maybe handful of others visible @ design-time?

just use

designerproperties.getisindesignmode(new dependencyobject()) 

in multivalue converter determine if you're in designer and, if so, return true.

it's okay use in converter in mvvm application, if think might go against pattern. converter ui concern.

https://msdn.microsoft.com/en-us/library/system.componentmodel.designerproperties(v=vs.110).aspx


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -