protected override DriverResult Editor(RedirectRoutesPart part, dynamic shapeHelper) { return(ContentShape("Parts_RedirectRoutesPart_Edit", () => { var vm = new RedirectRouteViewModel(); vm.MainPath = part.Has <AutoroutePart>() ? part.As <AutoroutePart>().Path : ""; vm.Routes = part.Routes; return shapeHelper.EditorTemplate( TemplateName: "Parts/RedirectRoutesPart", Model: vm, Prefix: Prefix); })); }
protected override DriverResult Editor(RedirectRoutesPart part, IUpdateModel updater, dynamic shapeHelper) { var vm = new RedirectRouteViewModel(); if (updater.TryUpdateModel(vm, Prefix, null, null)) { if (part.Routes != vm.Routes) { part.OldRoutes = vm.Routes; } part.Routes = vm.Routes; } return(Editor(part, shapeHelper)); }