ScheduleCanvas.cs 1.05 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;

namespace RoboforkApp
{
    public class ScheduleCanvas : Canvas
    {
        // Add variable for Set Schedule
        private Path pScheduleNode = new Path();
        private Path pScheduleLine = new Path();
        private GeometryGroup gGrpScheduleNode = new GeometryGroup();
        private GeometryGroup gGrpScheduleLine = new GeometryGroup();

        public void DrawRoute(List<ucNode> listNode)
        {
            //Update after
        }

        private void CreateNode(Point point, int indexNode)
        {
            ucNode _ucNode = new ucNode();
            _ucNode.btnWidth = 20.0;
            _ucNode.btnHeight = 20.0;
            _ucNode.txtNode = indexNode.ToString();
            Canvas.SetLeft(_ucNode, point.X);
            Canvas.SetTop(_ucNode, point.Y);
            this.Children.Add(_ucNode);
        }
    }
}