private void UserControl_Loaded(object sender, RoutedEventArgs e) { listView.Items.Clear(); var dict = AuxiliaryUtil.Types(); foreach (var kv in dict) { if (Type > AuxiliaryType.Invalid && Type < AuxiliaryType.Max) { if (kv.Key != (int)Type) { continue; } } listView.Items.Add(kv); } if (listView.Items.Count > 0) { listView.SelectedIndex = 0; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { listView.Items.Clear(); var dict = AuxiliaryUtil.Types(); foreach (var kv in dict) { if (mType > AuxiliaryType.Invalid && mType < AuxiliaryType.Max) { if (kv.Key != (int)mType) { continue; } } listView.Items.Add(kv); } if (listView.Items.Count > 0) { listView.SelectedIndex = 0; } datagrid.MouseDoubleClick += Datagrid_MouseDoubleClick; }