c# - Compiled Binding to IsChecked checkbox -


i've got checkboxes in list i'm trying use compiled binding bind ischecked propertie...

so tried this:

<datatemplate x:datatype="local:rdo">      <stackpanel orientation="horizontal">         <checkbox content="{x:bind content}" ischecked="{x:bind check}"/>      </stackpanel> </datatemplate> 

and model class this:

class rdo {     public string content { get; set; }     public boolean check { get; set; } } 

but doesn't work , return error saying

severity code description project file line error invalid binding path 'check' : cannot bind type 'system.boolean' 'system.nullable(system.boolean)' without converter

how fix this?

and what's difference between boolean , nullable(boolean)?

your model must implement property check like

 class rdo { public string content { get; set; } public boolean? check { get; set; } } 

see ? on boolean? ? nullable wrapper value types (struct) these can have value of null (which value types cannot have default). requirement in particular case use binding functionality.

for further studies:

https://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -