I want to change all my text in my application (wpf) programmatically, it works form my Grid on my mainwindow (BaseGrid) with:
private void setTextColor()
{
Color myColor = Brushes.Red;
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(BaseGrid); i++)
{
Visual childVisual = (Visual)VisualTreeHelper.GetChild(BaseGrid, i);
childVisual.Dispatcher.BeginInvoke(new Action(() =>
{
childVisual.SetValue(Label.ForegroundProperty, myColor);
}));
}
}
but when i change the "BaseGrid" for "myFrame", text in myFrame is not being changed, I load pages in them. I want to be able to change the color in the Page in myFrame the same way.
Need some help here.