using Avalonia.Data.Converters; using Plugin.Cowain.Wcs.ViewModels; using System.Globalization; namespace Plugin.Cowain.Wcs.Converters; public class ColumnToPositionConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is int column) { return column * WcsRealStationViewModel.CellSize + 5; // +5是为了留出边距 } return 0; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } }