Merge branch 'master' of https://github.com/HandyOrg/HandyControl
This commit is contained in:
commit
398e285f3d
36 files changed
+1019
-43
No files matched your search
@@ -27,7 +27,7 @@
|
||||
[ "GroupBox", "GroupBoxDemoCtl", "GroupBox_16x", "" ],
|
||||
[ "Menu", "MenuDemoCtl", "ContextMenu_16x", "" ],
|
||||
[ "RichTextBox", "RichTextBoxDemoCtl", "RichTextBox_16x", "" ],
|
||||
[ "FlowDocument", "FlowDocumentDemoCtl", "WPFFlowDocument_16x", "1" ],
|
||||
[ "FlowDocument", "FlowDocumentDemoCtl", "WPFFlowDocument_16x", "" ],
|
||||
[ "ToolBar", "ToolBarDemoCtl", "ToolBar_16x", "" ],
|
||||
[ "Border", "BorderDemoCtl", "BorderElement_16x", "" ],
|
||||
[ "Label", "LabelDemoCtl", "Label_16x", "" ],
|
||||
@@ -41,6 +41,7 @@
|
||||
"demoItemList": [
|
||||
[ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "" ],
|
||||
[ "PropertyGrid", "PropertyGridDemoCtl", "PropertyGridEditorPart_16x", "1" ],
|
||||
[ "ImageSelector", "ImageSelectorDemoCtl", "Image_16x", "1" ],
|
||||
[ "ImageBlock", "ImageBlockDemoCtl", "ImageStack_16x", "" ],
|
||||
[ "Magnifier", "MagnifierDemoCtl", "Search_16x", "" ],
|
||||
[ "Gravatar", "GravatarDemoCtl", "User_16x", "" ],
|
||||
|
||||
@@ -55,6 +55,9 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\TextDialogWithTimer.xaml.cs">
|
||||
<DependentUpon>TextDialogWithTimer.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ImageSelectorDemoCtl.xaml.cs">
|
||||
<DependentUpon>ImageSelectorDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
|
||||
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -512,6 +515,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ImageSelectorDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\AnimationPathDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -851,7 +851,18 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
return ResourceManager.GetString("ImageBrowser", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 图片选择器 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string ImageSelector
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceManager.GetString("ImageSelector", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 索引 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -753,4 +753,7 @@
|
||||
<data name="PropertyGrid" xml:space="preserve">
|
||||
<value>PropertyGrid</value>
|
||||
</data>
|
||||
<data name="ImageSelector" xml:space="preserve">
|
||||
<value>ImageSelector</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -753,4 +753,7 @@
|
||||
<data name="PropertyGrid" xml:space="preserve">
|
||||
<value>PropertyGrid</value>
|
||||
</data>
|
||||
<data name="ImageSelector" xml:space="preserve">
|
||||
<value>ImageSelector</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -753,4 +753,7 @@
|
||||
<data name="PropertyGrid" xml:space="preserve">
|
||||
<value>PropertyGrid</value>
|
||||
</data>
|
||||
<data name="ImageSelector" xml:space="preserve">
|
||||
<value>ImageSelector</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -753,4 +753,7 @@
|
||||
<data name="PropertyGrid" xml:space="preserve">
|
||||
<value>PropertyGrid</value>
|
||||
</data>
|
||||
<data name="ImageSelector" xml:space="preserve">
|
||||
<value>ImageSelector</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -753,4 +753,7 @@
|
||||
<data name="PropertyGrid" xml:space="preserve">
|
||||
<value>属性编辑器</value>
|
||||
</data>
|
||||
<data name="ImageSelector" xml:space="preserve">
|
||||
<value>图片选择器</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -753,4 +753,7 @@
|
||||
<data name="PropertyGrid" xml:space="preserve">
|
||||
<value>PropertyGrid</value>
|
||||
</data>
|
||||
<data name="ImageSelector" xml:space="preserve">
|
||||
<value>ImageSelector</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -753,4 +753,7 @@
|
||||
<data name="PropertyGrid" xml:space="preserve">
|
||||
<value>PropertyGrid</value>
|
||||
</data>
|
||||
<data name="ImageSelector" xml:space="preserve">
|
||||
<value>ImageSelector</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -125,7 +125,8 @@ namespace HandyControlDemo.Properties.Langs
|
||||
OnPropertyChanged(nameof(Ignore));
|
||||
OnPropertyChanged(nameof(ImageBlock));
|
||||
OnPropertyChanged(nameof(ImageBrowser));
|
||||
OnPropertyChanged(nameof(Index));
|
||||
OnPropertyChanged(nameof(ImageSelector));
|
||||
OnPropertyChanged(nameof(Index));
|
||||
OnPropertyChanged(nameof(Info));
|
||||
OnPropertyChanged(nameof(InteractiveDialog));
|
||||
OnPropertyChanged(nameof(IsNotPhone));
|
||||
@@ -691,6 +692,11 @@ namespace HandyControlDemo.Properties.Langs
|
||||
/// </summary>
|
||||
public string ImageBrowser => Lang.ImageBrowser;
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 图片选择器 的本地化字符串。
|
||||
/// </summary>
|
||||
public string ImageSelector => Lang.ImageSelector;
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 索引 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -1760,6 +1766,11 @@ namespace HandyControlDemo.Properties.Langs
|
||||
/// </summary>
|
||||
public static string ImageBrowser = nameof(ImageBrowser);
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 图片选择器 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string ImageSelector = nameof(ImageSelector);
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 索引 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 298 B |
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ImageSelectorDemoCtl
|
||||
{
|
||||
public ImageSelectorDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<hc:SearchBar ShowClearButton="True" TextChanged="SearchBar_OnTextChanged" SearchStarted="SearchBar_OnSearchStarted" Style="{StaticResource SearchBarPlus}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterKey}}" Margin="0,4,4,4" Tag="{Binding ElementName=ListBoxDemo}"/>
|
||||
<hc:SearchBar ShowClearButton="True" IsRealTime="True" SearchStarted="SearchBar_OnSearchStarted" Style="{StaticResource SearchBarPlus}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterKey}}" Margin="0,4,4,4" Tag="{Binding ElementName=ListBoxDemo}"/>
|
||||
<ToggleButton Tag="{Binding ElementName=ListBoxDemo}" Name="ButtonStyleAscending" Click="ButtonAscending_OnClick" Grid.Row="0" Grid.Column="1" Style="{StaticResource DemoInfoSortButtonStyle}"/>
|
||||
<ListBox Name="ListBoxDemo" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" VirtualizingStackPanel.IsVirtualizing="True" SelectedIndex="{Binding SelectedIndex}" ItemsSource="{Binding DemoItemList}" BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
|
||||
<ListBox.ItemTemplate>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.ViewModel;
|
||||
@@ -31,6 +30,7 @@ namespace HandyControlDemo.UserControl
|
||||
var selectedIndex = demoInfo.SelectedIndex;
|
||||
demoInfo.SelectedIndex = -1;
|
||||
demoInfo.SelectedIndex = selectedIndex;
|
||||
FilterItems();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,11 @@ namespace HandyControlDemo.UserControl
|
||||
private void SearchBar_OnSearchStarted(object sender, FunctionEventArgs<string> e)
|
||||
{
|
||||
_searchKey = e.Info;
|
||||
FilterItems();
|
||||
}
|
||||
|
||||
private void FilterItems()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_searchKey))
|
||||
{
|
||||
foreach (var item in ViewModelLocator.Instance.Main.DemoInfoCurrent.DemoItemList)
|
||||
@@ -68,7 +73,7 @@ namespace HandyControlDemo.UserControl
|
||||
{
|
||||
item.IsVisible = true;
|
||||
}
|
||||
else if(item.TargetCtlName.Replace("DemoCtl", "").ToLower().Contains(key))
|
||||
else if (item.TargetCtlName.Replace("DemoCtl", "").ToLower().Contains(key))
|
||||
{
|
||||
item.IsVisible = true;
|
||||
}
|
||||
@@ -87,20 +92,5 @@ namespace HandyControlDemo.UserControl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SearchBar_OnTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is SearchBar searchBar)
|
||||
{
|
||||
_searchKey = searchBar.Text;
|
||||
if (string.IsNullOrEmpty(_searchKey))
|
||||
{
|
||||
foreach (var item in ViewModelLocator.Instance.Main.DemoInfoCurrent.DemoItemList)
|
||||
{
|
||||
item.IsVisible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user