开发者

Visual studio 2010 WPF/Silverlight designer default background

开发者 https://www.devze.com 2023-02-20 18:28 出处:网络
Is there a way to change the default background of WPF/Silverlight designer (Cider)? Or maybe some \"IsInDesignMode\"/ignorable hack to do so.

Is there a way to change the default background of WPF/Silverlight designer (Cider)? Or maybe some "IsInDesignMode"/ignorable hack to do so.

The problem is, I have transparent backgroun开发者_如何学编程ds in my user controls, my texts are mostly white (my shell is dark). And I don't see them in designer.


.First, you should create yourself an IsDesignMode:

static public class ApplicationExtensions
{
    public static bool IsDesignMode(this Application app)
    {
        return System.ComponentModel.DesignerProperties.GetIsInDesignMode(app.RootVisual);
    }
}

Now, in your control's constructor, after the InitalizeComponents call, try something like:

if (Application.IsDesignMode)
   LayoutRoot.Background = Colors.Black; // Or whatever control
0

精彩评论

暂无评论...
验证码 换一张
取 消