开发者

Visual Studio Silverlight Control Editor Weird Lines in design view

开发者 https://www.devze.com 2023-03-28 15:07 出处:网络
While designing Silverlight UI, I occasionaly encounter some weird lines of an unknown origin in the designer canvas. It is shown below:

While designing Silverlight UI, I occasionaly encounter some weird lines of an unknown origin in the designer canvas. It is shown below:

Visual Studio Silverlight Control Editor Weird Lines in design view

I cannot click on it (nothing happens), there's no way to select it, and there is nothing that is supposed to be there too. Those 'phantom' lines started to appear after integrating a big UserControl (which is itself a SL 4 application with its own project before) by referencing the other project from my main project. As soon as I've added the control just like any other UI element to the XAML, I've started gettings these lines. If I remove the control, they also disappear. The lines also appear ONLY when I open the MainPage.xaml for开发者_Python百科 the first time. As long as I click on anything in the canvas, or change something, zoom etc. (probably anything that would force a redraw of the canvas) the lines go away and don't come back until I close the MainPage.xaml's tab and reopen it from the beginning. While I'm not irritated a lot by the lines, I think they are a possible indicator of something going wrong, especially with initialization/drawing of the controls. The Silverlight, including the 'bogus' control, runs fine though.

What could be the cause, as I'm pretty sure there's something with the initialization of that other control, possibly some code that I have in that control. And lastly, yes, it DOES look like something's margins are off, but I've checked that, everything's ok.

PS: All the solution HAS been cleared and rebuilt several times.


I see you are using a tab like control there :-) I've run into something similar with a wizard-type control.

This is most likely an issue with the design experience of that control. Basically, Visual Studio is trying to outline controls in another tab (or my case wizard page), when they are no longer visible. This generally occurs when the selection is changed.

I worked with Microsoft on a resolution, which was extremely convoluted. Ultimately, they sent over code from their WPF TabControl which I was able to copy.

This was introduced in Visual Studio 2010 because it's designer was overhauled to support both WPF and Silverlight. In Visual Studio 2008, the designer could hook into the elements being designed and detect when the selection/layout changed.

If you are the control developer, I'd recommend you contact Microsoft as I can't distribute that code. If not, I'd recommend you contact the control developer.

0

精彩评论

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