コード例 #1
0
 internal void AppendPoint(PointViewModel newPoint)
 {
     if (newPoint != null)
     {
         Model.Append(newPoint.Model);
     }
 }
コード例 #2
0
        //public bool DrawLabels { get; set; }


        internal void RemovePoint(PointViewModel selected)
        {
            if (selected != null)
            {
                var index = selected.Parent.Children.IndexOf(selected);
                if (index >= 0)
                {
                    selected.Parent.Children.RemoveAt(index);
                    Model.RemoveAt(index);
                }
            }
        }
コード例 #3
0
        public EditPointWindow(PointViewModel point)
        {
            InitializeComponent();
            this.Point = point;
            if (point != null)
            {
                txtLatitude.Text  = point.Latitude.ToString();
                txtLongitude.Text = point.Longitude.ToString();
            }

            Loaded += new RoutedEventHandler(EditPointWindow_Loaded);
        }
コード例 #4
0
        private void AddNewPoint()
        {
            var pointSet = GetSelectedPointSet();

            if (pointSet != null)
            {
                var newPoint  = new MapPoint();
                var viewModel = new PointViewModel(newPoint);
                var frm       = new EditPointWindow(viewModel);
                frm.Owner = this.FindParentWindow();
                frm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                if (frm.ShowDialog() == true)
                {
                    pointSet.Children.Add(viewModel);
                    pointSet.AppendPoint(viewModel);
                    viewModel.Parent     = pointSet;
                    viewModel.IsSelected = true;
                }
            }
        }
コード例 #5
0
        private void AddPointSet(MapPointSet set)
        {
            var viewModel = new PointSetViewModel(set);

            _model.Add(viewModel);
            var killlist = new List <PointViewModel>();

            foreach (MapPoint p in set)
            {
                var childVM = new PointViewModel(p);
                childVM.Parent = viewModel;
                viewModel.Children.Add(childVM);
                if (p.Latitude == 0 && p.Longitude == 0)
                {
                    killlist.Add(childVM);
                }
            }

            foreach (PointViewModel p in killlist)
            {
                viewModel.RemovePoint(p);
            }
        }
コード例 #6
0
 private void RemovePoint(PointViewModel point, MapPointSet set)
 {
 }