C# 保存以传递到另一个.xaml页面并显示在canvas.children上的点 使用系统; 使用System.Collections.Generic; 使用System.Collections.Generic; 使用System.Linq; Net系统; 使用System.Windows; 使用System.Windows.Controls; 使用System.Windows.Documents; 使用System.Windows.Input; 使用System.Windows.Media; 使用System.Windows.Media.Animation; 使用System.Windows.Shapes; 使用Microsoft.Phone.Controls; 命名空间MobileLite { 公共部分类签名:PhoneApplicationPage { 绘制专用多段线; 私有列表_points=新列表(); 公共签名() { 初始化组件(); } 私有void Canvas_操纵已完成(对象发送方,System.Windows.Input.操纵已完成事件参数e) { //在这里,我们只想将点信息添加到我们需要的点列表中 //正在捕获,以便稍后在需要时重新绘制。 foreach(点p in_点) { _ToList(); } //_点。添加(_linebeingdrawing.points); } 私有void Canvas_操纵delta(对象发送方,System.Windows.Input.操纵deltaeventargs e) { //这里,我们将向创建并作为子对象添加的多段线添加新点 //在上面启动的事件中 _linebeingdrawing.Points.Add(新点(e.ManipulationOrigin.X,e.ManipulationOrigin.Y)); } private void Canvas_manipationstarted(对象发送方,System.Windows.Input.manipationstartedeventargs e) { //在这里,我们想开始我们的新画线,我们想 //将多段线作为子项添加到SignatureCanvas。 _LineBeingDrawed=新多段线 { 笔划=新的SolidColorBrush(颜色为黑色), 冲程厚度=6.5, 点=新点集合{新点(e.ManipulationOrigin.X,e.ManipulationOrigin.Y)} }; 签名canvas.Children.Add(_linebeingdrawing); } 私有无效按钮\u单击(对象发送者,路由目标e) { //提交按钮点击处理 } 私有无效按钮\u单击\u 1(对象发送者,路由目标) { SignatureCanvas.Children.Clear(); } } }

C# 保存以传递到另一个.xaml页面并显示在canvas.children上的点 使用系统; 使用System.Collections.Generic; 使用System.Collections.Generic; 使用System.Linq; Net系统; 使用System.Windows; 使用System.Windows.Controls; 使用System.Windows.Documents; 使用System.Windows.Input; 使用System.Windows.Media; 使用System.Windows.Media.Animation; 使用System.Windows.Shapes; 使用Microsoft.Phone.Controls; 命名空间MobileLite { 公共部分类签名:PhoneApplicationPage { 绘制专用多段线; 私有列表_points=新列表(); 公共签名() { 初始化组件(); } 私有void Canvas_操纵已完成(对象发送方,System.Windows.Input.操纵已完成事件参数e) { //在这里,我们只想将点信息添加到我们需要的点列表中 //正在捕获,以便稍后在需要时重新绘制。 foreach(点p in_点) { _ToList(); } //_点。添加(_linebeingdrawing.points); } 私有void Canvas_操纵delta(对象发送方,System.Windows.Input.操纵deltaeventargs e) { //这里,我们将向创建并作为子对象添加的多段线添加新点 //在上面启动的事件中 _linebeingdrawing.Points.Add(新点(e.ManipulationOrigin.X,e.ManipulationOrigin.Y)); } private void Canvas_manipationstarted(对象发送方,System.Windows.Input.manipationstartedeventargs e) { //在这里,我们想开始我们的新画线,我们想 //将多段线作为子项添加到SignatureCanvas。 _LineBeingDrawed=新多段线 { 笔划=新的SolidColorBrush(颜色为黑色), 冲程厚度=6.5, 点=新点集合{新点(e.ManipulationOrigin.X,e.ManipulationOrigin.Y)} }; 签名canvas.Children.Add(_linebeingdrawing); } 私有无效按钮\u单击(对象发送者,路由目标e) { //提交按钮点击处理 } 私有无效按钮\u单击\u 1(对象发送者,路由目标) { SignatureCanvas.Children.Clear(); } } },c#,windows-phone-7,C#,Windows Phone 7,因此,我需要能够传递列表中的所有点,并在画布上的下一页上重新绘制它们,我将如何在不修改现有代码的情况下进行此操作?创建一个由页面共享的静态类,并将对象放在其中 using System; using System.Collections.Generic; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls

因此,我需要能够传递列表中的所有点,并在画布上的下一页上重新绘制它们,我将如何在不修改现有代码的情况下进行此操作?

创建一个由页面共享的静态类,并将对象放在其中

using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace MobileElite
{
public partial class signature : PhoneApplicationPage
{
    private Polyline _lineBeingDrawn;
    private List <Point> _points = new List<Point>();  
    public signature()
    {
        InitializeComponent();
    }

    private void Canvas_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
    {
        // Here we want to simply add the points information to the list of points we  
        // are capturing in order to redraw this later if needed.  
        foreach (Point p in _points)
        {
            _points.ToList<Point>(); 
        }
        //_points.Add(_lineBeingDrawn.Points);
    }

    private void Canvas_ManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
    {
         // Here we are adding new points to the PolyLine we created and added as a child   
        // in the Started event above  
        _lineBeingDrawn.Points.Add(new Point(e.ManipulationOrigin.X, e.ManipulationOrigin.Y));
    }

    private void Canvas_ManipulationStarted(object sender, System.Windows.Input.ManipulationStartedEventArgs e)
    {
        // Here we want to start our new line for drawing and we want to   
        // add the polyline as a child item to the SignatureCanvas.  
        _lineBeingDrawn = new Polyline
        {
            Stroke = new SolidColorBrush(Colors.Black),
            StrokeThickness = 6.5,
            Points = new PointCollection { new Point(e.ManipulationOrigin.X, e.ManipulationOrigin.Y) }
        };


        SignatureCanvas.Children.Add(_lineBeingDrawn);
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        //Submit Button Click Handling

    }

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        SignatureCanvas.Children.Clear();
    }
}
}