private async void MenuItemCopyDataGrid_Click(object sender, RoutedEventArgs e) { string text = DataGrid.ToStringTable(); if (text != null) { await ClipBoardUtils.SetTextAsync(text); } }
private async void MenuItemCopySelectedCsv_Click(object sender, RoutedEventArgs e) { string text = DataGrid.SelectedToCsv(); if (text != null) { await ClipBoardUtils.SetTextAsync(text); } }
private async void MenuItemCopyRow_Click(object sender, RoutedEventArgs e) { string text = DataGrid.RowToString(Cell.DataContext); if (text != null) { await ClipBoardUtils.SetTextAsync(text); } }
private async void MenuItemCopyColumn_Click(object sender, RoutedEventArgs e) { if (Column is DataGridPropertyTextColumn column) { string text = DataGrid.ColumnToStringTable(column); if (text != null) { await ClipBoardUtils.SetTextAsync(text); } } }
private async Task LinkAsync(Call call) { Bookmark bookmark = TabView.Instance.CreateBookmark(); TabBookmark leafNode = bookmark.TabBookmark.GetLeaf(); // Get the shallowest root node if (leafNode != bookmark.TabBookmark) { bookmark.Name = leafNode.Tab?.ToString(); bookmark.TabBookmark = leafNode; bookmark.BookmarkType = BookmarkType.Leaf; } else { bookmark.BookmarkType = BookmarkType.Full; } string uri = Project.Linker.GetLinkUri(call, bookmark); await ClipBoardUtils.SetTextAsync(uri); }
private async void MenuItemCopyCellContents_Click(object sender, RoutedEventArgs e) { if (Column == null) { return; } object content = Cell.Content; if (content is Border border) { content = border.Child; } if (content is TextBlock textBlock) { string value = FormatValueConverter.ObjectToString(Column.PropertyInfo.GetValue(textBlock.DataContext), MaxCellValueLength, Column.FormatConverter.IsFormatted); await ClipBoardUtils.SetTextAsync(value); } }