public object Clone()
        {
            var route = new RouteModel()
            {
                Id   = Id,
                Mark = Mark,
                Name = Name
            };

            route.RailwayStations = new ObservableCollection <RailwayStationModel>(RailwayStations);
            return(route);
        }
Example #2
0
        public async Task ExecuteAsync()
        {
            _oldRoute = await _routeService.GetRouteAsync(_newRoute.Id);

            await _routeService.UpdateRouteAsync(_newRoute);
        }
Example #3
0
 public AddRouteCommand(IRouteService routeService, RouteModel routeModel)
 {
     _routeService = routeService;
     _routeModel   = routeModel.Clone() as RouteModel;
 }
Example #4
0
 public EditRouteCommand(IRouteService routeService, RouteModel newRoute)
 {
     _routeService = routeService;
     _newRoute     = newRoute.Clone() as RouteModel;
 }
Example #5
0
 public RemoveRouteCommand(IRouteService routeService, RouteModel route)
 {
     _routeService = routeService;
     _route        = route;
 }