mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Compare commits
1 Commits
feat/custo
...
feat/1487
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48991c2167 |
@@ -37,6 +37,28 @@ internal sealed partial class AutoSuggestTokenBox : TokenizingTextBox
|
||||
border.Background = appResourceProvider.GetResource<Microsoft.UI.Xaml.Media.Brush>("AutoSuggestBoxSuggestionsListBackground");
|
||||
border.CornerRadius = new(0, 0, 8, 8);
|
||||
}
|
||||
|
||||
if (this.FindDescendant("PART_AutoSuggestBox") is Microsoft.UI.Xaml.Controls.AutoSuggestBox autoSuggestBox)
|
||||
{
|
||||
autoSuggestBox.GotFocus += OnSuggestBoxFocusGot;
|
||||
autoSuggestBox.LosingFocus += OnSuggestBoxFocusLosing;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSuggestBoxFocusGot(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Microsoft.UI.Xaml.Controls.AutoSuggestBox autoSuggestBox)
|
||||
{
|
||||
autoSuggestBox.ItemsSource = AvailableTokens.Values;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSuggestBoxFocusLosing(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Microsoft.UI.Xaml.Controls.AutoSuggestBox autoSuggestBox)
|
||||
{
|
||||
autoSuggestBox.ItemsSource = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnFilterSuggestionRequested(Microsoft.UI.Xaml.Controls.AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
|
||||
|
||||
@@ -317,7 +317,6 @@
|
||||
QueryIcon="{cw:FontIconSource Glyph=}"
|
||||
Style="{StaticResource DefaultTokenizingTextBoxStyle}"
|
||||
SuggestedItemTemplate="{StaticResource TokenTemplate}"
|
||||
SuggestedItemsSource="{Binding AvailableTokens.Values}"
|
||||
Text="{Binding FilterToken, Mode=TwoWay}"
|
||||
TokenItemTemplate="{StaticResource TokenTemplate}">
|
||||
<shca:AutoSuggestTokenBox.ItemsPanel>
|
||||
|
||||
@@ -185,7 +185,6 @@
|
||||
PlaceholderText="{shcm:ResourceString Name=ViewPageWiKiWeaponAutoSuggestBoxPlaceHolder}"
|
||||
QueryIcon="{cw:FontIconSource Glyph=}"
|
||||
SuggestedItemTemplate="{StaticResource TokenTemplate}"
|
||||
SuggestedItemsSource="{Binding AvailableTokens.Values}"
|
||||
Text="{Binding FilterToken, Mode=TwoWay}"
|
||||
TokenItemTemplate="{StaticResource TokenTemplate}">
|
||||
<shca:AutoSuggestTokenBox.ItemsPanel>
|
||||
|
||||
Reference in New Issue
Block a user