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:
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
Post a Comment