File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 66
66
</materialDesign : PackIcon .Style>
67
67
</materialDesign : PackIcon >
68
68
</materialDesign : PopupBox .ToggleContent>
69
- <Border MaxHeight =" 600" MaxWidth =" 800" >
70
- <avalonEdit : TextEditor Document =" {Binding Xaml, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextDocumentValueConverter}}"
69
+ <StackPanel >
70
+ <Border MaxHeight =" 600" MaxWidth =" 800" >
71
+ <avalonEdit : TextEditor Document =" {Binding Xaml, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextDocumentValueConverter}}"
71
72
Style =" {StaticResource AvalonTextEditorXamlDisplay}" />
72
- </Border >
73
+ </Border >
74
+ <Button
75
+ Margin =" 0 10 0 0"
76
+ Tag =" {Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}"
77
+ Click =" CopyButton_onClick"
78
+ HorizontalAlignment =" Right"
79
+ Style =" {StaticResource MaterialDesignRaisedButton}"
80
+ >
81
+ COPY
82
+ </Button >
83
+ </StackPanel >
73
84
</materialDesign : PopupBox >
74
85
<Grid >
75
86
<AdornerDecorator >
96
107
</ResourceDictionary >
97
108
</Application .Resources>
98
109
</Application >
110
+
Original file line number Diff line number Diff line change 7
7
using System . Threading ;
8
8
using System . Threading . Tasks ;
9
9
using System . Windows ;
10
+ using System . Windows . Controls ;
10
11
using System . Windows . Markup ;
11
12
using ShowMeTheXAML ;
12
13
@@ -30,5 +31,10 @@ protected override void OnStartup(StartupEventArgs e)
30
31
31
32
base . OnStartup ( e ) ;
32
33
}
34
+
35
+ private void CopyButton_onClick ( object sender , RoutedEventArgs e ) {
36
+ var toBeCopied = ( ( Button ) sender ) . Tag . ToString ( ) ;
37
+ Clipboard . SetDataObject ( toBeCopied ) ;
38
+ }
33
39
}
34
40
}
You can’t perform that action at this time.
0 commit comments