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 8
8
using System . Threading . Tasks ;
9
9
using System . Windows ;
10
10
using System . Windows . Input ;
11
+ using MaterialDesignColors . WpfExample ;
11
12
using MaterialDesignColors . WpfExample . Domain ;
12
13
using MaterialDesignThemes . Wpf ;
13
14
@@ -63,7 +64,9 @@ private void Search(object obj)
63
64
private void CopyToClipboard ( object obj )
64
65
{
65
66
var kind = ( PackIconKind ? ) obj ;
66
- Clipboard . SetDataObject ( $ "<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!" ) ;
67
70
}
68
71
69
72
public event PropertyChangedEventHandler PropertyChanged ;
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ namespace MaterialDesignColors.WpfExample
13
13
/// <summary>
14
14
/// Interaction logic for MainWindow.xaml
15
15
/// </summary>
16
- public partial class MainWindow : Window
17
- {
16
+ public partial class MainWindow : Window {
17
+ public static Snackbar Snackbar ;
18
18
public MainWindow ( )
19
19
{
20
20
InitializeComponent ( ) ;
@@ -30,6 +30,8 @@ public MainWindow()
30
30
//need to get the message queue from the snackbar, so need to be on the dispatcher
31
31
MainSnackbar . MessageQueue . Enqueue ( "Welcome to Material Design In XAML Tookit" ) ;
32
32
} , TaskScheduler . FromCurrentSynchronizationContext ( ) ) ;
33
+
34
+ Snackbar = this . MainSnackbar ;
33
35
}
34
36
35
37
private void UIElement_OnPreviewMouseLeftButtonUp ( object sender , MouseButtonEventArgs e )
You can’t perform that action at this time.
0 commit comments