add ignoreTextChanged

This commit is contained in:
NaBian committed 2021-09-08 00:08:56 +08:00
1 parent fbaeb194e8
commit eea87ad879
34 files changed
+733 -6

No files matched your search

@@ -44,7 +44,7 @@
"demoItemList": [
[ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "", "Interacting" ],
[ "PropertyGrid", "PropertyGridDemoCtl", "PropertyGridEditorPart_16x", "", "DataEntry" ],
[ "ImageSelector", "ImageSelectorDemoCtl", "Image_16x", "1", "DataEntry" ],
[ "ImageSelector", "ImageSelectorDemoCtl", "Image_16x", "", "DataEntry" ],
[ "ImageBlock", "ImageBlockDemoCtl", "ImageStack_16x", "", "DataDisplay" ],
[ "Magnifier", "MagnifierDemoCtl", "Search_16x", "", "Interacting" ],
[ "Gravatar", "GravatarDemoCtl", "User_16x", "", "DataDisplay" ],
@@ -57,6 +57,7 @@
[ "TextBox", "TextBoxDemoCtl", "TextBox_16x", "", "DataEntry" ],
[ "ComboBox", "ComboBoxDemoCtl", "ComboBox_16x", "", "DataEntry" ],
[ "CheckComboBox", "CheckComboBoxDemoCtl", "CheckBoxList_16x", "1", "DataEntry" ],
[ "AutoCompleteTextBox", "AutoCompleteTextBoxDemoCtl", "AutoComplete_16x", "1", "DataEntry" ],
[ "PasswordBox", "PasswordBoxDemoCtl", "PasswordBox_16x", "", "DataEntry" ],
[ "PinBox", "PinBoxDemoCtl", "Ellipsis_16x", "", "DataEntry" ],
[ "DatePicker", "DatePickerDemoCtl", "DatePicker_16x", "", "DataEntry" ],
@@ -60,6 +60,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\TextDialogWithTimer.xaml.cs">
<DependentUpon>TextDialogWithTimer.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\AutoCompleteTextBoxDemoCtl.xaml.cs">
<DependentUpon>AutoCompleteTextBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ElementGroupDemoCtl.xaml.cs">
<DependentUpon>ElementGroupDemoCtl.xaml</DependentUpon>
</Compile>
@@ -408,6 +411,7 @@
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Basic\ChatBoxViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Basic\InteractiveDialogViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Common\ComboBoxDemoViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\AutoCompleteTextBoxDemoViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\BadgeDemoViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\CardDemoViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\CoverViewModel.cs" />
@@ -540,6 +544,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\AutoCompleteTextBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ElementGroupDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -124,6 +124,17 @@ namespace HandyControlDemo.Properties.Langs
}
}
/// <summary>
/// Looks up a localized string similar to 自动补全文本框.
/// </summary>
public static string AutoCompleteTextBox
{
get
{
return ResourceManager.GetString("AutoCompleteTextBox", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to 标记.
/// </summary>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>元素组</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>自动补全文本框</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -798,4 +798,7 @@
<data name="ElementGroup" xml:space="preserve">
<value>ElementGroup</value>
</data>
<data name="AutoCompleteTextBox" xml:space="preserve">
<value>AutoCompleteTextBox</value>
</data>
</root>
@@ -42,6 +42,7 @@ namespace HandyControlDemo.Properties.Langs
OnPropertyChanged(nameof(AnimationPath));
OnPropertyChanged(nameof(AppClosingTip));
OnPropertyChanged(nameof(Ask));
OnPropertyChanged(nameof(AutoCompleteTextBox));
OnPropertyChanged(nameof(Badge));
OnPropertyChanged(nameof(BasicInfo));
OnPropertyChanged(nameof(BasicLayout));
@@ -291,6 +292,11 @@ namespace HandyControlDemo.Properties.Langs
/// </summary>
public string Ask => Lang.Ask;
/// <summary>
/// 查找类似 自动补全文本框 的本地化字符串。
/// </summary>
public string AutoCompleteTextBox => Lang.AutoCompleteTextBox;
/// <summary>
/// 查找类似 标记 的本地化字符串。
/// </summary>
@@ -564,7 +570,7 @@ namespace HandyControlDemo.Properties.Langs
/// <summary>
/// 查找类似 元素组 的本地化字符串。
/// </summary>
public string ElementGroup => Lang.ElementGroup;
public string ElementGroup => Lang.ElementGroup;
/// <summary>
/// 查找类似 邮箱 的本地化字符串。
@@ -574,7 +580,7 @@ namespace HandyControlDemo.Properties.Langs
/// <summary>
/// 查找类似 空状态 的本地化字符串。
/// </summary>
public string Empty => Lang.Empty;
public string Empty => Lang.Empty;
/// <summary>
/// 查找类似 错误 的本地化字符串。
@@ -1435,6 +1441,11 @@ namespace HandyControlDemo.Properties.Langs
/// </summary>
public static string Ask = nameof(Ask);
/// <summary>
/// 查找类似 自动补全文本框 的本地化字符串。
/// </summary>
public static string AutoCompleteTextBox = nameof(AutoCompleteTextBox);
/// <summary>
/// 查找类似 标记 的本地化字符串。
/// </summary>
@@ -1708,7 +1719,7 @@ namespace HandyControlDemo.Properties.Langs
/// <summary>
/// 查找类似 元素组 的本地化字符串。
/// </summary>
public static string ElementGroup = nameof(ElementGroup);
public static string ElementGroup = nameof(ElementGroup);
/// <summary>
/// 查找类似 邮箱 的本地化字符串。
@@ -1718,7 +1729,7 @@ namespace HandyControlDemo.Properties.Langs
/// <summary>
/// 查找类似 空状态 的本地化字符串。
/// </summary>
public static string Empty = nameof(Empty);
public static string Empty = nameof(Empty);
/// <summary>
/// 查找类似 错误 的本地化字符串。
Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

@@ -0,0 +1,10 @@
<UserControl x:Class="HandyControlDemo.UserControl.AutoCompleteTextBoxDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Background="{DynamicResource RegionBrush}"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
DataContext="{Binding AutoCompleteTextBoxDemo, Source={StaticResource Locator}}">
<hc:TransitioningContentControl>
<hc:AutoCompleteTextBox Width="380" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="32" ItemsSource="{Binding Items}" Text="{Binding SearchText}" DisplayMemberPath="Name"/>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class AutoCompleteTextBoxDemoCtl
{
public AutoCompleteTextBoxDemoCtl()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,57 @@
using System.Collections.Generic;
using GalaSoft.MvvmLight;
using HandyControl.Collections;
using HandyControlDemo.Data;
using HandyControlDemo.Service;
namespace HandyControlDemo.ViewModel
{
public class AutoCompleteTextBoxDemoViewModel : ViewModelBase
{
private string _searchText;
public string SearchText
{
get => _searchText;
#if NET40
set
{
Set(nameof(SearchText), ref _searchText, value);
FilterItems(value);
}
#else
set
{
Set(ref _searchText, value);
FilterItems(value);
}
#endif
}
public ManualObservableCollection<DemoDataModel> Items { get; set; } = new();
private readonly List<DemoDataModel> _dataList;
public AutoCompleteTextBoxDemoViewModel(DataService dataService)
{
_dataList = dataService.GetDemoDataList(10);
}
private void FilterItems(string key)
{
Items.CanNotify = false;
Items.Clear();
foreach (var data in _dataList)
{
if (data.Name.Contains(key))
{
Items.Add(data);
}
}
Items.CanNotify = true;
}
}
}
@@ -39,6 +39,7 @@ namespace HandyControlDemo.ViewModel
SimpleIoc.Default.Register<NotificationDemoViewModel>();
SimpleIoc.Default.Register<SplitButtonDemoViewModel>();
SimpleIoc.Default.Register<TagDemoViewModel>();
SimpleIoc.Default.Register<AutoCompleteTextBoxDemoViewModel>();
}
public static ViewModelLocator Instance = new Lazy<ViewModelLocator>(() =>
@@ -100,6 +101,8 @@ namespace HandyControlDemo.ViewModel
public TagDemoViewModel TagDemo => new(SimpleIoc.Default.GetInstance<DataService>());
public AutoCompleteTextBoxDemoViewModel AutoCompleteTextBoxDemo => new(SimpleIoc.Default.GetInstance<DataService>());
#endregion
}
}