windows phone 8 toolkit contextmenu change menuitem header text dynamically
MenuItem item = menu.FindName("ContextMenuItemToggleReporting") as MenuItem;// .Single(i=>((MenuItem)item).Name == "ContextMenuItemToggleReporting") as MenuItem;
if ([you condition logic here. e.g. MyEntity.IsReportingEnabled])
{
item.Header = "Disable Reporting";
}
else
{
item.Header = "Enable Reporting";
}
No comments:
Post a Comment