//Fill 'Words' list-box with default values. void FillWords(List <int> tmp) { List <int> lst = new List <int>(_proxy.GetUserItemWordsAsync(user, item, type).Result); foreach (int item in lst) { lstWords.Items.Add(new CheckBox { VerticalAlignment = VerticalAlignment.Stretch, Tag = item, Content = _proxy.GetItemPropertyAsync(item, EngServRef.ServerData.Word, EngServRef.PropertyData.Name).Result, Style = TryFindResource("chNormal") as Style, HorizontalAlignment = HorizontalAlignment.Left, IsChecked = true }); } }
//Fill 'Categories' list-box. void FillCategories() { List <int> lst = new List <int>(_proxy.GetItemsAsync(EngServRef.ServerData.WordCategory).Result); foreach (int item in lst) { CheckBox chItem = new CheckBox { VerticalAlignment = VerticalAlignment.Stretch, Tag = item, Content = _proxy.GetItemPropertyAsync(item, EngServRef.ServerData.WordCategory, EngServRef.PropertyData.Name).Result, Style = TryFindResource("chNormal") as Style, HorizontalAlignment = HorizontalAlignment.Left }; chItem.Click += ChItem_Click; lstCategory.Items.Add(chItem); } }
//Fill 'Rules' list-box. void FillRules(List <int> lst) { foreach (int item in lst) { lstRules.Items.Add(new CheckBox { VerticalAlignment = VerticalAlignment.Stretch, Tag = item, Content = _proxy.GetItemPropertyAsync(item, EngServRef.ServerData.Rule, EngServRef.PropertyData.Name).Result, Style = TryFindResource("chNormal") as Style, HorizontalAlignment = HorizontalAlignment.Left, IsChecked = true }); } }