none
Render a Canvas without rendering the Background RRS feed

  • Question

  • Does anyone knows how a canvas be rendered without its background property?, without setting the property to null.
    Thanks in advance
    Tuesday, August 4, 2009 6:54 PM

Answers

  • Hello Pedro,

       But i want to have that property with some value, i just don't want to render it.

       Canvas will render the background if we set it. We cannot avoid it directly.

       Based on my understanding, here are two ways you can try.

         1. Add an attached property to store the value.

         2. Create a custom Canvas can store the value but doesn't render it.

        Thanks.


    Please mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Hua Chen Tuesday, August 11, 2009 7:47 AM
    Wednesday, August 5, 2009 10:14 AM

All replies

  • You can use:

    <Canvas Background="{x:Null}">


    http://weblogs.asp.net/marianor/
    Tuesday, August 4, 2009 7:21 PM
  • But i want to have that property with some value, i just don't want to render it.
    Tuesday, August 4, 2009 11:41 PM
  • Hello Pedro,

       But i want to have that property with some value, i just don't want to render it.

       Canvas will render the background if we set it. We cannot avoid it directly.

       Based on my understanding, here are two ways you can try.

         1. Add an attached property to store the value.

         2. Create a custom Canvas can store the value but doesn't render it.

        Thanks.


    Please mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Hua Chen Tuesday, August 11, 2009 7:47 AM
    Wednesday, August 5, 2009 10:14 AM