Created
January 16, 2020 14:44
-
-
Save gavilanch/ff4353df60f80f8ffa772091b57c29c6 to your computer and use it in GitHub Desktop.
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
<EditForm Model="Movie" OnValidSubmit="OnValidSubmit"> | |
<div class="form-group"> | |
<label>Genres:</label> | |
<div> | |
<MultipleSelector Selected="Selected" NoSelected="NotSelected"></MultipleSelector> | |
</div> | |
</div> | |
</EditForm> | |
@code { | |
[Parameter] public List<Genre> SelectedGenres { get; set; } = new List<Genre>(); | |
[Parameter] public List<Genre> NotSelectedGenres { get; set; } = new List<Genre>(); | |
private List<MultipleSelectorModel> Selected = new List<MultipleSelectorModel>(); | |
private List<MultipleSelectorModel> NotSelected = new List<MultipleSelectorModel>(); | |
protected override void OnInitialized() | |
{ | |
Selected = SelectedGenres.Select(x => new MultipleSelectorModel(x.Id.ToString(), x.Name)).ToList(); | |
NotSelected = NotSelectedGenres.Select(x => new MultipleSelectorModel(x.Id.ToString(), x.Name)).ToList(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment