コード例 #1
0
        public void OnTriangleAdded(object sender, TriangleEventArgs args)
        {
            TriangleListItemViewModel viewModel = new TriangleListItemViewModel {
                Triangle = args.Triangle
            };

            TriangleListItems.Add(viewModel);
        }
コード例 #2
0
        public override void Start()
        {
            List <Triangle> triangles = _TrianglesRepo.GetTriangles();

            TriangleListItems = CreateListViewModelsFromTriangeList(triangles);
            SelectedTriangleListItemViewModel = TriangleListItems.FirstOrDefault();

            _TrianglesRepo.TriangleAdded += OnTriangleAdded;
        }
コード例 #3
0
 public void RemoveSelectedTriangle()
 {
     if (SelectedTriangleListItemViewModel != null)
     {
         var viewModelToDelete = SelectedTriangleListItemViewModel;
         SelectedTriangleContentViewModel = null;
         _TrianglesRepo.RemoveTriangle(viewModelToDelete.Triangle);
         TriangleListItems.Remove(viewModelToDelete);
     }
 }