Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PropertyEditorPanelStyle.xaml « Themes « Xamarin.PropertyEditing.Windows - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 55669b844ca71eba8a24f3e29eb013e70c67a37f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:system="clr-namespace:System;assembly=mscorlib"
                    xmlns:local="clr-namespace:Xamarin.PropertyEditing.Windows"
                    xmlns:core="clr-namespace:Xamarin.PropertyEditing;assembly=Xamarin.PropertyEditing"
                    xmlns:prop="clr-namespace:Xamarin.PropertyEditing.Properties;assembly=Xamarin.PropertyEditing"
                    xmlns:vms="clr-namespace:Xamarin.PropertyEditing.ViewModels;assembly=Xamarin.PropertyEditing">

	<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
	<local:OppositeBoolConverter x:Key="OppositeBoolConverter" />
	<local:EditorPropertySelector x:Key="PropertyEditorSelector" />
	<local:EditorTreeSelector x:Key="EditorTreeSelector" EditorTemplateKey="PropertyEditorTemplate" ParentTemplateKey="PropertyGroupTemplate" />
	<local:ArrangeModeLocalizedConverter x:Key="ArrangeLocalizer" />

	<Style x:Key="TreeExpanderStyle" TargetType="Expander">
		<Setter Property="Foreground" Value="{DynamicResource PanelGroupForegroundBrush}" />
		<Setter Property="Background" Value="{DynamicResource PanelBackgroundBrush}" />
		<Setter Property="BorderThickness" Value="0,0,0,1" />
		<Setter Property="BorderBrush" Value="{DynamicResource CategoryExpanderBorderBrush}" />
		<Setter Property="IsTabStop" Value="True" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Expander}">
					<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
						<DockPanel>
							<ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" Content="{TemplateBinding Header}" Margin="1,3,1,3" DockPanel.Dock="Top" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{DynamicResource ExpandCollapseToggleStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
							<ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</DockPanel>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsExpanded" Value="true">
							<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<DataTemplate x:Key="PropertyEditorTemplate">
		<local:PropertyPresenter x:Name="presenter" Padding="19,0,0,0" Label="{Binding Property.Name,Mode=OneTime}" Content="{Binding Mode=OneTime}" ContentTemplateSelector="{StaticResource PropertyEditorSelector}" />
		<DataTemplate.Triggers>
			<DataTrigger Binding="{Binding CanDelve}" Value="True">
				<Setter TargetName="presenter" Property="ItemsSource" Value="{Binding ValueModel.Properties,FallbackValue={x:Null}}" />
			</DataTrigger>
		</DataTemplate.Triggers>
	</DataTemplate>
	
	<Style x:Key="PropertyListStyle" TargetType="ItemsControl">
		<Setter Property="Focusable" Value="False" />
		<Setter Property="ItemTemplateSelector" Value="{StaticResource EditorTreeSelector}" />
		<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
		<Setter Property="VirtualizingPanel.ScrollUnit" Value="Pixel" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ItemsControl">
					<ScrollViewer Focusable="False" HorizontalScrollBarVisibility="Disabled">
						<ItemsPresenter />
					</ScrollViewer>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="ItemsPanel">
			<Setter.Value>
				<ItemsPanelTemplate>
					<VirtualizingStackPanel IsItemsHost="True" VirtualizationMode="Recycling" />
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="ToggleButton" x:Key="AdvancedPropertiesToggleButton">
		<Setter Property="OverridesDefaultStyle" Value="True" />
		<Setter Property="Height" Value="14" />
		<Setter Property="Padding" Value="1.5,1,1.5,1" />
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="Background" Value="Transparent" />
		<Setter Property="Foreground" Value="{DynamicResource ToggleItemForegroundBrush}" />
		<Setter Property="AutomationProperties.Name" Value="{x:Static prop:Resources.UncommonPropertiesName}" />
		<Setter Property="ToolTip" Value="{x:Static prop:Resources.UncommonPropertiesTooltip}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border x:Name="ExpanderButtonBorder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{TemplateBinding Background}" DockPanel.Dock="Top">
						<Path x:Name="Chevron" Data="M 0,3 L 5,8 L 10,3" Stroke="{TemplateBinding Foreground}" Width="10" Height="10" StrokeThickness="2"
						      HorizontalAlignment="Stretch" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="True">
							<Setter Property="Data" TargetName="Chevron" Value="M 0,8 L 5,3 L 10,8"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter Property="Background" Value="{DynamicResource AdvancedExpanderMouseOverBackgroundBrush}" />
				<Setter Property="BorderBrush" Value="{DynamicResource AdvancedExpanderMouseOverBorderBrush}" />
				<Setter Property="Foreground" Value="{DynamicResource AdvancedExpanderMouseOverForegroundBrush}" />
			</Trigger>
		</Style.Triggers>
	</Style>

	<Style TargetType="Expander" x:Key="AdvancedPropertiesExpander">
		<Setter Property="Foreground" Value="{DynamicResource PanelGroupSecondaryForegroundBrush}" />
		<Setter Property="Background" Value="{DynamicResource PanelGroupSecondaryBackgroundBrush}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Expander">
					<StackPanel Background="{TemplateBinding Background}">
						<ToggleButton
							x:Name="ExpanderButton" DockPanel.Dock="Top" Style="{DynamicResource AdvancedPropertiesToggleButton}" Content="{TemplateBinding Header}" 
							IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}">
						</ToggleButton>
						<ContentPresenter x:Name="ExpanderContent" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
					</StackPanel>
					<ControlTemplate.Triggers>
						<Trigger Property="IsExpanded" Value="True">
							<Setter TargetName="ExpanderContent" Property="Visibility" Value="Visible"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<DataTemplate x:Key="PropertyGroupTemplate">
		<local:CategoryExpander Header="{Binding Category,Mode=OneTime}" Style="{StaticResource TreeExpanderStyle}">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<ItemsControl Grid.Row="0" Style="{StaticResource PropertyListStyle}" ItemsSource="{Binding Editors,Mode=OneTime}">
					<ItemsControl.Template>
						<ControlTemplate>
							<ItemsPresenter />
						</ControlTemplate>
					</ItemsControl.Template>
				</ItemsControl>
				<local:FilterExpander Grid.Row="1" Visibility="{Binding HasUncommonElements,Converter={StaticResource BoolToVisibilityConverter}}" Style="{StaticResource AdvancedPropertiesExpander}" IsExpanded="{Binding UncommonShown,Mode=TwoWay}" AutomationProperties.Name="{x:Static prop:Resources.UncommonPropertiesName}">
					<ItemsControl Grid.Row="0" Style="{StaticResource PropertyListStyle}" ItemsSource="{Binding UncommonEditors,Mode=OneTime}">
						<ItemsControl.Template>
							<ControlTemplate>
								<ItemsPresenter />
							</ControlTemplate>
						</ItemsControl.Template>
					</ItemsControl>
				</local:FilterExpander>
			</Grid>
		</local:CategoryExpander>
	</DataTemplate>

	<Style TargetType="local:PropertyEditorPanel">
		<Setter Property="Background" Value="{DynamicResource PanelBackgroundBrush}" />
		<Setter Property="Foreground" Value="{DynamicResource PanelForegroundBrush}" />
		<Setter Property="Focusable" Value="False" />
		<Setter Property="UseLayoutRounding" Value="True" />
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:PropertyEditorPanel">
					<Border Name="root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
						<Grid Background="{TemplateBinding Background}">
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition />
							</Grid.RowDefinitions>

							<Border Grid.Row="0" Margin="4,2,4,2" Background="{DynamicResource PanelHeaderBackgroundBrush}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource PanelGroupSecondaryBorderBrush}">
								<Grid Margin="4,2,4,2">
									<Grid.RowDefinitions>
										<RowDefinition Height="Auto" />
										<RowDefinition Height="Auto" />
									</Grid.RowDefinitions>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="*" />
										<ColumnDefinition Width="Auto" />
									</Grid.ColumnDefinitions>

									<Border Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Margin="1,6,5,2" Background="{DynamicResource PropertiesPanelIconBackgroundBrush}" VerticalAlignment="Center">
										<Image Name="typeIcon" Height="32" Width="32" Visibility="Collapsed" />
									</Border>

									<TextBlock Visibility="{Binding IsObjectNameable, Converter={StaticResource BoolToVisibilityConverter}}" Name="nameLabel" Grid.Row="0" Grid.Column="1" Margin="0,2,0,2" Text="{x:Static prop:Resources.Name}" />
									<local:TextBoxEx Visibility="{Binding IsObjectNameable, Converter={StaticResource BoolToVisibilityConverter}}" Grid.Row="0" Grid.Column="2" Margin="4,2,0,2" Text="{Binding ObjectName,Mode=TwoWay}" FocusSelectsAll="True" IsReadOnly="{Binding IsObjectNameReadOnly}" Focusable="{Binding IsObjectNameReadOnly,Converter={StaticResource OppositeBoolConverter}}" AutomationProperties.LabeledBy="{Binding ElementName=nameLabel,Mode=OneTime}" />

									<TextBlock Name="typeLabel" Grid.Row="1" Grid.Column="1" Margin="0,4,0,4" Text="{x:Static prop:Resources.Type}" />
									<TextBlock Grid.Row="1" Grid.Column="2" Margin="9,4,0,4" Text="{Binding TypeName}" />

									<local:ChoiceControl x:Name="paneSelector" AutomationProperties.HelpText="{x:Static prop:Resources.ViewPropertiesOrEvents}" Style="{DynamicResource PanelChoice}" Grid.Row="0" Grid.Column="3" Margin="4,0,0,0" Visibility="{Binding EventsEnabled,Converter={StaticResource BoolToVisibilityConverter}}">
										<local:ChoiceControl.Items>
											<local:ChoiceItem Name="{x:Static prop:Resources.Properties}" Tooltip="{x:Static prop:Resources.PropertiesSelectedElement}" Value="{x:Static local:EditingPane.Properties}" />
											<local:ChoiceItem Name="{x:Static prop:Resources.Events}" Tooltip="{x:Static prop:Resources.EventHandlersSelectedElement}" Value="{x:Static local:EditingPane.Events}" />
										</local:ChoiceControl.Items>
									</local:ChoiceControl>
								</Grid>
							</Border>

							<Grid Name="propertiesPane" Grid.Row="1" KeyboardNavigation.TabNavigation="Cycle">
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="*" />
								</Grid.RowDefinitions>

								<local:TextBoxEx x:Name="search" Grid.Row="0" Style="{DynamicResource PropertySearchTextBox}" AutomationProperties.Name="{x:Static prop:Resources.SearchProperties}" Text="{Binding FilterText,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />

								<local:MenuButton Grid.Row="1" x:Name="arrangeBy" Header="{x:Static prop:Resources.ArrangeByLabel}" Margin="0,0,18,0" Content="{Binding ArrangeMode,Converter={StaticResource ArrangeLocalizer}}" AutomationProperties.Name="{Binding ArrangeMode,StringFormat={x:Static prop:Resources.ArrangeByButtonName}}">
									<local:MenuButton.Visibility>
										<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="IsArrangeEnabled">
											<Binding.Converter>
												<BooleanToVisibilityConverter />
											</Binding.Converter>
										</Binding>
									</local:MenuButton.Visibility>
									<local:MenuButton.ContextMenu>
										<ContextMenu ItemsSource="{Binding ArrangeModes,Mode=OneTime}" StaysOpen="True" ItemContainerStyle="{DynamicResource ArrangeMenuItem}" AutomationProperties.Name="{x:Static prop:Resources.ArrangeByLabel}" />
									</local:MenuButton.ContextMenu>
								</local:MenuButton>
								<ItemsControl Name="propertyItems" Grid.Row="2" Background="{DynamicResource ListBackgroundBrush}" Grid.IsSharedSizeScope="True" Style="{StaticResource PropertyListStyle}" />
							</Grid>

							<ScrollViewer Name="eventsPane" Grid.Row="1" Visibility="Collapsed">
								<ItemsControl ItemsSource="{Binding Events}">
									<ItemsControl.ItemTemplate>
										<DataTemplate>
											<Grid>
												<Grid.ColumnDefinitions>
													<ColumnDefinition Width="0.4*" />
													<ColumnDefinition Width="0.6*" />
												</Grid.ColumnDefinitions>

												<TextBlock Name="eventName" Grid.Column="0" Margin="16,0,0,0" Text="{Binding Event.Name,Mode=OneWay}" TextTrimming="CharacterEllipsis" />
												<local:TextBoxEx Grid.Column="1" Margin="4,2,4,2" Padding="2,0,0,0" Text="{Binding MethodName,Mode=TwoWay}" AutomationProperties.LabeledBy="{Binding ElementName=eventName,Mode=OneTime}" />
											</Grid>
										</DataTemplate>
									</ItemsControl.ItemTemplate>
								</ItemsControl>
							</ScrollViewer>
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>