Merge pull request #983 from DingpingZhang/feature/highlight-text-block
feat(control): add the highlight-text-block control.
This commit is contained in:
5 files changed
+224
-2
No files matched your search
@@ -6,6 +6,7 @@
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data"
|
||||
Margin="16,16,0,16"
|
||||
CornerRadius="10"
|
||||
Effect="{StaticResource EffectShadow4}">
|
||||
@@ -51,7 +52,7 @@
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Width="16" Height="16" Source="{Binding ImageName}"/>
|
||||
<TextBlock Margin="6,0,0,0" Text="{ex:Lang Key={Binding Name}}"/>
|
||||
<hc:HighlightTextBlock Margin="6,0,0,0" SourceText="{ex:Lang Key={Binding Name}}" QueriesText="{Binding QueriesText}" HighlightBrush="#f06632" />
|
||||
<Path Visibility="{Binding IsNew,Converter={StaticResource Boolean2VisibilityConverter}}" VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource DangerBrush}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace HandyControlDemo.UserControl
|
||||
foreach (var item in ViewModelLocator.Instance.Main.DemoInfoCurrent.DemoItemList)
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = string.Empty;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -78,10 +79,12 @@ namespace HandyControlDemo.UserControl
|
||||
if (item.Name.ToLower().Contains(key))
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = _searchKey;
|
||||
}
|
||||
else if (item.TargetCtlName.Replace("DemoCtl", "").ToLower().Contains(key))
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = _searchKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -89,10 +92,12 @@ namespace HandyControlDemo.UserControl
|
||||
if (!string.IsNullOrEmpty(name) && name.ToLower().Contains(key))
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = _searchKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.IsVisible = false;
|
||||
item.QueriesText = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user