feat. 输入神秘代码后点旁边即可加载相关文本

This commit is contained in:
lhhxxxxx
2022-08-23 05:19:27 +08:00
parent c91f2c3ad7
commit 8596d39d89
2 changed files with 21 additions and 1 deletions

View File

@@ -20,11 +20,13 @@ using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows;
using System.Windows.Input;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Stylet;
using StyletIoC;
using DataFormats = System.Windows.Forms.DataFormats;
using DragEventArgs = System.Windows.DragEventArgs;
using Screen = Stylet.Screen;
@@ -460,5 +462,22 @@ namespace MeoAsstGui
{
}
}
/// <summary>
/// 点击后移除界面中元素焦点
/// </summary>
/// <param name="sender">点击事件发送者</param>
/// <param name="e">点击事件</param>
public void MouseDown(object sender, MouseButtonEventArgs e)
{
if (!(sender is UIElement element))
{
return;
}
DependencyObject scope = FocusManager.GetFocusScope(element);
FocusManager.SetFocusedElement(scope, element);
Keyboard.ClearFocus();
}
}
}

View File

@@ -13,6 +13,7 @@
d:DesignWidth="800"
AllowDrop="True"
Drop="{s:Action DropFile}"
MouseDown="{s:Action MouseDown}"
mc:Ignorable="d">
<Grid Margin="20" Background="White">
<Grid.ColumnDefinitions>