private void EnterTag_OnKeyUp(object sender, KeyEventArgs e) { if (e.Key != System.Windows.Input.Key.Enter) { return; } var x1 = selectionStart < selectionEnd ? selectionStart : selectionEnd; var x2 = selectionStart < selectionEnd ? selectionEnd : selectionStart; var appId1 = _appIndex[x1]; var appId2 = _appIndex[x2]; if (appId2 < apps.Count) { appId2++; } TagStrip.Set(apps[appId1].DateTime, apps[appId2].DateTime, TextBoxTag.Text); }
public MainWindow() { TagStrip = new TagStrip(); InitializeComponent(); ReadLog(); image = this.Image; textBlock = this.TextBlock; Loaded += delegate { var margin = Border.Margin.Left + Border.Margin.Right + Border.BorderThickness.Left + Border.BorderThickness.Right; timeChart = new TimeChart((int)(this.Grid.ActualWidth - margin), (int)50); this.Image.Source = timeChart.Bitmap; FillAppIndex(apps, timeChart.Width); DrawChart(apps); image.MouseMove += Image_MouseMove; image.MouseDown += Image_MouseDown; }; }