2012-01-04 50 views
7

我要讓我的用戶用黃色背景而設計。設計之後,它應該保持透明。 我試圖使用「忽略」標誌,但無法捕捉它的工作原理。如何使用可忽略=「d」

<UserControl x:Class="Abnehmen_Standard.ucRoundButton" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    d:DesignHeight="84" d:DesignWidth="84" 
    d:Background="Yellow" 

最後一行不起作用。

你能不能指點我?

+0

嘗試設計一個工具,稱爲表達Blend..it允許大量快速定製你的WPF的UI,也使得使用「d」命名空間的你的控制,但不要手動編輯... – VS1 2012-01-04 12:25:43

+0

謝謝您的回答。這有幫助! – Nasenbaer 2012-01-04 12:34:08

+0

這個堆棧溢出的回答可以幫助你爲它的相似: http://stackoverflow.com/questions/4843276/xaml-how-to-change-background-color-only-in-design-mode – VS1 2012-01-04 12:34:48

回答

8

這將如果您正在使用Expression Blend的工作。正如您在標記中看到的那樣

xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 

「d」僅用於表達式混合而不用於visual studio。

this article如果你想爲Visual Studio這樣做,你將不得不做一些編碼此。

+0

感謝Maheep。在這種情況下,我將使用您的鏈接查看設計模式,我將不再嘗試我無法解決的問題:-)好的答案! – Nasenbaer 2012-01-04 12:34:58

+1

它可以在VS中工作,但只適用於一些事情,比如設計時間數據。 – Will 2012-01-04 18:51:29