整合自定义控件

This commit is contained in:
GG Z
2025-08-12 23:08:54 +08:00
parent f209e7d3ad
commit d0cfc64450
520 changed files with 30954 additions and 38968 deletions

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace NeuWPFTest;
public class SizeConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
// 确保我们得到了两个double值 (ActualWidth, ActualHeight)
if (values != null && values.Length == 2 && values[0] is double && values[1] is double)
{
double width = (double)values[0];
double height = (double)values[1];
// 返回着色器所需的 Size 对象
return new Size(width, height);
}
return new Size(0, 0);
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}