aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml
blob: 58bb9ef34586fae9c6dec8fc0ed44a9fa43db5b8 (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
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf"
                    xmlns:editors="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete"
                    xmlns:local="clr-namespace:Tango.MachineStudio.Common.Resources">
    <ResourceDictionary.MergedDictionaries>
        <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
        <!-- Accent and AppTheme setting -->
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml">
        </ResourceDictionary>
        <!--Material Design-->
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/materialdesigncolor.lightblue.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/materialdesigncolor.yellow.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.CheckBox.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ListBox.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RadioButton.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.TextBlock.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.Label.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.Slider.xaml">
        </ResourceDictionary>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.ProgressBar.xaml"/>


        <!--MahApps Brushes-->
        <ResourceDictionary>
            <SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource Primary700}" />
            <SolidColorBrush x:Key="AccentColorBrush" Color="{DynamicResource Primary500}" />
            <SolidColorBrush x:Key="AccentColorBrush2" Color="{DynamicResource Primary400}" />
            <SolidColorBrush x:Key="AccentColorBrush3" Color="{DynamicResource Primary300}" />
            <SolidColorBrush x:Key="AccentColorBrush4" Color="{DynamicResource Primary200}" />
            <SolidColorBrush x:Key="WindowTitleColorBrush" Color="{DynamicResource Primary700}" />
            <SolidColorBrush x:Key="AccentSelectedColorBrush" Color="{DynamicResource Primary500Foreground}" />
            <LinearGradientBrush x:Key="ProgressBrush" EndPoint="0.001,0.5" StartPoint="1.002,0.5">
                <GradientStop Color="{DynamicResource Primary700}" Offset="0" />
                <GradientStop Color="{DynamicResource Primary300}" Offset="1" />
            </LinearGradientBrush>
            <SolidColorBrush x:Key="CheckmarkFill" Color="{DynamicResource Primary500}" />
            <SolidColorBrush x:Key="RightArrowFill" Color="{DynamicResource Primary500}" />
            <SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{DynamicResource Primary500Foreground}" />
            <SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{DynamicResource Primary500}" Opacity="0.4" />
        </ResourceDictionary>

        <!--Styles-->
        <ResourceDictionary>

            <BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
            <converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" />

            <Style TargetType="editors:AutoCompleteTextBox" >
                <Setter Property="Focusable" Value="True" />
                <Setter Property="BorderThickness" Value="0 0 0 1"/>
                <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
                <Setter Property="Background" Value="Transparent"/>
                <!--<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>-->
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                <Setter Property="VerticalContentAlignment" Value="Top"/>
                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                <Setter Property="AllowDrop" Value="true"/>
                <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
                <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                <Setter Property="Validation.ErrorTemplate" Value="{DynamicResource MaterialDesignValidationErrorTemplate}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type editors:AutoCompleteTextBox}">
                            <Grid>
                                <DockPanel>
                                    <ContentPresenter ContentSource="Icon"
                                                  x:Name="PART_Icon"
                                                  Visibility="{TemplateBinding IconVisibility}" />
                                    <Grid>
                                        <TextBlock x:Name="PART_Watermark"
                                               Text="{TemplateBinding Watermark}"
                                               Visibility="Collapsed"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Left"
                                               Focusable="False"
                                               Foreground="Gray"
                                               Margin="3,0" />
                                        <TextBox x:Name="PART_Editor"
                                             Focusable="True"
                                             HorizontalAlignment="Stretch"
                                             VerticalAlignment="Center"
                                             Style="{StaticResource ResourceKey=MaterialDesignTextBox}"
                                             MaxLength="{Binding Path=MaxLength, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}"
                                             CharacterCasing="{Binding Path=CharacterCasing, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}"
                                             Text="{Binding Path=Text, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}" />
                                    </Grid>
                                </DockPanel>
                                <Popup x:Name="PART_Popup"
                                   IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource Mode=TemplatedParent},Mode=TwoWay}"
                                   Width="{TemplateBinding ActualWidth}"
                                   HorizontalOffset="0"
                                   MinHeight="25"
                                   MaxHeight="600"
                                   AllowsTransparency="True"
                                   PopupAnimation="Slide"
                                   Focusable="False">
                                    <Border Background="White"
                                        BorderThickness="1"
                                        BorderBrush="#BDBDBD"
                                        CornerRadius="0"
                                        Padding="2">
                                        <Grid>
                                            <ListBox x:Name="PART_Selector"
                                                 ItemTemplate="{TemplateBinding ItemTemplate}"
                                                 ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                                 Focusable="False"
                                                 BorderThickness="0"
                                                 MaxHeight="{Binding Path=MaxPopupHeight, RelativeSource={RelativeSource Mode=TemplatedParent},Mode=TwoWay}"
                                                 ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                                 ScrollViewer.VerticalScrollBarVisibility="Auto"
                                                >
                                            </ListBox>
                                            <Border Visibility="{Binding Path=IsLoading, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource   ResourceKey=BoolToVisConverter}}">
                                                <ContentPresenter ContentSource="LoadingContent"/>
                                            </Border>
                                        </Grid>
                                    </Border>
                                </Popup>

                            </Grid>
                            <!--</Border>-->
                            <ControlTemplate.Triggers>
                                <Trigger Property="Text"
                                 Value=""
                                 SourceName="PART_Editor">
                                    <Setter Property="Visibility"
                                    Value="Visible"
                                    TargetName="PART_Watermark" />
                                </Trigger>
                                <Trigger Property="IconPlacement"
                                 Value="Left">
                                    <Setter Property="DockPanel.Dock"
                                    Value="Left"
                                    TargetName="PART_Icon" />
                                </Trigger>
                                <Trigger Property="IconPlacement"
                                 Value="Right">
                                    <Setter Property="DockPanel.Dock"
                                    Value="Right"
                                    TargetName="PART_Icon" />
                                </Trigger>
                                <Trigger Property="Validation.HasError" Value="True">
                                    <Setter Property="BorderBrush"
                                    Value="Red"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>

    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>