Reputation: 1341
I want to define a grid style in the app.xaml, including the background color. However, setting the color there, makes the whole content instantly invisible.
When application is executed, the following appears:
For a short moment, the button is visible. How do I prevent this from happening, keeping in mind, that I wish a global background color for grids.
Upvotes: 2
Views: 282
Reputation: 7325
You can use a global style for the Grid
as you have done it.
The issue you have faced comes from Visual Studio. So the issue is only present, if you start the application via Visual Studio.
To give the possibility for live tracking of UI-Elements the VS seems to add an AdornerLayerWindow
, which, I suppose, also uses a Grid
, which you see. You can find this window in Application.Current.Windows
.
To get rid of this behaviour you have to deactivate option Options->Debugging->UI-Tools for XAML activate
Upvotes: 2