c# - System.Threading.Tasks.Task' does not contain a definition for 'Priority -
i receving error:
using following code
using system.threading.tasks; class categorieslistboxdatatemplateselector : datatemplateselector { public override datatemplate selecttemplate(object item, dependencyobject container) { frameworkelement element = container frameworkelement; if (element != null && item != null && item task) { task taskitem = item task; if (taskitem.priority == 1) return element.findresource("importanttasktemplate") datatemplate; else return element.findresource("mytasktemplate") datatemplate; } return null; } }
any idea how fix it?
the key understanding lies in description of example:
in example, binding source list of
task
objects. 1 of properties oftask
objectpriority
. there 2 data templates defined,mytasktemplate
,importanttasktemplate
.
what means in task
class in example fictional. expected provide own representation of item, , use 1 or more properties of item determine appropriate datatemplate
apply item.
Comments
Post a Comment