22 xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33 xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
44 xmlns : i =" http://schemas.microsoft.com/xaml/behaviors"
5+ xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
6+ xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
7+ xmlns : behaviors =" clr-namespace:Monitorian.Core.Views.Behaviors"
58 xmlns : controls =" clr-namespace:Monitorian.Core.Views.Controls"
6- xmlns : properties =" clr-namespace:Monitorian.Core.Properties" >
9+ xmlns : properties =" clr-namespace:Monitorian.Core.Properties"
10+ mc : Ignorable =" d" >
711 <UserControl .Resources>
8- <StackPanel x : Key =" Content" >
9- <ContentControl Style =" {StaticResource MenuItemStyle}" >
10- <Button Padding =" 8,4"
11- Style=" {StaticResource PlainButtonItemStyle}"
12- Content=" {x:Static properties:Resources.Probe}"
13- IsEnabled=" {Binding CanProbe, Mode=OneWay}" >
14- <i : Interaction .Triggers>
15- <i : EventTrigger EventName =" Click" >
16- <i : CallMethodAction TargetObject =" {Binding}"
17- MethodName=" PerformProbe" />
18- </i : EventTrigger >
19- </i : Interaction .Triggers>
20- </Button >
21- </ContentControl >
12+ <ControlTemplate x : Key =" Content" TargetType =" {x:Type UserControl}" >
13+ <StackPanel Initialized =" ContentPanel_Initialized"
14+ d:Background=" DarkGreen" >
15+ <ContentControl Style =" {StaticResource MenuItemStyle}" >
16+ <Button Padding =" 8,4"
17+ Style=" {StaticResource PlainButtonItemStyle}"
18+ Content=" {x:Static properties:Resources.Probe}"
19+ IsEnabled=" {Binding CanProbe, Mode=OneWay}" >
20+ <i : Interaction .Triggers>
21+ <i : EventTrigger EventName =" Click" >
22+ <i : CallMethodAction TargetObject =" {Binding}"
23+ MethodName=" PerformProbe" />
24+ </i : EventTrigger >
25+ </i : Interaction .Triggers>
26+ </Button >
27+ </ContentControl >
2228
23- <ContentControl Style =" {StaticResource MenuItemStyle}" >
24- <Button Padding =" 8,4"
25- Style=" {StaticResource PlainButtonItemStyle}"
26- Content=" {x:Static properties:Resources.Rescan}" >
27- <i : Interaction .Triggers>
28- <i : EventTrigger EventName =" Click" >
29- <i : CallMethodAction TargetObject =" {Binding}"
30- MethodName=" PerformRescan" />
31- </i : EventTrigger >
32- </i : Interaction .Triggers>
33- </Button >
34- </ContentControl >
29+ <ContentControl Style =" {StaticResource MenuItemStyle}" >
30+ <Button Padding =" 8,4"
31+ Style=" {StaticResource PlainButtonItemStyle}"
32+ Content=" {x:Static properties:Resources.Rescan}" >
33+ <i : Interaction .Triggers>
34+ <i : EventTrigger EventName =" Click" >
35+ <i : CallMethodAction TargetObject =" {Binding}"
36+ MethodName=" PerformRescan" />
37+ </i : EventTrigger >
38+ </i : Interaction .Triggers>
39+ </Button >
40+ </ContentControl >
3541
36- <ContentControl Style =" {StaticResource MenuItemStyle}" >
37- <ToggleButton Padding =" 8,4"
38- Style =" {StaticResource CheckButtonItemStyle}"
39- Content =" {x:Static properties:Resources.MakeOperation}"
40- IsChecked =" {Binding Settings.MakesOperationLog}" />
41- </ContentControl >
42+ <ContentControl Style =" {StaticResource MenuItemStyle}" >
43+ <ToggleButton Padding =" 8,4"
44+ Style =" {StaticResource CheckButtonItemStyle}"
45+ Content =" {x:Static properties:Resources.MakeOperation}"
46+ IsChecked =" {Binding Settings.MakesOperationLog}" />
47+ </ContentControl >
4248
43- <ContentControl Style =" {StaticResource MenuItemStyle}" >
44- <Button Padding =" 8,4"
45- Style=" {StaticResource PlainButtonItemStyle}"
46- Content=" {x:Static properties:Resources.CopyOperation}" >
47- <i : Interaction .Triggers>
48- <i : EventTrigger EventName =" Click" >
49- <i : CallMethodAction TargetObject =" {Binding}"
50- MethodName=" PerformCopy" />
51- </i : EventTrigger >
52- </i : Interaction .Triggers>
53- </Button >
54- </ContentControl >
49+ <ContentControl Style =" {StaticResource MenuItemStyle}" >
50+ <Button Padding =" 8,4"
51+ Style=" {StaticResource PlainButtonItemStyle}"
52+ Content=" {x:Static properties:Resources.CopyOperation}" >
53+ <i : Interaction .Triggers>
54+ <i : EventTrigger EventName =" Click" >
55+ <i : CallMethodAction TargetObject =" {Binding}"
56+ MethodName=" PerformCopy" />
57+ </i : EventTrigger >
58+ </i : Interaction .Triggers>
59+ </Button >
60+ </ContentControl >
5561
56- <ContentControl Style =" {StaticResource MenuItemStyle}" >
57- <controls : MultiToggleButton Padding =" 8,4"
58- Style=" {StaticResource MultiButtonItemStyle}"
59- Content=" {x:Static properties:Resources.Arguments}"
60- IsCheckable=" False" >
61- <controls : MultiToggleButton .SubContent>
62- <TextBox Style =" {StaticResource PlainTextBoxStyle}"
63- FlowDirection =" LeftToRight"
64- TextWrapping =" Wrap" AcceptsReturn =" True"
65- MaxLength =" 256" MaxLines =" 5"
66- Text =" {Binding Arguments, Mode=TwoWay}" />
67- </controls : MultiToggleButton .SubContent>
68- </controls : MultiToggleButton >
69- </ContentControl >
62+ <ContentControl Style =" {StaticResource MenuItemStyle}" >
63+ <controls : MultiToggleButton Padding =" 8,4"
64+ Style=" {StaticResource MultiButtonItemStyle}"
65+ Content=" {x:Static properties:Resources.Arguments}"
66+ IsCheckable=" False" >
67+ <controls : MultiToggleButton .SubContent>
68+ <TextBox Style =" {StaticResource PlainTextBoxStyle}"
69+ FlowDirection =" LeftToRight"
70+ TextWrapping =" Wrap" AcceptsReturn =" True"
71+ MaxLength =" 256" MaxLines =" 5"
72+ Text =" {Binding Arguments, Mode=TwoWay}" >
73+ <i : Interaction .Triggers>
74+ <i : EventTrigger SourceObject =" {Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}}" EventName =" Closed" >
75+ <behaviors : UpdateSourceAction />
76+ </i : EventTrigger >
77+ </i : Interaction .Triggers>
78+ </TextBox >
79+ </controls : MultiToggleButton .SubContent>
80+ </controls : MultiToggleButton >
81+ </ContentControl >
7082
71- <Separator Style =" {StaticResource MenuSeparatorStyle}" />
72- </StackPanel >
83+ <Separator Style =" {StaticResource MenuSeparatorStyle}" />
84+ </StackPanel >
85+ </ControlTemplate >
7386 </UserControl .Resources>
7487
88+ <d : UserControl .Template>
89+ <StaticResource ResourceKey =" Content" />
90+ </d : UserControl .Template>
91+
7592</UserControl >
0 commit comments