public DLG_Manage() { InitializeComponent(); _colle = GaoData.Data.GetCollection(); LB_Gaos.ItemsSource = _colle; TXTBOX_ClipboardCount.Text = Convert.ToString(Properties.Settings.Default.ClipBoardCount); }
private void On_Window_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { if ((bool)e.NewValue == true) { System.Drawing.Point point = System.Windows.Forms.Control.MousePosition; PresentationSource source = PresentationSource.FromVisual(this); Screen screen = Screen.PrimaryScreen; double maxTop = screen.WorkingArea.Height / source.CompositionTarget.TransformToDevice.M22 - this.MaxHeight; double maxLeft = screen.WorkingArea.Width / source.CompositionTarget.TransformToDevice.M11 - this.Width; if (point.Y > maxTop) { this.Top = maxTop; } else { this.Top = point.Y / source.CompositionTarget.TransformToDevice.M22; } if (point.X > maxLeft) { this.Left = maxLeft; } else { this.Left = point.X / source.CompositionTarget.TransformToDevice.M11; } TXTBOX_Search.Text = ""; _gaoColle = GaoData.Data.GetCollection(); LB_Gaos.ItemsSource = null; LB_Gaos.ItemsSource = _gaoColle; LB_Gaos.SelectedIndex = 0; LB_Gaos.ScrollIntoView(LB_Gaos.SelectedItem); LB_ClipItems.SelectedIndex = 0; LB_ClipItems.ScrollIntoView(LB_ClipItems.SelectedItem); } }
private void On_TXTBOX_Search_TextChanged(object sender, TextChangedEventArgs e) { _gaoColle = GaoData.Data.GetCollection(TXTBOX_Search.Text); LB_Gaos.ItemsSource = null; LB_Gaos.ItemsSource = _gaoColle; }