コード例 #1
0
        private void Grid_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            ClassModelPickerItem mousedOverItem = ((FrameworkElement)sender).DataContext as ClassModelPickerItem;

            _timer.Stop();
            _lastMousedOverItem = mousedOverItem;
            _timer.Start();
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        private void _timer_Tick(object sender, EventArgs e)
        {
            _timer.Stop();
            if (_lastMousedOverItem == null)
            {
                return;
            }

            PrimaryItem = _lastMousedOverItem;
            ListBoxSecondary.SelectedItem = PrimaryItem.SelectedItem;
        }
コード例 #4
0
        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();
        }
コード例 #5
0
		private void _timer_Tick(object sender, EventArgs e)
		{
			_timer.Stop();
			if (_lastMousedOverItem == null) return;

			PrimaryItem = _lastMousedOverItem;
			ListBoxSecondary.SelectedItem = PrimaryItem.SelectedItem;
		}
コード例 #6
0
 public ClassModelPickerItem(string header, params string[] children)
 {
     Header = header;
     Items = children.Select(child => new ClassModelPickerItem(child)).ToArray();
     SelectedItem = Items.FirstOrDefault();
 }
コード例 #7
0
 private void Close()
 {
     PrimaryItem = Items.FirstOrDefault(classModelPickerItem => true/*classModelPickerItem.Header == GraphDisplay.CurrentGraph.Split('|')[0]*/);
     PopupClassModelPicker.IsOpen = false;
 }
コード例 #8
0
 public ClassModelPickerItem(string header, params string[] children)
 {
     Header       = header;
     Items        = children.Select(child => new ClassModelPickerItem(child)).ToArray();
     SelectedItem = Items.FirstOrDefault();
 }
コード例 #9
0
 private void Close()
 {
     PrimaryItem = Items.FirstOrDefault(classModelPickerItem => true /*classModelPickerItem.Header == GraphDisplay.CurrentGraph.Split('|')[0]*/);
     PopupClassModelPicker.IsOpen = false;
 }