using Cowain.Bake.BLL; using System.Linq; using Unity; namespace Cowain.Bake.Main.Models { public class MainRowDefinition { public static float UpperSpacing = 6; public static float UpperHeight = 0; public static float MidHeight = 3; public static float LowerHeight = 0; public static float LowerSpacing = 1.5f; public static float TotalHeight = 0; public MainRowDefinition(IUnityContainer unityContainer) { var memory = unityContainer.Resolve(); UpperHeight = memory.AllStation.Where(x => x.PosX == 1).Max(x => x.Layers)+1; LowerHeight = memory.AllStation.Where(x => x.PosX == 3).Max(x => x.Layers)+1; //1:就是抬头 TotalHeight = UpperSpacing + LowerSpacing + UpperHeight + LowerHeight + MidHeight; } } }