wpf - Does StringFormat work with this.DataContext -
i binding textblock collection in code-behind via this.datacontext = sellerlist; output correct when apply stringformat, see no result. following code textblock on xaml page <textblock name="datedtkey" grid.row="1" grid.column="2" horizontalalignment="right" verticalalignment="bottom" text="{binding path=date, stringformat={}{0:dd-mm-yyyy}}" style="{staticresource textstyletextblock}"/> the source binding string, if detailssellerlistingtemplate resource should use {staticresource detailssellerlistingtemplate} . also, textblock doesn't need datacontext binding work since it's using source. <window.resources> <local:detailsseller x:key="detailssellerlistingtemplate"/> </window.resources> <textblock name="datedtkey" horizontalalignment="right" verticalalignment="bottom" text=...