Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6202057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:39:56+00:00 2026-05-24T04:39:56+00:00

Here is the App.xaml: <Application> <Application.Resources> <ResourceDictionary> <Style TargetType=Window> <Setter Property=SnapsToDevicePixels Value=True/> <Setter Property=Background

  • 0

Here is the App.xaml:

<Application>
<Application.Resources>
    <ResourceDictionary>
        <Style TargetType="Window">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
        </Style>
    </ResourceDictionary>
</Application.Resources>
</Application>

I also have the MainWindow.xaml. When viewed in Design mode in VS, it’s background is, indeed, gray, as it should be. Anyway, when application is running, the window’s background is default white.

Why?

How to fix this? I want all windows to have the standard background by default.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:39:57+00:00Added an answer on May 24, 2026 at 4:39 am

    Following up on the answer from CodeNaked, you’ll have to create a Style for every Window you have, but you can use the same style for all of them with BasedOn like this

    <Application.Resources>
        <ResourceDictionary>
            <Style TargetType="Window">
                <Setter Property="SnapsToDevicePixels" Value="True"/>
                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
            </Style>
            <Style TargetType="{x:Type local:MainWindow}"
                   BasedOn="{StaticResource {x:Type Window}}"/>
            <Style TargetType="{x:Type local:SomeOtherWindow}"
                   BasedOn="{StaticResource {x:Type Window}}"/>
            <!-- Add more Windows here... -->
        </ResourceDictionary>
    </Application.Resources
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is defined in App.xaml inside <Application.Resources> : <Style x:Key=borderStyle TargetType=Border> <Style.Triggers> <Trigger Property=IsMouseOver
I define DisplayHeight in my App.xaml file here: <Application.Resources> <sys:Int32 x:Key=DisplayHeight>534</sys:Int32> </Application.Resources> I try
I am setting a style for the Window in the App.xaml like such: <Application
I have the following set of code in my App.xaml: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary
I have a App.xaml template : <Application.Resources> <!-- template for recent history --> <DataTemplate
I have a question here regarding iPhone app submission. I have a free application
Here's the line from App.Config: <add key=CheckFileFormatString value=P{0}\t&quot;{1}, {2}&quot;\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}/> Here's the code that puts
Here's part of my Django app's models.py : class Person(models.Model): birth_year = WideYear(null=True, blank=True)
Hello, how to go from: <Application xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=teste.App> <Application.Resources> <!-- Resources scoped at
In App.xaml I have the following code: <Application xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=FJW.App> <Application.Resources> <!-- Resources

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.