Last active
November 6, 2018 15:17
-
-
Save PadreSVK/0c04fb117fa3f55b44ef59e72346780b to your computer and use it in GitHub Desktop.
Project detail before add change manager functionality
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@viewModel DotVVM.Samples.NestedViewModel.ViewModels.Projects.ProjectDetailViewModel, DotVVM.Samples.NestedViewModel | |
@masterPage Views/MasterPage.dotmaster | |
<dot:Content ContentPlaceHolderID="MainContent"> | |
<div DataContext="{value: Project}"> | |
<h1 InnerText="{value: Title}" /> | |
<small InnerText="{value: Manager.FullName}" /> | |
<p InnerText="{value: Description}" /> | |
</div> | |
</dot:Content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DotVVM.Framework.ViewModel; | |
using DotVVM.Samples.NestedViewModel.DAL.Entities; | |
using DotVVM.Samples.NestedViewModel.Services; | |
using Task = System.Threading.Tasks.Task; | |
namespace DotVVM.Samples.NestedViewModel.ViewModels.Projects | |
{ | |
public class ProjectDetailViewModel : MasterPageViewModel | |
{ | |
private readonly ProjectService _projectService; | |
public ProjectDetailViewModel(ProjectService projectService) | |
{ | |
_projectService = projectService; | |
} | |
[FromRoute(nameof(Id))] public int Id { get; set; } | |
public Project Project { get; set; } | |
public override Task Load() | |
{ | |
if (!Context.IsPostBack) | |
{ | |
Project = _projectService.GetById(Id); | |
} | |
return base.Load(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment