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 of task object priority. 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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -