private async void RefreshData() { contentData = await SpeechContentOps.GetContentData(); Items = new List <ListViewItem>(); foreach (SpeechContentItem scItem in contentData.Items) { ListViewItem lvItem = new ListViewItem(); //lvItem.Background = Brushes.White; lvItem.Content = scItem; if (scItem.Index < contentData.Position) { lvItem.Background = Brushes.LightSlateGray; } else { lvItem.Foreground = Brushes.Black; } Items.Add(lvItem); } _lvData.ItemsSource = Items; _txtPosition.Text = contentData.Position.ToString(); }
private void _butDown_Click(object sender, RoutedEventArgs e) { ListViewItem lvi = (ListViewItem)(_lvData.SelectedItem); int index = ((SpeechContentItem)(lvi.Content)).Index; SpeechContentOps.MoveContentItem(index, index + 1); RefreshData(); }
private void _butCompress_Click(object sender, RoutedEventArgs e) { SpeechContentOps.DoCompressData(); RefreshData(); }
private void _butAdd_Click(object sender, RoutedEventArgs e) { SpeechContentOps.AddContent(_tboxContent.Text); RefreshData(); }
private void _butSetPosition_Click(object sender, RoutedEventArgs e) { SpeechContentOps.SetPosition(Convert.ToInt32(_txtPosition.Text)); RefreshData(); }