locked
Path Doesn't Render on Canvas in Designer RRS feed

  • Question

  • I hope this turns out to be a stupid question but...

    I'm designing a Silverlight 4.0 application in Visual Studio 2010.  When I add a Path to a Canvas, it does not render in the designer, although it does appear if I run the project.  Is there any way to get the path to render at design time?  This seems very basic.

    I am appending some sample XAML that demonstrates the problem.  In the design environment, the path renders correctly in the StackPanel but not in the Canvas.  However, the Rectangle (which also derives from Shape) displays correctly on the Canvas, even in design mode.

    Some additional (possibly meaningful?) details... The WPF designer handles the XAML correctly and I can get the Path to render in the Silverlight designer if I set explicit width and height values (not a viable option for my real application). 

     Thanks!

    -JLS

     Sample XAML: 

    <UserControl x:Class="CanvasPath.MainPage"
    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="300" d:DesignWidth="400">
    <StackPanel>
    <Path Stroke="Black" Fill="Gray" Data="M 10,100 C 10,300 300,-200 300,100" />
    <Canvas>
    <Path Stroke="Black" Fill="Gray" Data="M 10,100 C 10,300 300,-200 300,100" />
    <Rectangle Fill="Red" Width="100" Height="100" Canvas.Top="25"/>
    </Canvas>
    </StackPanel>

    </UserControl>
     
    Tuesday, June 1, 2010 4:09 PM

Answers

  • Hi,

    Thanks for reporting the issue. Right now I would suggest you using Expression Blend to deal with the issue, please feel free to report the bug on http://connect.microsoft.com/visualstudio, thank you very much.

    Sorry for any inconvenience caused by the issue.

    Wednesday, June 2, 2010 10:59 PM

All replies

  • I've had this same issue. The path renders fine in Blend but doesn't show up at all in VS2010. Its parent is a Canvas. I've used Paths elsewhere but either in a Grid or as a direct child of UserControl and the designer shows those without any issue.

    Tuesday, June 1, 2010 4:16 PM
  • Hi,

    Thanks for reporting the issue. Right now I would suggest you using Expression Blend to deal with the issue, please feel free to report the bug on http://connect.microsoft.com/visualstudio, thank you very much.

    Sorry for any inconvenience caused by the issue.

    Wednesday, June 2, 2010 10:59 PM