From 2fac693243dc3b6673be104b206bc82f46f0f70c Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Fri, 12 May 2017 16:42:54 -0700 Subject: [PATCH] I guess there's a bug in Clipboard.SetText(). Clipboard.SetDataObject() works, though. --- windows/WinUI/ToolbarItem.xaml.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/windows/WinUI/ToolbarItem.xaml.cs b/windows/WinUI/ToolbarItem.xaml.cs index 8b77fa5f6..9da9fcdfc 100644 --- a/windows/WinUI/ToolbarItem.xaml.cs +++ b/windows/WinUI/ToolbarItem.xaml.cs @@ -111,14 +111,19 @@ namespace WinUI private void ToolbarItem_NodeIDClicked(object sender, System.Windows.RoutedEventArgs e) { - try - { - Clipboard.SetText(nodeId); - } - catch (ArgumentNullException) - { - // tried to copy a null nodeId - } + try + { + Clipboard.SetDataObject(nodeId); + } + catch (ArgumentNullException) + { + // tried to copy a null nodeId + Console.WriteLine("ArgumentNullException"); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } } private void ToolbarItem_ShowNetworksClicked(object sender, System.Windows.RoutedEventArgs e)