优化代码

This commit is contained in:
2025-09-30 17:46:35 +08:00
parent 92e695ef7c
commit 92bb458345
16 changed files with 71 additions and 131 deletions
+2 -3
View File
@@ -85,9 +85,8 @@ namespace Ink_Canvas
// 根据橡皮擦形状选择对应的图像资源
string resourceKey = isEraserCircleShape ? "EllipseEraserImageSource" : "RectangleEraserImageSource";
var imageSource = TryFindResource(resourceKey) as DrawingImage;
if (imageSource != null)
if (TryFindResource(resourceKey) is DrawingImage imageSource)
{
eraserFeedback.Source = imageSource;
}