7

I want to make my usercontrol with yellow background while designing. After design it should stay transparent. I've tried to use the "Ignore" flag but could not catch how it works.

<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"

Last row does not work.

Can you advice me?

Nasenbaer
  • 4,810
  • 11
  • 53
  • 86
  • Try designing your control in a tool called Expression Blend..it allows lots of quick customization to your WPF UIs and also makes use of 'd' namespace, but dont edit manually... – S2S2 Jan 04 '12 at 12:25
  • This Stack Overflow answer might help you as its similar: http://stackoverflow.com/questions/4843276/xaml-how-to-change-background-color-only-in-design-mode – S2S2 Jan 04 '12 at 12:34
  • thanks but no. I know the isInDesign property. But I wonder how to work with this Ignore "d:" flag. And you gave me the answer that is only possible with blend. Thats all I need to know. :-) – Nasenbaer Jan 04 '12 at 13:22
  • the http://schemas.microsoft.com/expression/blend/2008 namespace is supported by VS2010 upwards not sure about VS2008, however only for DesignWidth, DesignHeight and DataContext I beleive – MikeT Dec 02 '13 at 16:26

1 Answers1

8

This will work if you are using Expression blend. As you can see in your mark up

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

"d" is used only for expression blend not for visual studio.

Look at this article if you want to do the same for visual studio, you will have to do some coding for this.

Maheep
  • 5,539
  • 3
  • 28
  • 47
  • Thanks Maheep. In this case I will use your link to check out the designmode and I will no more try stuff I cannot solve :-) Great answer! – Nasenbaer Jan 04 '12 at 12:34
  • 1
    It does work in VS, but only for a few things, such as design time data. –  Jan 04 '12 at 18:51