I am trying to create a WPF control at runtime, but I can't figure out how to make it ignore the styles coming from the App.xml resources. I've tried setting the style to null and the OverridesDefaultStyle to true but no luck. The app settings set the foreground to white, and I can't seem to explicity set it to anything else.
Label tb = new Label();
tb.OverridesDefaultStyle = true;
tb.Style = null;
tb.Foreground = new SolidColorBrush(Colors.Black);
this.Children.Add(tb);
Edit: For some reason I never could get the Label to work but when I switched to the textbox, it worked fine.
Thank you for your responses.