1+ <Application
2+ x : Class =" Launchbar.App"
3+ xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5+ xmlns : lb =" clr-namespace:Launchbar"
6+ xmlns : Shapes =" clr-namespace:Launchbar.Shapes"
7+ xmlns : Properties =" clr-namespace:Launchbar.Properties" >
8+
9+ <Application .Resources>
10+ <ResourceDictionary >
11+ <ResourceDictionary .MergedDictionaries>
12+ <ResourceDictionary Source =" Resources\Aero.Extended.xaml" />
13+ <ResourceDictionary Source =" Resources\Images.xaml" />
14+ </ResourceDictionary .MergedDictionaries>
15+
16+ <SolidColorBrush x : Key =" BarBrush" Color =" Red" Opacity =" {Binding Source={x:Static Properties:Settings.Default}, Path=BarOpacity, Mode=OneWay}" />
17+
18+ <Style x : Key =" StyleIcon" TargetType =" {x:Type FrameworkElement}" >
19+ <Setter Property =" Width" Value =" 24" />
20+ <Setter Property =" Height" Value =" 24" />
21+ <Setter Property =" Margin" Value =" 0,1" />
22+ </Style >
23+
24+ <!-- MenuItem templates-->
25+ <DataTemplate x : Key =" dataTemplateSubmenuIcon" >
26+ <Shapes : ShapeFolder Style =" {StaticResource StyleIcon}"
27+ IsOpen =" {Binding Path=(MenuItem.IsSubmenuOpen), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type MenuItem}}}"
28+ />
29+ </DataTemplate >
30+ <DataTemplate x : Key =" dataTemplateCustomIcon" DataType =" {x:Type lb:MenuEntryAdvanced}" >
31+ <Image Source =" {Binding Path=Icon}" Style =" {StaticResource StyleIcon}" />
32+ </DataTemplate >
33+ <DataTemplate x : Key =" dataTemplateWarningIcon" >
34+ <Shapes : ShapeWarning Style =" {StaticResource StyleIcon}" />
35+ </DataTemplate >
36+ <DataTemplate x : Key =" dataTemplateFolderGoToIcon" >
37+ <Shapes : ShapeFolderGoTo Style =" {StaticResource StyleIcon}" />
38+ </DataTemplate >
39+ <DataTemplate x : Key =" dataTemplateSettingsIcon" >
40+ <Image Source =" {StaticResource imageSettings}" Style =" {StaticResource StyleIcon}" />
41+ </DataTemplate >
42+ <DataTemplate x : Key =" dataTemplateExitIcon" >
43+ <Image Width =" 20" Height =" 20" Margin =" 2" >
44+ <Image .Style>
45+ <Style TargetType =" Image" >
46+ <Setter Property =" Source" Value =" {StaticResource imageClose}" />
47+ <Style .Triggers>
48+ <DataTrigger Binding =" {Binding Path=(MenuItem.IsMouseOver), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type MenuItem}}}" Value =" True" >
49+ <Setter Property =" Source" Value =" {StaticResource imageCloseHover}" />
50+ </DataTrigger >
51+ </Style .Triggers>
52+ </Style >
53+ </Image .Style>
54+ </Image >
55+ </DataTemplate >
56+
57+ <DataTemplate x : Key =" templateHeader" DataType =" {x:Type lb:MenuEntryAdvanced}" >
58+ <TextBlock Text =" {Binding Mode=OneWay}" VerticalAlignment =" Center" />
59+ </DataTemplate >
60+
61+ <!-- MenuItem styles-->
62+ <Style x : Key =" styleMEA" TargetType =" {x:Type MenuItem}" >
63+ <Setter Property =" Icon" Value =" {Binding Mode=OneTime}" />
64+ <Setter Property =" lb:MenuItemExtensions.IconTemplate" Value =" {StaticResource dataTemplateCustomIcon}" />
65+ <Setter Property =" HeaderTemplate" Value =" {StaticResource templateHeader}" />
66+ </Style >
67+
68+ <Style x : Key =" styleProgram" TargetType =" {x:Type MenuItem}" BasedOn =" {StaticResource styleMEA}" >
69+ <Setter Property =" Header" Value =" {Binding Path=Text, Mode=OneWay}" />
70+ <Setter Property =" Command" Value =" {Binding Mode=OneTime}" />
71+ <Style .Triggers>
72+ <DataTrigger Binding =" {Binding Path=IconType, Mode=OneWay}" Value =" {x:Static lb:IconType.Warning}" >
73+ <Setter Property =" lb:MenuItemExtensions.IconTemplate" Value =" {StaticResource dataTemplateWarningIcon}" />
74+ </DataTrigger >
75+ <DataTrigger Binding =" {Binding Path=IconType, Mode=OneWay}" Value =" {x:Static lb:IconType.Default}" >
76+ <Setter Property =" lb:MenuItemExtensions.IconTemplate" Value =" {StaticResource dataTemplateFolderGoToIcon}" />
77+ </DataTrigger >
78+ </Style .Triggers>
79+ </Style >
80+
81+
82+ <Style x : Key =" styleSubmenu" TargetType =" {x:Type MenuItem}" BasedOn =" {StaticResource styleMEA}" >
83+ <Setter Property =" Header" Value =" {Binding Path=Text, Mode=OneWay}" />
84+ <Setter Property =" ItemsSource" Value =" {Binding Path=MenuEntries, Mode=OneWay}" />
85+ <Style .Triggers>
86+ <DataTrigger Binding =" {Binding Path=IconType, Mode=OneWay}" Value =" {x:Static lb:IconType.Default}" >
87+ <Setter Property =" lb:MenuItemExtensions.IconTemplate" Value =" {StaticResource dataTemplateSubmenuIcon}" />
88+ </DataTrigger >
89+ </Style .Triggers>
90+ </Style >
91+
92+ <Style x : Key =" styleSeparator" TargetType =" {x:Type MenuItem}" >
93+ <Setter Property =" Template" >
94+ <Setter .Value>
95+ <ControlTemplate TargetType =" {x:Type MenuItem}" >
96+ <Rectangle SnapsToDevicePixels =" true" Height =" 1"
97+ Margin =" 30,1,1,1"
98+ Fill =" #D0D0D0" />
99+ </ControlTemplate >
100+ </Setter .Value>
101+ </Setter >
102+ <Setter Property =" IsTabStop" Value =" false" />
103+ </Style >
104+
105+ <Style x : Key =" styleSettings" TargetType =" {x:Type MenuItem}" BasedOn =" {StaticResource styleMEA}" >
106+ <Setter Property =" lb:MenuItemExtensions.IconTemplate" Value =" {StaticResource dataTemplateSettingsIcon}" />
107+ <Setter Property =" Header" Value =" Setting" />
108+ <Setter Property =" Command" Value =" {Binding Mode=OneTime}" />
109+ </Style >
110+
111+ <Style x : Key =" styleExit" TargetType =" {x:Type MenuItem}" BasedOn =" {StaticResource styleMEA}" >
112+ <Setter Property =" lb:MenuItemExtensions.IconTemplate" Value =" {StaticResource dataTemplateExitIcon}" />
113+ <Setter Property =" Header" Value =" Exit" />
114+ <Setter Property =" Command" Value =" {Binding Mode=OneTime}" />
115+ </Style >
116+
117+ <lb : MenuItemStyleSelector x : Key =" MenuItemStyleSelector"
118+ ProgramStyle =" {StaticResource styleProgram}"
119+ SubmenuStyle =" {StaticResource styleSubmenu}"
120+ SeparatorStyle =" {StaticResource styleSeparator}"
121+ SettingsStyle =" {StaticResource styleSettings}"
122+ ExitStyle =" {StaticResource styleExit}" />
123+
124+ <!-- This template is used programmatically.-->
125+ <ContextMenu x : Key =" contextMenuTemplate" KeyDown =" contextMenuKeyDown" Margin =" 1"
126+ ItemsSource =" {Binding Source={x:Static Properties:Settings.Default}, Path=Menu.Entries}"
127+ MinWidth =" 125" MinHeight =" 25"
128+ ItemContainerStyleSelector =" {DynamicResource MenuItemStyleSelector}" >
129+ <ContextMenu .LayoutTransform>
130+ <ScaleTransform ScaleX =" {Binding Source={x:Static Properties:Settings.Default}, Path=ContextMenuScale}"
131+ ScaleY =" {Binding Source={x:Static Properties:Settings.Default}, Path=ContextMenuScale}" />
132+ </ContextMenu .LayoutTransform>
133+ </ContextMenu >
134+
135+ </ResourceDictionary >
136+ </Application .Resources>
137+ </Application >
0 commit comments