xaml - Why is {x:Null} no longer a valid value in a Style Setter in UWP? -


a follow this question, why {x:null} no longer valid option setter.value?

put code in resource dictionary in uwp app:

<style x:key="mylist"         targettype="listview">     <setter property="transitions"              value="{x:null}"/> </style> 

and use in listview:

<listview style="{staticresource mylist}"/> 

your app crash. nasty crash well, kind takes down app without breaking in debugger.

also, designer complains catastrophic failure:

enter image description here

i know setting values {x:null} valid. if set <listview transitions="{x:null}"/> directly, works fine... expected.

so... happened style setters? ... care explain, microsoft? there @ least alternate method?

it weird behavior , overall because explained setting directly null works , style not. alternative found set clear transitioncollection:

<page.resources> <style x:key="mylist" targettype="listview">     <setter property="transitions" >         <setter.value>             <transitioncollection></transitioncollection>         </setter.value>     </setter>     <setter property="datacontext" value="{x:null}"/> </style> 

i set example of datacontext can set null, says same error compiles , works.

i know not best solution workaround have clear transitioncollection.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -