What is DataContext in XAML? -
please describe datacontext in xaml , when use , relationship between {binding} syntax. (with example) (in simple terms)
thank lot.
data contexts best described here. put datacontext data accessible (aka within scope of) element. example textbox might have datacontext set someobject, if bind using binding this.
<textbox datacontext={binding path=someobject} text={binding path=mystring} />
the textbox have datacontext containing values in someobject. binding performed on element (or nested elements) within scope. binding on 'text' dependency property try find value in someobject.mystring.
its important note data context passed down child elements. if datacontext set on parent , if not explicitly override on child elements children have same data context.
Comments
Post a Comment