mirror of
https://github.com/leiurayer/downkyi.git
synced 2024-04-21 12:41:55 +00:00
增加输入事件
增加搜索框输入事件
This commit is contained in:
@@ -46,7 +46,13 @@ namespace DownKyi.ViewModels
|
||||
get => inputText;
|
||||
set => SetProperty(ref inputText, value);
|
||||
}
|
||||
private string inputSearchText;
|
||||
|
||||
public string InputSearchText
|
||||
{
|
||||
get => inputSearchText;
|
||||
set => SetProperty(ref inputSearchText, value);
|
||||
}
|
||||
private GifImage loading;
|
||||
public GifImage Loading
|
||||
{
|
||||
@@ -172,6 +178,19 @@ namespace DownKyi.ViewModels
|
||||
private DelegateCommand inputCommand;
|
||||
public DelegateCommand InputCommand => inputCommand ?? (inputCommand = new DelegateCommand(ExecuteInputCommand, CanExecuteInputCommand));
|
||||
|
||||
|
||||
private DelegateCommand inputSearchCommand;
|
||||
|
||||
public DelegateCommand InputSearchCommand => inputSearchCommand ?? (inputSearchCommand = new DelegateCommand(ExcuteInputSearchCommand));
|
||||
/// <summary>
|
||||
/// 搜索视频输入时间
|
||||
/// </summary>
|
||||
private async void ExcuteInputSearchCommand() {
|
||||
await Task.Run(() =>
|
||||
{
|
||||
if (InputSearchText == null || InputSearchText == string.Empty) { return; }
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 处理输入事件
|
||||
/// </summary>
|
||||
|
||||
@@ -694,9 +694,10 @@
|
||||
<!-- 考虑将下列两个选项移入设置页面 -->
|
||||
<!--<CheckBox Grid.Column="1" Content="自动解析" IsChecked="False" Foreground="{DynamicResource BrushTextDark}" Style="{StaticResource CheckBoxStyle}" Margin="0 10 0 0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Column="2" Content="解析后自动下载所有" IsChecked="False" Foreground="{DynamicResource BrushTextDark}" Style="{StaticResource CheckBoxStyle}" Margin="0 10 0 0" VerticalAlignment="Top" HorizontalAlignment="Left"/>-->
|
||||
<TextBox Grid.Column="3" HorizontalAlignment="Left" Height="20" TextWrapping="Wrap" VerticalAlignment="Top" Width="140" Margin="48,0,0,0">
|
||||
<TextBox Grid.Column="3" HorizontalAlignment="Left" Height="20" TextWrapping="Wrap" VerticalAlignment="Top" Width="140" Margin="48,0,0,0"
|
||||
Text="{Binding Path=InputSearchText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding InputCommand}" />
|
||||
<KeyBinding Key="Enter" Command="{Binding InputSearchCommand}" />
|
||||
</TextBox.InputBindings>
|
||||
<TextBox.Resources>
|
||||
<VisualBrush
|
||||
@@ -706,7 +707,7 @@
|
||||
Stretch="None"
|
||||
TileMode="None">
|
||||
<VisualBrush.Visual>
|
||||
<TextBlock Text="{DynamicResource IndexHintTextSimple}" />
|
||||
<TextBlock Text="{DynamicResource SearchVideoByName}" />
|
||||
</VisualBrush.Visual>
|
||||
</VisualBrush>
|
||||
</TextBox.Resources>
|
||||
|
||||
Reference in New Issue
Block a user