File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 88using System . Threading . Tasks ;
99using System . Windows ;
1010using System . Windows . Input ;
11+ using MaterialDesignColors . WpfExample ;
1112using MaterialDesignColors . WpfExample . Domain ;
1213using MaterialDesignThemes . Wpf ;
1314
@@ -63,7 +64,9 @@ private void Search(object obj)
6364 private void CopyToClipboard ( object obj )
6465 {
6566 var kind = ( PackIconKind ? ) obj ;
66- Clipboard . SetText ( $ "<materialDesign:PackIcon Kind=\" { kind } \" />") ;
67+ string toBeCopied = $ "<materialDesign:PackIcon Kind=\" { kind } \" />";
68+ Clipboard . SetDataObject ( toBeCopied ) ;
69+ MainWindow . Snackbar . MessageQueue . Enqueue ( toBeCopied + " is copied to clipboard!" ) ;
6770 }
6871
6972 public event PropertyChangedEventHandler PropertyChanged ;
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ namespace MaterialDesignColors.WpfExample
1313 /// <summary>
1414 /// Interaction logic for MainWindow.xaml
1515 /// </summary>
16- public partial class MainWindow : Window
17- {
16+ public partial class MainWindow : Window {
17+ public static Snackbar Snackbar ;
1818 public MainWindow ( )
1919 {
2020 InitializeComponent ( ) ;
@@ -30,6 +30,8 @@ public MainWindow()
3030 //need to get the message queue from the snackbar, so need to be on the dispatcher
3131 MainSnackbar . MessageQueue . Enqueue ( "Welcome to Material Design In XAML Tookit" ) ;
3232 } , TaskScheduler . FromCurrentSynchronizationContext ( ) ) ;
33+
34+ Snackbar = this . MainSnackbar ;
3335 }
3436
3537 private void UIElement_OnPreviewMouseLeftButtonUp ( object sender , MouseButtonEventArgs e )
You can’t perform that action at this time.
0 commit comments