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

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

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