Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixing Issues #3476:
- Corrected the styling of the outlined AutoSuggestBox on the Fields page.
- Resolved an issue where selecting an element was problematic when there was only one suggestion available.
- Adjusted the dynamic setting of the DropDownBox background to ensure compatibility with theme changes during live updates.
  • Loading branch information
AbderrahmaneAhmam committed Mar 6, 2024
commit 526259d57d97bf8525af532954f3bd014c44dd0b
4 changes: 2 additions & 2 deletions MainDemo.Wpf/Fields.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,11 @@
</smtx:XamlDisplay>

<TextBlock Grid.Row="1"
Grid.Column="2"
Grid.Column="3"
Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
Text="Outlined AutoSuggestBox" />
<smtx:XamlDisplay Grid.Row="2"
Grid.Column="2"
Grid.Column="3"
UniqueKey="fields_autosuggestion_4">
<materialDesign:AutoSuggestBox materialDesign:HintAssist.Hint="Color"
materialDesign:TextFieldAssist.HasClearButton="True"
Expand Down
2 changes: 1 addition & 1 deletion MaterialDesignThemes.Wpf/AutoSuggestBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private void AutoSuggestionListBox_PreviewMouseDown(object sender, MouseButtonEv
var selectedItem = element.DataContext;
if (!_autoSuggestBoxList.Items.Contains(selectedItem))
return;
if (_autoSuggestBoxList.SelectedItem != selectedItem)
if (!_autoSuggestBoxList.SelectedItem.Equals(selectedItem))
{
_autoSuggestBoxList.SelectionChanged += OnSelectionChanged;
_autoSuggestBoxList.SelectedItem = selectedItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Style x:Key="MaterialDesignAutoSuggestBoxBase"
TargetType="{x:Type wpf:AutoSuggestBox}"
BasedOn="{StaticResource MaterialDesignTextBoxBase}">
<Setter Property="DropDownBackground" Value="White" />
<Setter Property="DropDownBackground" Value="{DynamicResource MaterialDesign.Brush.Card.Background}" />
<Setter Property="DropDownElevation" Value="Dp2" />
<Setter Property="Template">
<Setter.Value>
Expand Down Expand Up @@ -224,6 +224,7 @@
DisplayMemberPath="{TemplateBinding DisplayMember}"
Focusable="False"
IsSynchronizedWithCurrentItem="True"
SelectedIndex="-1"
ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
ItemTemplate="{TemplateBinding ItemTemplate}"
ItemsSource="{TemplateBinding Suggestions}"
Expand Down