fix: remove MinHeight & fix TagInput Foreground.

This commit is contained in:
Zhang Dian
2025-09-16 19:03:58 +08:00
parent 13008225c0
commit 68cdd4609f
4 changed files with 17 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System;
using System.Collections.ObjectModel;
using Avalonia.Controls;
using CommunityToolkit.Mvvm.ComponentModel;
@@ -82,7 +82,7 @@ public class MultiAutoCompleteBoxDemoViewModel: ObservableObject
{
if (text is null) return true;
if (data is not ControlData control) return false;
return control.MenuHeader.Contains(text )|| control.Chinese.Contains(text);
return control.MenuHeader.Contains(text, StringComparison.OrdinalIgnoreCase) || control.Chinese.Contains(text, StringComparison.OrdinalIgnoreCase);
}
}

View File

@@ -1,17 +1,15 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:MultiAutoCompleteBox}" TargetType="u:MultiAutoCompleteBox">
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
<Setter Property="CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}"></Setter>
<Setter Property="CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:MultiAutoCompleteBox">
<Panel>
<Border
Name="PART_RootBorder"
MinHeight="30"
Padding="{DynamicResource TextBoxContentPadding}"
VerticalAlignment="Stretch"
CornerRadius="{TemplateBinding CornerRadius}"

View File

@@ -63,7 +63,7 @@
</ControlTheme>
<ControlTheme x:Key="TagInputTextBoxTheme" TargetType="TextBox">
<Setter Property="Foreground" Value="{DynamicResource TextBoxInnerForeground}" />
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />