wp7 silverlight canvas 在墓碑后显示黑屏
我的 wp7 应用程序中有一个屏幕,只有一个画布,用于显示图表。
我处理页面加载事件来绘制图形,通过向图形子项添加线条,这些线条存储在 App.xaml.cs 中的列表变量中。
编辑:这是我的画线功能,
private void drawLine(Line line, Point start, Point end, Color color)
{
line.X1 = start.X;
line.Y1 = start.Y;
line.X2 = end.X;
line.Y2 = end.Y;
line.Stroke = new SolidColorBrush(color);
graph.Children.Add(line);
}
我通过在设置中存储/加载线条来处理逻辑删除。
我在页面加载方法中放置了一个断点,逻辑删除后线条已正确恢复,并且线条已添加到图形画布子项中,但画布显示黑屏。
我该如何解决这个问题?
I have a screen in my wp7 app with only a canvas, used to display a graph.
I handle the page loaded event to draw the graph, by adding lines to the graph children, the lines are stored in a list variable in App.xaml.cs.
edit: here is my draw line function
private void drawLine(Line line, Point start, Point end, Color color)
{
line.X1 = start.X;
line.Y1 = start.Y;
line.X2 = end.X;
line.Y2 = end.Y;
line.Stroke = new SolidColorBrush(color);
graph.Children.Add(line);
}
I handle the tombstoning by storing/loading the lines in the settings.
I placed a breakpoint in the page loaded method, the lines are restored correctly after tombstoning, and the lines are added to the graph canvas children, yet the canvas displays a black screen.
How do i solve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然从代码中不清楚如何存储或重新创建数据/线,但在逻辑删除期间存储的数据应该是包含起点、终点和颜色的对象的集合。
每次向图表/画布添加一条线时,您都应该创建新线。
While it's not clear from your code how you're storing or recreating the data/lines the data you store during tombstoning shoudl be a collection of objects containing the start point, end point and color.
You should be creating new lines each time you are adding a line to your graph/canvas.