|
5 | 5 |
|
6 | 6 | <BooleanToVisibilityConverter x:Key="BoolToVisConverter" /> |
7 | 7 |
|
8 | | - <Style x:Key="TextBoxSuggestionItemStyle" TargetType="ListBoxItem"> |
| 8 | + <Style x:Key="TextBoxSuggestionItemStyle" TargetType="{x:Type ListBoxItem}"> |
9 | 9 | <Setter Property="Template"> |
10 | 10 | <Setter.Value> |
11 | | - <ControlTemplate TargetType="ListBoxItem"> |
| 11 | + <ControlTemplate TargetType="{x:Type ListBoxItem}"> |
12 | 12 | <Border x:Name="ContentBorder" Background="{Binding Path=SuggestionBackground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=editors:AutoCompleteTextBox}, Mode=OneWay}"> |
13 | 13 | <ContentPresenter /> |
14 | 14 | </Border> |
|
26 | 26 | </Setter> |
27 | 27 | </Style> |
28 | 28 |
|
29 | | - <Style x:Key="ComboBoxSuggestionItemStyle" TargetType="ListBoxItem"> |
| 29 | + <Style x:Key="ComboBoxSuggestionItemStyle" TargetType="{x:Type ListBoxItem}"> |
30 | 30 | <Setter Property="Template"> |
31 | 31 | <Setter.Value> |
32 | | - <ControlTemplate TargetType="ListBoxItem"> |
| 32 | + <ControlTemplate TargetType="{x:Type ListBoxItem}"> |
33 | 33 | <Border x:Name="ContentBorder" Background="{Binding Path=SuggestionBackground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=editors:AutoCompleteComboBox}, Mode=OneWay}"> |
34 | 34 | <ContentPresenter /> |
35 | 35 | </Border> |
|
167 | 167 | </Setter> |
168 | 168 | </Style> |
169 | 169 |
|
170 | | - <Style TargetType="editors:AutoCompleteComboBox"> |
| 170 | + <Style TargetType="{x:Type editors:AutoCompleteComboBox}"> |
171 | 171 | <Setter Property="Focusable" Value="True" /> |
172 | 172 | <Setter Property="SuggestionBackground" Value="White" /> |
173 | | - <Setter Property="BorderThickness" Value="0,0,0,1" /> |
| 173 | + <Setter Property="BorderThickness" Value="1" /> |
| 174 | + <Setter Property="BorderBrush" Value="#FFABADB3" /> |
174 | 175 | <Setter Property="Background" Value="Transparent" /> |
175 | 176 | <Setter Property="HorizontalContentAlignment" Value="Left" /> |
176 | 177 | <Setter Property="VerticalContentAlignment" Value="Top" /> |
|
182 | 183 | <Setter.Value> |
183 | 184 | <ControlTemplate TargetType="{x:Type editors:AutoCompleteComboBox}"> |
184 | 185 | <Grid> |
185 | | - <DockPanel> |
186 | | - <ContentPresenter |
187 | | - x:Name="PART_Icon" |
188 | | - ContentSource="Icon" |
189 | | - Visibility="{TemplateBinding IconVisibility}" /> |
190 | | - <Grid> |
191 | | - <TextBlock |
192 | | - x:Name="PART_Watermark" |
193 | | - HorizontalAlignment="Left" |
194 | | - VerticalAlignment="Center" |
195 | | - DockPanel.Dock="Left" |
196 | | - Focusable="False" |
197 | | - Foreground="Gray" |
198 | | - Text="{TemplateBinding Watermark}" |
199 | | - Visibility="Collapsed" /> |
200 | | - <DockPanel Margin="3,0"> |
201 | | - <Expander x:Name="PART_Expander" DockPanel.Dock="Right" /> |
| 186 | + <ContentPresenter |
| 187 | + x:Name="PART_Icon" |
| 188 | + ContentSource="Icon" |
| 189 | + Visibility="{TemplateBinding IconVisibility}" /> |
| 190 | + <Grid Margin="3,0"> |
| 191 | + <Grid.ColumnDefinitions> |
| 192 | + <ColumnDefinition Width="*" /> |
| 193 | + <ColumnDefinition Width="Auto" /> |
| 194 | + </Grid.ColumnDefinitions> |
| 195 | + <Border |
| 196 | + Background="{TemplateBinding Background}" |
| 197 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 198 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 199 | + CornerRadius="0"> |
| 200 | + <Grid> |
| 201 | + <TextBlock |
| 202 | + x:Name="PART_Watermark" |
| 203 | + Margin="3,0" |
| 204 | + HorizontalAlignment="Left" |
| 205 | + VerticalAlignment="Center" |
| 206 | + Focusable="False" |
| 207 | + Foreground="Gray" |
| 208 | + Text="{TemplateBinding Watermark}" |
| 209 | + Visibility="Collapsed" /> |
202 | 210 | <TextBox |
203 | 211 | x:Name="PART_Editor" |
204 | 212 | HorizontalAlignment="Stretch" |
205 | 213 | VerticalAlignment="Center" |
206 | 214 | CharacterCasing="{Binding Path=CharacterCasing, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}" |
207 | 215 | Focusable="True" |
208 | | - MaxLength="{Binding Path=MaxLength, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}" /> |
209 | | - </DockPanel> |
210 | | - </Grid> |
211 | | - </DockPanel> |
| 216 | + MaxLength="{Binding Path=MaxLength, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}" |
| 217 | + Style="{StaticResource ResourceKey=TransparentTextBoxStyle}" /> |
| 218 | + </Grid> |
| 219 | + </Border> |
| 220 | + <Expander x:Name="PART_Expander" Grid.Column="1" /> |
| 221 | + </Grid> |
212 | 222 | <Popup |
213 | 223 | x:Name="PART_Popup" |
214 | 224 | MinWidth="{TemplateBinding ActualWidth}" |
|
246 | 256 | </Popup> |
247 | 257 |
|
248 | 258 | </Grid> |
249 | | - <!--</Border>--> |
250 | 259 | <ControlTemplate.Triggers> |
251 | 260 | <Trigger SourceName="PART_Editor" Property="Text" Value=""> |
252 | 261 | <Setter TargetName="PART_Watermark" Property="Visibility" Value="Visible" /> |
|
0 commit comments