开发者

Points saved to be passed to Another .xaml page and display on canvas.children

开发者 https://www.devze.com 2023-03-29 13:48 出处:网络
using System; using System.Collections.Generic; using System.Collections.Generic; using System.Linq; using System.Net;
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 <Poin开发者_JAVA百科t> _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();
    }
}
}

So i need to be able to pass all the points in the list and re-draw them on the next page on a canvas, how would i go about doing that without altering to much code that i have already?


Create a static class shared by the pages and place the object in it

0

精彩评论

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

关注公众号