private void Grid_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) { ClassModelPickerItem mousedOverItem = ((FrameworkElement)sender).DataContext as ClassModelPickerItem; _timer.Stop(); _lastMousedOverItem = mousedOverItem; _timer.Start(); }
private void Grid_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) { ClassModelPickerItem mousedOverItem = ((FrameworkElement)sender).DataContext as ClassModelPickerItem; if (_lastMousedOverItem == mousedOverItem) { _lastMousedOverItem = null; _timer.Stop(); } }
private void _timer_Tick(object sender, EventArgs e) { _timer.Stop(); if (_lastMousedOverItem == null) { return; } PrimaryItem = _lastMousedOverItem; ListBoxSecondary.SelectedItem = PrimaryItem.SelectedItem; }
private void Grid_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { ClassModelPickerItem clickedItem = ((FrameworkElement)sender).DataContext as ClassModelPickerItem; if (ListBoxSecondary.Items.Contains(clickedItem)) { PrimaryItem.SelectedItem = clickedItem; } SetCurrentModel(); Close(); }
private void _timer_Tick(object sender, EventArgs e) { _timer.Stop(); if (_lastMousedOverItem == null) return; PrimaryItem = _lastMousedOverItem; ListBoxSecondary.SelectedItem = PrimaryItem.SelectedItem; }
public ClassModelPickerItem(string header, params string[] children) { Header = header; Items = children.Select(child => new ClassModelPickerItem(child)).ToArray(); SelectedItem = Items.FirstOrDefault(); }
private void Close() { PrimaryItem = Items.FirstOrDefault(classModelPickerItem => true/*classModelPickerItem.Header == GraphDisplay.CurrentGraph.Split('|')[0]*/); PopupClassModelPicker.IsOpen = false; }
public ClassModelPickerItem(string header, params string[] children) { Header = header; Items = children.Select(child => new ClassModelPickerItem(child)).ToArray(); SelectedItem = Items.FirstOrDefault(); }
private void Close() { PrimaryItem = Items.FirstOrDefault(classModelPickerItem => true /*classModelPickerItem.Header == GraphDisplay.CurrentGraph.Split('|')[0]*/); PopupClassModelPicker.IsOpen = false; }