uwp - How to access Pivot Header Template Dynamically (i.e. using C#) -


as per @justin xl's answer question (overriding pivot header foreground brushes in uwp app) can style pivot header in xaml (as per code, below).

having done in xaml, how programmatically change (e.g. foreground) dynamically using c#?

<grid>     <pivot title="pivot">         <pivot.headertemplate>             <datatemplate>                 <grid>                     <textblock text="{binding}" foreground="teal" />                 </grid>             </datatemplate>         </pivot.headertemplate>          <pivotitem header="my first header">             <grid/>         </pivotitem>     </pivot> </grid> 

update: have 3 pivot items (tabs) , set in xaml, user can change style (foreground & background) - updating ui match changes simple enough - except pivot headers.