private void tvSearchResults_SelectedChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { Window parentWindow = Window.GetWindow(this); var rect = new System.Drawing.RectangleF { Height = (float)parentWindow.ActualHeight, Width = (float)parentWindow.ActualWidth, X = (float)parentWindow.Left, Y = (float)parentWindow.Top }; if (tvSearchResult.SelectedItem is FormattedGrepLine) { inputData.PreviewFile(tvSearchResult.SelectedItem as FormattedGrepLine, rect); } else if (tvSearchResult.SelectedItem is FormattedGrepResult) { inputData.PreviewFile(tvSearchResult.SelectedItem as FormattedGrepResult, rect); } }
private void OnSelectedItemsChanged(object sender, RoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); var rect = new System.Drawing.RectangleF { Height = (float)parentWindow.ActualHeight, Width = (float)parentWindow.ActualWidth, X = (float)parentWindow.Left, Y = (float)parentWindow.Top }; if (treeView.GetValue(MultiSelectTreeView.SelectedItemsProperty) is IList items && items.Count > 0) { if (items[0] is FormattedGrepLine) { inputData.PreviewFile(items[0] as FormattedGrepLine, rect); } else if (items[0] is FormattedGrepResult) { inputData.PreviewFile(items[0] as FormattedGrepResult, rect); } } }
private void OnSelectedItemsChanged() { Window parentWindow = Window.GetWindow(this); var rect = new System.Drawing.RectangleF { Height = (float)parentWindow.ActualHeight, Width = (float)parentWindow.ActualWidth, X = (float)parentWindow.Left, Y = (float)parentWindow.Top }; if (inputData.SelectedNodes is IList items && items.Count > 0) { if (items[0] is FormattedGrepLine) { inputData.PreviewFile(items[0] as FormattedGrepLine, rect); } else if (items[0] is FormattedGrepResult) { inputData.PreviewFile(items[0] as FormattedGrepResult, rect); } } }