aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BrushPicker/Themes/Generic.xaml
blob: 79de31f1032e9a7c752a5039a21a47cf45adb4a7 (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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
<!--*****************   NCore Softwares Pvt. Ltd., India   **************************

   ColorBox

   Copyright (C) 2013 NCore Softwares Pvt. Ltd.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://colorbox.codeplex.com/license

*********************************************************************************** -->

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:converters="clr-namespace:Tango.BrushPicker.Converters"
                    xmlns:local="clr-namespace:Tango.BrushPicker">

    <converters:BrushToGradientStopsConverter x:Key="BrushToGradientStopsConverter" />

    <Geometry x:Key="SkewIcon">M456.021,227.816L545.590,227.816L456.021,362.171L366.452,362.171L456.021,227.816</Geometry>
    <Geometry x:Key="TranslateIcon">M384,289.828L384,363L457.171,363M384,363L457.171,289.828M480,267L480,310.011L435.711,267L480,267</Geometry>
    <Geometry x:Key="RotateIcon">F1 M 32.0034,13.0019L 35.0033,16.002L 35.0034,24.0019L 27.0033,24.002L 24.0034,21.0019L 29.5944,21.0014C 28.2209,19.4668 26.2249,18.501 24.0033,18.501C 19.8606,18.501 16.5022,21.8593 16.5022,26.002C 16.5022,28.0734 17.3418,29.9486 18.6992,31.3061L 16.2241,33.7812C 14.2332,31.7903 13.0018,29.0399 13.0018,26.0019C 13.0018,19.926 17.9274,15.0004 24.0033,15.0004C 27.1557,15.0004 29.9984,16.3263 32.0042,18.4508L 32.0034,13.0019 Z</Geometry>
    <Geometry x:Key="ScaleIcon">F1 M 28,13L 36,13L 36,21L 33,24L 33,18.5L 24,27.5L 21.5,25L 30.5,16L 25,16L 28,13 Z M 13,18L 26,18L 23,21L 16,21L 16,33L 28,33L 28,26L 31,23L 31,36L 13,36L 13,18 Z</Geometry>
    <Geometry x:Key="CenterIcon">M502.672,272.601C502.672,298.366 481.785,319.252 456.021,319.252 430.257,319.252 409.370,298.366 409.370,272.601 409.370,246.837 430.257,225.950 456.021,225.950 481.785,225.950 502.672,246.837 502.672,272.601zM502.672,272.601C502.672,298.366 481.785,319.252 456.021,319.252 430.257,319.252 409.370,298.366 409.370,272.601 409.370,246.837 430.257,225.950 456.021,225.950 481.785,225.950 502.672,246.837 502.672,272.601zM470.531,272.601C470.531,280.615 464.035,287.111 456.021,287.111 448.007,287.111 441.511,280.615 441.511,272.601 441.511,264.588 448.007,258.091 456.021,258.091 464.035,258.091 470.531,264.588 470.531,272.601z</Geometry>
    <Geometry x:Key="FlipIcon">M384,267L384,363L480,363M384,363L459.026,286.973L438,267L479.000,267L479.000,307.000L459.026,286.973</Geometry>

    <BooleanToVisibilityConverter x:Key="BoolToVis"></BooleanToVisibilityConverter>

    <VisualBrush x:Key="AlphaBrush" Stretch="None" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,8,8">
        <VisualBrush.Visual>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="4" />
                    <ColumnDefinition Width="4" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="4" />
                    <RowDefinition Height="4" />
                </Grid.RowDefinitions>
                <Rectangle Fill="#FFF" Grid.Row="0" Grid.Column="0" />
                <Rectangle Fill="#AAA" Grid.Row="0" Grid.Column="1" />
                <Rectangle Fill="#AAA" Grid.Row="1" Grid.Column="0" />
                <Rectangle Fill="#FFF" Grid.Row="1" Grid.Column="1" />
            </Grid>
        </VisualBrush.Visual>
    </VisualBrush>

    <Style TargetType="Path" x:Key="IconStyle">
        <Setter Property="Height" Value="16"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Fill" Value="#000000"/>
        <Setter Property="Stretch" Value="Fill"/>
    </Style>

    <Style TargetType="Slider" x:Key="OpacitySliderStyle">
        <Setter Property="Value" Value="{Binding Brush.Opacity, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"/>
        <Setter Property="IsMoveToPointEnabled" Value="True"/>
        <Setter Property="Margin" Value="2"/>
        <Setter Property="Minimum" Value="0"/>
        <Setter Property="Maximum" Value="1"/>
    </Style>

    <!-- Gradient Stop Thumb Style -->
    <Style x:Key="SliderThumbStyle" TargetType="Thumb">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="BorderBrush" Value="#000000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid>
                        <Path Data="M468.9,240 A71.7,71.7,0,1,0,593, 240 M468.9,240 L531,152 L593,240"
                              Height="16" Width="14" Stretch="Fill"
                              Fill="#FFFFFF" Stroke="{TemplateBinding BorderBrush}"/>

                        <Path Data="M468.9,240 A71.7,71.7,0,1,0,593,240 M468.9,240 L531,152 L593,240"
                              Height="12" Width="8" Stretch="Fill"
                              Fill="{TemplateBinding Background}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Gradient Stop Slider Style -->
    <Style x:Key="GradientStopSliderStyle" TargetType="Slider">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Slider">
                    <Track x:Name="PART_Track">
                        <Track.Thumb>
                            <Thumb Style="{StaticResource SliderThumbStyle}"
                                   Background="{TemplateBinding Background}"
                                   BorderBrush="{TemplateBinding BorderBrush}" />
                        </Track.Thumb>
                    </Track>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <!-- ******* DoubleUpDown ******* -->

    <Style x:Key="NumericUpDown" TargetType="{x:Type local:UpDownBase}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Foreground" Value="#000000" />
        <Setter Property="Background" Value="#FFFFFF" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="Padding" Value="5,1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:UpDownBase">
                    <local:Spinner IsTabStop="False"
                                   Background="{TemplateBinding Background}"
                                   BorderThickness="{TemplateBinding BorderThickness}">

                        <TextBox x:Name="PART_TextBox"
                                 FocusVisualStyle="{x:Null}"
                                 Background="{TemplateBinding Background}"
                                 BorderThickness="{TemplateBinding BorderThickness}"                                                                  
                                 ContextMenu="{TemplateBinding ContextMenu}"
                                 FontFamily="{TemplateBinding FontFamily}"
                                 FontSize="{TemplateBinding FontSize}"
                                 FontStretch="{TemplateBinding FontStretch}"
                                 FontStyle="{TemplateBinding FontStyle}" 
                                 FontWeight="{TemplateBinding FontWeight}" 
                                 Foreground="{TemplateBinding Foreground}"
                                 IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
                                 MinWidth="20"
                                 AcceptsReturn="False"
                                 Padding="{TemplateBinding Padding}"
                                 TabIndex="{TemplateBinding TabIndex}"
                                 local:TextBoxBehavior.SelectAllTextOnFocus="True"/>
                    </local:Spinner>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:DoubleUpDown}" BasedOn="{StaticResource NumericUpDown}">
        <Setter Property="Increment" Value=".1"/>
        <Setter Property="FormatString" Value="F1"/>
    </Style>


    <!-- ******* Spinner ******* -->

    <Style TargetType="{x:Type local:Spinner}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Background" Value="#FFFFFF" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Focusable" Value="False" />
        <Setter Property="IsTabStop" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Spinner}">
                    <Border Background="{TemplateBinding Background}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}">
                        <ContentPresenter/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- ******* ColorBox ******* -->
    <Style TargetType="{x:Type local:BrushPicker}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Background" Value="#E7E8E8" />
        <Setter Property="BorderBrush" Value="#000000" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:BrushPicker}">
                    <Border x:Name="PART_Root"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Border.InputBindings>
                            <KeyBinding Key="Delete" Command="{x:Static local:BrushPicker.RemoveGradientStop}"/>
                        </Border.InputBindings>

                        <Grid Margin="5">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="1*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <Grid.Resources>
                                <Style x:Key="TBStyle" TargetType="TextBlock">
                                    <Setter Property="Margin" Value="2"/>
                                    <Setter Property="VerticalAlignment" Value="Center"/>
                                </Style>
                            </Grid.Resources>

                            <ListBox x:Name="listAvailableBrushType" Height="30"  Visibility="{TemplateBinding BrushTypeVisibility}"                                              
                                                 HorizontalContentAlignment="Center"
                                                 SelectedItem="{Binding BrushType, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" 
                                                 ItemsSource="{Binding AvailableBrushTypes, RelativeSource={RelativeSource TemplatedParent}}">
                                <ListBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <UniformGrid Rows="1" Columns="4"/>
                                    </ItemsPanelTemplate>
                                </ListBox.ItemsPanel>
                                <ListBox.ItemContainerStyle>
                                    <Style TargetType="ListBoxItem">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="ListBoxItem">
                                                    <Border x:Name="Border" Background="Transparent" Padding="0,3">
                                                        <Path x:Name="Icon" Height="12" Width="20" Stretch="Fill" Fill="#FF403C3C" StrokeThickness="1" Stroke="#000000"
                                                                          Data="M371,190L557,190 557,293 371,293 371,190z"/>
                                                    </Border>

                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter Property="Background" Value="Gray" TargetName="Border"/>
                                                            <Setter Property="Foreground" Value="#FFFFFF"/>
                                                        </Trigger>
                                                        <Trigger Property="IsSelected" Value="True">
                                                            <Setter Property="Background" Value="Gray" TargetName="Border"/>
                                                            <Setter Property="Foreground" Value="#FFFFFF"/>
                                                        </Trigger>

                                                        <DataTrigger Binding="{Binding}" Value="None">
                                                            <Setter Property="ToolTip" Value="No Brush"/>
                                                            <Setter Property="StrokeThickness" TargetName="Icon" Value="0"/>
                                                            <Setter TargetName="Icon" Property="Data">
                                                                <Setter.Value>
                                                                    <Geometry>M612,189L452.949,189L452.949,266.024L612,189 M612,196.999L452.949,273.999L612,273.999L612,196.999</Geometry>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding}" Value="Solid">
                                                            <Setter Property="ToolTip" Value="Solid Color Brush"/>
                                                            <Setter Property="Fill" TargetName="Icon" Value="#FF403C3C"/>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding}" Value="Linear">
                                                            <Setter Property="ToolTip" Value="Linear Gradient Brush"/>
                                                            <Setter Property="Fill" TargetName="Icon">
                                                                <Setter.Value>
                                                                    <LinearGradientBrush StartPoint="0,.5" EndPoint="1,.5">
                                                                        <GradientStop Color="#FF403C3C" Offset="0"></GradientStop>
                                                                        <GradientStop Color="#FFFFFF" Offset="1"></GradientStop>
                                                                    </LinearGradientBrush>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding}" Value="Radial">
                                                            <Setter Property="ToolTip" Value="Radial Gradient Brush"/>
                                                            <Setter Property="Fill" TargetName="Icon">
                                                                <Setter.Value>
                                                                    <RadialGradientBrush>
                                                                        <GradientStop Color="#FF403C3C" Offset="1"/>
                                                                        <GradientStop Color="#FFFFFF"/>
                                                                    </RadialGradientBrush>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </DataTrigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </ListBox.ItemContainerStyle>

                            </ListBox>

                            <Grid Margin="0,5,0,5" Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="5" />
                                    <ColumnDefinition Width="20" />
                                    <ColumnDefinition Width="5" />
                                    <!--<ColumnDefinition Width="20" />-->
                                </Grid.ColumnDefinitions>

                                <!-- saturation / brightness selector -->
                                <Grid Grid.Column="0" ClipToBounds="true">

                                    <Border BorderThickness="1" BorderBrush="DimGray">
                                        <local:SaturationBrightnessSelector x:Name="SV" MinHeight="0"
                                                                                       Saturation="{Binding Path=Saturation,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" 
                                                                                       Brightness="{Binding Path=Brightness,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                                                                                       Hue="{Binding ElementName=H,Path=Hue}"/>
                                    </Border>

                                    <Grid VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-6,-6,0,0" Width="12" Height="12"  >
                                        <Ellipse Stroke="#000000" />
                                        <Ellipse Stroke="#FFFFFF" Margin="1" />
                                        <Grid.RenderTransform>
                                            <TranslateTransform X="{Binding ElementName=SV,Path=SaturationOffset}" Y="{Binding ElementName=SV,Path=BrightnessOffset}" />
                                        </Grid.RenderTransform>
                                    </Grid>
                                </Grid>

                                <!-- hue selector -->
                                <local:HueSelector x:Name="H" Grid.Column="2"
                                                                  Hue="{Binding Path=Hue,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" />
                                <Path Grid.Column="2" HorizontalAlignment="Left" Margin="0,-5,0,5" Stroke="#FFFFFF" Fill="#000000" Data="M 0 0 L 7 5 L 0 10Z">
                                    <Path.RenderTransform>
                                        <TranslateTransform Y="{Binding ElementName=H,Path=HueOffset}" />
                                    </Path.RenderTransform>
                                </Path>
                                <Path Grid.Column="2" HorizontalAlignment="Right" Margin="0,-5,0,5" Stroke="#FFFFFF" Fill="#000000" Data="M 0 5 L 7 0 L 7 10 Z">
                                    <Path.RenderTransform>
                                        <TranslateTransform Y="{Binding ElementName=H,Path=HueOffset}" />
                                    </Path.RenderTransform>
                                </Path>

                                <!-- alpha selector -->
                                <!--<Rectangle Grid.Column="4" Fill="{StaticResource AlphaBrush}" />
                                    <local:AlphaSelector x:Name="A" Grid.Column="4" 
                                                                     Alpha="{Binding Path=Alpha,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" />-->
                                <!--<Path Grid.Column="4" HorizontalAlignment="Left" Margin="0,-5,0,5" Stroke="#FFFFFF" Fill="#000000" Data="M 0 0 L 7 5 L 0 10Z">
                                        <Path.RenderTransform>
                                            <TranslateTransform Y="{Binding ElementName=A,Path=AlphaOffset}" />
                                        </Path.RenderTransform>
                                    </Path>
                                    <Path Grid.Column="4" HorizontalAlignment="Right" Margin="0,-5,0,5" Stroke="#FFFFFF" Fill="#000000" Data="M 0 5 L 7 0 L 7 10 Z">
                                        <Path.RenderTransform>
                                            <TranslateTransform Y="{Binding ElementName=A,Path=AlphaOffset}" />
                                        </Path.RenderTransform>
                                    </Path>-->
                            </Grid>

                            <Grid Height="20" Grid.Row="2">

                                <!-- Hide when brush type is None -->
                                <Grid.Style>
                                    <Style TargetType="Grid">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}" Value="None">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Grid.Style>

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="5" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <Rectangle>
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="{Binding Color, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    </Rectangle.Fill>
                                </Rectangle>

                                <TextBox x:Name="PART_CurrentColor" Visibility="Collapsed"
                                                     Text="{Binding Color, RelativeSource={RelativeSource TemplatedParent}}" 
                                                     local:TextBoxBehavior.SelectAllTextOnFocus="True"
                                                     Grid.Column="2" MinWidth="100" >
                                    <TextBox.Style>
                                        <Style TargetType="TextBox">
                                            <Setter Property="BorderBrush" Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"></Setter>
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="TextBox">
                                                        <Border BorderBrush="{TemplateBinding BorderBrush}"
                                                                    BorderThickness="1" Padding="0">
                                                            <ScrollViewer x:Name="PART_ContentHost" Margin="0"/>
                                                        </Border>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </TextBox.Style>
                                </TextBox>

                            </Grid>

                            <Grid Margin="0,5,0,0" Focusable="False" Grid.Row="3">

                                <Grid.Style>
                                    <Style TargetType="Grid">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}" Value="Linear">
                                                <Setter Property="Visibility" Value="Visible"/>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}" Value="Radial">
                                                <Setter Property="Visibility" Value="Visible"/>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Grid.Style>

                                <Grid.ColumnDefinitions>
                                    <!--<ColumnDefinition/>
                                    <ColumnDefinition Width="5"/>
                                    <ColumnDefinition Width="Auto" MinWidth="45"/>-->
                                </Grid.ColumnDefinitions>

                                <StackPanel Grid.Column="0" Focusable="False">

                                    <!-- Click to add gradient stop -->
                                    <local:GradientStopAdder Height="20" Margin="0,0"
                                                                         Focusable="False"
                                                                         IsTabStop="False"
                                                                         FocusVisualStyle="{x:Null}"
                                                                         ColorBox="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                                        <local:GradientStopAdder.Background>
                                            <LinearGradientBrush GradientStops="{Binding Brush, RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource BrushToGradientStopsConverter}}" 
                                                                     StartPoint="0,.5" EndPoint="1,.5"/>
                                        </local:GradientStopAdder.Background>
                                        <Button.Style>
                                            <Style TargetType="Button">
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="Button">
                                                            <Border BorderThickness="0" Background="{TemplateBinding Background}"/>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </Button.Style>
                                    </local:GradientStopAdder>

                                    <!-- gradient stops -->
                                    <ListBox x:Name="lbGradientStops"
                                                         ItemsSource="{Binding Path=Gradients, RelativeSource={RelativeSource TemplatedParent}}"
                                                         SelectedItem="{Binding SelectedGradient,RelativeSource={RelativeSource TemplatedParent}}"
                                                         Background="{x:Null}" Style="{x:Null}" BorderThickness="0"
                                                         FocusVisualStyle="{x:Null}" Focusable="False" IsTabStop="False">
                                        <ListBox.ItemContainerStyle>
                                            <Style TargetType="ListBoxItem">
                                                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                                                <Setter Property="IsTabStop" Value="False"/>
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="ListBoxItem">
                                                            <local:GradientStopSlider x:Name="PART_Slider"
                                                                                                  BorderBrush="#000000"
                                                                                                  IsTabStop="False"
                                                                                                  Style="{StaticResource GradientStopSliderStyle}" 
                                                                                                  Value="{Binding Offset}" Minimum="0" Maximum="1"
                                                                                                  ColorBox="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:BrushPicker}}}"
                                                                                                  SelectedGradient="{Binding}"                                                                                                  
                                                                                                  Margin="0,0,0,2">
                                                                <local:GradientStopSlider.Background>
                                                                    <SolidColorBrush Color="{Binding Color}"/>
                                                                </local:GradientStopSlider.Background>
                                                            </local:GradientStopSlider>

                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsMouseOver" Value="True">
                                                                    <Setter Property="BorderBrush" TargetName="PART_Slider" Value="Orange"/>
                                                                </Trigger>
                                                                <Trigger Property="IsSelected" Value="True">
                                                                    <Setter Property="BorderBrush" TargetName="PART_Slider" Value="Blue"/>
                                                                    <Setter Property="Effect" TargetName="PART_Slider">
                                                                        <Setter.Value>
                                                                            <DropShadowEffect ShadowDepth="2" BlurRadius="2" Direction="270"/>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                </Trigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </ListBox.ItemContainerStyle>

                                        <ListBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <Grid IsItemsHost="True"/>
                                            </ItemsPanelTemplate>
                                        </ListBox.ItemsPanel>

                                    </ListBox>

                                </StackPanel>

                                <!--<Button Grid.Column="2"
                                                    Command="{x:Static local:ColorBox.ReverseGradientStop}"
                                                    Background="Transparent"
                                                    BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
                                                    ToolTip="Reverse gradient stops">
                                    <Button.Style>
                                        <Style TargetType="Button">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="Button">
                                                        <Border Name="Border"
                                                                            BorderThickness="1"                                                                            
                                                                            BorderBrush="{TemplateBinding BorderBrush}"
                                                                            Background="{TemplateBinding Background}">
                                                            <Path x:Name="Icon"
                                                                              Data="F1 M 10.0001,27L 10,16L 29.25,16L 25,12L 31.5,12L 38,18L 31.5,24L 25,24L 29.25,20L 14,20L 14,23.5L 10.0001,27 Z M 38,21L 38,32L 18.75,32L 23,36L 16.5,36L 10,30L 16.5,24L 23,24L 18.75,28L 34,28L 34,24.5L 38,21 Z"
                                                                              StrokeThickness="0" Fill="#000000" Height="16" Width="20" Stretch="Fill"/>
                                                        </Border>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="IsMouseOver" Value="True">
                                                                <Setter TargetName="Icon" Property="Fill">
                                                                    <Setter.Value>
                                                                        <SolidColorBrush Color="{Binding Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ColorBox}}}"/>
                                                                    </Setter.Value>
                                                                </Setter>
                                                            </Trigger>
                                                            <Trigger Property="IsPressed" Value="True">
                                                                <Setter Property="BorderBrush" TargetName="Border">
                                                                    <Setter.Value>
                                                                        <SolidColorBrush Color="{Binding Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ColorBox}}}"/>
                                                                    </Setter.Value>
                                                                </Setter>
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </Button.Style>
                                </Button>-->

                            </Grid>

                            <StackPanel Margin="0,5,0,0" Grid.Row="4">
                                <StackPanel.Style>
                                    <Style TargetType="StackPanel">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}" Value="None">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </StackPanel.Style>

                                <!--<ToggleButton x:Name="PART_AdditionalPropertyOpen"
                                                          BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
                                                          ToolTip="Additional Properties"
                                                          Height="20">
                                    <ToggleButton.Style>
                                        <Style TargetType="ToggleButton">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="ToggleButton">
                                                        <Border x:Name="Border"
                                                                            BorderThickness="1"
                                                                            Background="Transparent"
                                                                            BorderBrush="{TemplateBinding BorderBrush}">
                                                            <Path x:Name="Icon"
                                                                              Data="M518.000,395.000C509.500,377.166,484.333,306.833,467.000,288C449.666,269.166,405.500,262.000,414,282C422.499,301.999,484.166,408,518.000,408C551.833,408,609,301.999,617.000,282C625.000,262.000,582.500,269.166,566.000,288C549.500,306.833,526.000,377.166,518.000,395.000"
                                                                              Height="12" Width="18"
                                                                              Fill="{TemplateBinding Foreground}"
                                                                              Stretch="Fill"
                                                                              VerticalAlignment="Center"
                                                                              HorizontalAlignment="Center"
                                                                              RenderTransformOrigin=".5,.5"/>
                                                        </Border>

                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="IsChecked" Value="True">
                                                                <Setter TargetName="Icon" Property="RenderTransform">
                                                                    <Setter.Value>
                                                                        <ScaleTransform ScaleY="-1"/>
                                                                    </Setter.Value>
                                                                </Setter>
                                                            </Trigger>
                                                            <Trigger Property="IsMouseOver" Value="True">
                                                                <Setter TargetName="Icon" Property="Fill">
                                                                    <Setter.Value>
                                                                        <SolidColorBrush Color="{Binding Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ColorBox}}}"/>
                                                                    </Setter.Value>
                                                                </Setter>
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </ToggleButton.Style>
                                </ToggleButton>-->


                                <!--<StackPanel Margin="0,5,0,0"
                                                        Visibility="{Binding ElementName=PART_AdditionalPropertyOpen, Path=IsChecked, Converter={StaticResource BoolToVis}}">-->
                                <StackPanel Margin="0,5,0,0" >

                                    <!-- Solid brush -->
                                    <!--<DockPanel Margin="0,2">
                                        <DockPanel.Style>
                                            <Style TargetType="DockPanel">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}" Value="Solid">
                                                        <Setter Property="Visibility" Value="Visible"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </DockPanel.Style>

                                        <TextBlock Text="Opacity" VerticalAlignment="Center"/>
                                        <Slider Style="{StaticResource OpacitySliderStyle}" Margin="10,0,0,0"/>
                                    </DockPanel>-->

                                    <!-- Linear brush -->
                                    <!--<DockPanel>
                                        <DockPanel.Style>
                                            <Style TargetType="DockPanel">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}" Value="Linear">
                                                        <Setter Property="Visibility" Value="Visible"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </DockPanel.Style>

                                        <UniformGrid Rows="5" DockPanel.Dock="Left" Margin="0,0,5,0" >
                                            <TextBlock Text="Start Point" VerticalAlignment="Center"/>
                                            <TextBlock Text="End Point" VerticalAlignment="Center"/>
                                            <TextBlock Text="Mapping Mode" VerticalAlignment="Center"/>
                                            <TextBlock Text="Spread Method" VerticalAlignment="Center"/>
                                            <TextBlock Text="Opacity" VerticalAlignment="Center"/>
                                        </UniformGrid>

                                        <UniformGrid Rows="5" DockPanel.Dock="Right">
                                            <UniformGrid Rows="1">
                                                <local:DoubleUpDown Value="{Binding StartX, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                <local:DoubleUpDown Value="{Binding StartY, RelativeSource={RelativeSource TemplatedParent}}"/>
                                            </UniformGrid>

                                            <UniformGrid Rows="1">
                                                <local:DoubleUpDown Value="{Binding EndX, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                <local:DoubleUpDown Value="{Binding EndY, RelativeSource={RelativeSource TemplatedParent}}"/>
                                            </UniformGrid>

                                            <ComboBox Margin="2" ItemsSource="{Binding MappingModeTypes, RelativeSource={RelativeSource TemplatedParent}}"
                                                                  SelectedItem="{Binding MappingMode, RelativeSource={RelativeSource TemplatedParent}}"/>

                                            <ComboBox Margin="2" ItemsSource="{Binding SpreadMethodTypes, RelativeSource={RelativeSource TemplatedParent}}"
                                                                  SelectedItem="{Binding SpreadMethod, RelativeSource={RelativeSource TemplatedParent}}"/>

                                            <Slider Style="{StaticResource OpacitySliderStyle}"/>
                                        </UniformGrid>
                                    </DockPanel>-->

                                    <!-- Radial brush -->
                                    <DockPanel>
                                        <DockPanel.Style>
                                            <Style TargetType="DockPanel">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ElementName=listAvailableBrushType, Path=SelectedValue}" Value="Radial">
                                                        <Setter Property="Visibility" Value="Visible"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </DockPanel.Style>

                                        <UniformGrid Rows="7" DockPanel.Dock="Left" Margin="0,0,5,0">
                                            <TextBlock Text="Gradient Origin" VerticalAlignment="Center"/>
                                            <TextBlock Text="Center" VerticalAlignment="Center"/>
                                            <TextBlock Text="Radius X" VerticalAlignment="Center"/>
                                            <TextBlock Text="Radius Y" VerticalAlignment="Center"/>
                                            <TextBlock Text="Mapping Mode" VerticalAlignment="Center"/>
                                            <TextBlock Text="Spread Method" VerticalAlignment="Center"/>
                                            <TextBlock Text="Opacity" VerticalAlignment="Center"/>
                                        </UniformGrid>

                                        <UniformGrid Rows="7" DockPanel.Dock="Right">
                                            <UniformGrid Rows="1">
                                                <local:DoubleUpDown Value="{Binding GradientOriginX, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                <local:DoubleUpDown Value="{Binding GradientOriginY, RelativeSource={RelativeSource TemplatedParent}}"/>
                                            </UniformGrid>

                                            <UniformGrid Rows="1">
                                                <local:DoubleUpDown Value="{Binding CenterX, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                <local:DoubleUpDown Value="{Binding CenterY, RelativeSource={RelativeSource TemplatedParent}}"/>
                                            </UniformGrid>

                                            <local:DoubleUpDown Value="{Binding RadiusX, RelativeSource={RelativeSource TemplatedParent}}"/>

                                            <local:DoubleUpDown Value="{Binding RadiusY, RelativeSource={RelativeSource TemplatedParent}}"/>

                                            <ComboBox Margin="2"
                                                                  ItemsSource="{Binding MappingModeTypes, RelativeSource={RelativeSource TemplatedParent}}"
                                                                  SelectedItem="{Binding MappingMode, RelativeSource={RelativeSource TemplatedParent}}"/>

                                            <ComboBox Margin="2" 
                                                                  ItemsSource="{Binding SpreadMethodTypes, RelativeSource={RelativeSource TemplatedParent}}"
                                                                  SelectedItem="{Binding SpreadMethod, RelativeSource={RelativeSource TemplatedParent}}"/>

                                            <Slider Style="{StaticResource OpacitySliderStyle}"/>
                                        </UniformGrid>
                                    </DockPanel>

                                </StackPanel>
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>