aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Chip.xaml
blob: aad2a46e59c38a1f5eadab6828b62e93ccc119c2 (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
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:MaterialDesignThemes.Wpf.Themes"
                    xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
                    xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters">

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <converters:NullableToVisibilityConverter x:Key="NullableToVisibilityConverter" />

    <!-- not happy with where the tool tip is going right now -->
    <!--
    <Style x:Key="MaterialDesignChipToolTip" TargetType="ToolTip">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToolTip">
                    <wpf:Card Foreground="{DynamicResource MaterialDesignBody}"
                              FontSize="15"
                              FontWeight="Regular"
                              Padding="0 8 0 8"
                              RenderOptions.ClearTypeHint="Enabled"  
                              wpf:ShadowAssist.ShadowDepth="Depth3"
                              Margin="8">
                        <Grid Margin="16 8 16 8">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <Border>
                                <Border.Background>
                                    <VisualBrush Visual="{Binding ElementName=PART_MonthView}" Stretch="UniformToFill"/>
                                </Border.Background>
                                <Border.RenderTransform>
                                    <TranslateTransform X="0"/>
                                </Border.RenderTransform>
                            </Border>

                            <ContentControl Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:Chip}, Path=Icon}"
                                            x:Name="IconControl"
                                            Background="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:Chip}, Path=IconBackground}"
                                            Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:Chip}, Path=IconForeground}"
                                            FontSize="17"
                                            FontWeight="Regular"
                                            Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:Chip}, Path=Icon, Converter={StaticResource NullableToVisibilityConverter}}"
                                            VerticalAlignment="Center"
                                            VerticalContentAlignment="Center"
                                            HorizontalContentAlignment="Center"
                                            Height="32" Width="32"
                                            Margin="0 0 8 0">
                                <ContentControl.Clip>
                                    <EllipseGeometry RadiusX="16" RadiusY="16" Center="16,16" />
                                </ContentControl.Clip>
                                <ContentControl.Template>
                                    <ControlTemplate TargetType="ContentControl">
                                        <Border Background="{TemplateBinding Background}">
                                            <ContentPresenter Content="{TemplateBinding Content}"
                                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                        </Border>
                                    </ControlTemplate>
                                </ContentControl.Template>
                            </ContentControl>
                            <ContentControl Grid.Column="1" Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:Chip}, Path=Content}"
                                            FontSize="13" />
                            <ContentControl Grid.Column="1" Grid.Row="1" Content="{TemplateBinding Content}"
                                            FontSize="11"/>
                        </Grid>
                    </wpf:Card>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    -->
    
    <Style TargetType="{x:Type wpf:Chip}">
        <Setter Property="Height" Value="32" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Background" Value="{DynamicResource MaterialDesignChipBackground}" />
        <Setter Property="IconBackground" Value="{DynamicResource PrimaryHueMidBrush}" />
        <Setter Property="IconForeground" Value="{DynamicResource PrimaryHueMidForegroundBrush}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type wpf:Chip}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Border CornerRadius="16" Background="{TemplateBinding Background}" Grid.ColumnSpan="3" />
                        <ContentControl Content="{TemplateBinding Icon}"
                                        x:Name="IconControl"
                                        Background="{TemplateBinding IconBackground}"
                                        Foreground="{TemplateBinding IconForeground}"
                                        FontSize="17"
                                        FontWeight="Regular"
                                        IsTabStop="False"
                                        Visibility="{TemplateBinding Icon, Converter={StaticResource NullableToVisibilityConverter}}"
                                        VerticalAlignment="Center"
                                        VerticalContentAlignment="Center"
                                        HorizontalContentAlignment="Center"
                                        Height="32" Width="32">
                            <ContentControl.Clip>
                                <EllipseGeometry RadiusX="16" RadiusY="16" Center="16,16" />
                            </ContentControl.Clip>
                            <ContentControl.Template>
                                <ControlTemplate TargetType="ContentControl">
                                    <Border Background="{TemplateBinding Background}">
                                        <ContentPresenter Content="{TemplateBinding Content}"
                                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                    </Border>
                                </ControlTemplate>
                            </ContentControl.Template>
                        </ContentControl>
                        <ContentControl Content="{TemplateBinding Content}"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                        ContentStringFormat="{TemplateBinding ContentTemplateSelector}"                                        
                                        x:Name="TextBlock"
                                        IsTabStop="False"
                                        VerticalAlignment="Center"
                                        Margin="8 0 12 0"
                                        Grid.Column="1"/>
                        <Button Grid.Column="2" Visibility="{TemplateBinding IsDeletable, Converter={StaticResource BooleanToVisibilityConverter}}"
                                x:Name="PART_DeleteButton"
                                ToolTip="{TemplateBinding DeleteToolTip}"
                                Margin="-6 0 8 0"
                                VerticalAlignment="Center"
                                Width="16" Height="16">
                            <Button.Template>
                                <ControlTemplate>
                                    <Grid>
                                        <Ellipse x:Name="Bg" Fill="#FFA6A6A6" Stroke="#FF009587" StrokeThickness="0" />
                                        <wpf:PackIcon Kind="Close" Width="12" Height="12"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center" />
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="Bg" Property="StrokeThickness" Value="1" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger SourceName="IconControl" Property="Visibility" Value="Collapsed">
                            <Setter TargetName="TextBlock" Property="Margin" Value="12 0 12 0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>