c# - Bind property to method -


i developing windows 8 app in c# , using databinding

<collectionviewsource     x:name="departments"     source="{binding departments}"     d:source="{binding allgroups, source={d:designinstance type=data:department, isdesigntimecreatable=true}}"/> 

i can bind properties of class ui, class has method need

public string getprofessorslist() 

i able bind method this...

<textblock text="{binding getheads()}" fontsize="18" /> 

...but not allowed. how can acheve functionality?

try adding getter-property returns method:

public string professorslist { { return this.getprofessorslist(); } } 

and bind property:

<textblock text="{binding professorslist}" fontsize="18" /> 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -