private void RenderItem() { var item = new BlockViewKnowledgeLanguage(); item.Language = Languages.Single(l => l.IdLanguage == (int)SelectedIdLanguage); item.LanguageProficiency = LanguageProficiencies.Single(l => l.IdLanguageProficiency == (int)SelectedIdLanguageProficiency); item.VerticalAlignment = VerticalAlignment.Top; item.MinWidth = Grid.ActualWidth - 20; item.MaxWidth = Grid.ActualWidth - 20; item.Width = Grid.ActualWidth - 20; item.Margin = new Thickness(10, 10 + (60 * Items.Count), 10, 0); item.Remove = Remove; Grid.Children.Add(item); Items.Add(item); UpdateListSelectedValues(); }
private void GenerateItems() { for (int i = 0; i < SelectedKnowledgeLanguages.Count; i++) { var item = new BlockViewKnowledgeLanguage(); item.Language = Languages.Single(l => l.IdLanguage == (int)SelectedKnowledgeLanguages[i].IdLanguage); item.LanguageProficiency = LanguageProficiencies.Single(l => l.IdLanguageProficiency == (int)SelectedKnowledgeLanguages[i].IdLanguageProficiency); item.VerticalAlignment = VerticalAlignment.Top; item.MinWidth = Grid.ActualWidth - 20; item.MaxWidth = Grid.ActualWidth - 20; item.Width = Grid.ActualWidth - 20; item.Margin = new Thickness(10, 10 + (60 * i), 10, 0); item.Remove = Remove; Grid.Children.Add(item); Items.Add(item); } }