using CommunityToolkit.Mvvm.ComponentModel; using SunlightAggregationTerminal.Models; using System.Collections.ObjectModel; using System.Reflection.PortableExecutable; namespace SunlightAggregationTerminal; public partial class InfoDetail : ContentPage { public static ObservableCollection InfoProbuctItems { get; set; } = new(); public static ObservableCollection InfoDyelotItems { get; set; } = new(); public InfoDetail(InfoItem item) { InitializeComponent(); this.BindingContext = item; InfoProbuctItems.Add(new ProbuctItem { ProductName="cs", ProductCode="cs", ProductState="", ProductInf="" }); InfoProbuctItems.Add(new ProbuctItem { ProductName = "c23s", ProductCode = "cweds", ProductState = "", ProductInf = "" }); InfoProbuctItems.Add(new ProbuctItem { ProductName = "arf", ProductCode = "af", ProductState = "", ProductInf = "" }); InfoProbuctItems.Add(new ProbuctItem { ProductName = "afars", ProductCode = "cs", ProductState = "", ProductInf = "" }); InfoDyelotItems.Add(new DyelotItem { Dyelot = "2134566", Machine = "g01", CreationTime = "", CallTime = "" , ReDye="0", Step = "0", FabricName = "21345122343566", ColorName = "g01", CustomerName = "", EndTime = "", StartTime = "", Information = "yyjjy\nfxfxdsdg\n", }); InfoDyelotItems.Add(new DyelotItem { Step = "3", Dyelot = "231423134566", Machine = "g01", CreationTime = "", CallTime = "", FabricName = "2134566", ColorName = "g01", CustomerName = "", EndTime = "", StartTime = "", Information = "yyjjy\nfxfxdsdg\n", }); InfoDyelotItems.Add(new DyelotItem { Step = "3", Dyelot = "2131324354566", Machine = "g01", CreationTime = "", CallTime = "", FabricName = "2134566", ColorName = "g01", CustomerName = "", EndTime = "", StartTime = "", Information = "yyjjy\nfxfxdsdg\n", }); InfoDyelotItems.Add(new DyelotItem { Dyelot = "2134123243566", Machine = "g01", CreationTime = "", CallTime = "", FabricName = "2134566", ColorName = "g01", CustomerName = "", EndTime = "", StartTime = "", Information = "yyjjy\nfxfxdsdg\n", }); InfoDyelotItems.Add(new DyelotItem { Dyelot = "2134566", Machine = "g01", CreationTime = "", CallTime = "", FabricName = "2134566", ColorName = "g01", CustomerName = "", EndTime = "", StartTime = "", Information = "yyjjy\nfxfxdsdg\n", }); CardCollectionView_machine.ItemsSource = InfoProbuctItems; CardCollectionView_history.ItemsSource = InfoDyelotItems; } private void Button_real(object sender, EventArgs e) { _real.IsVisible = true; _machine.IsVisible = false; _history.IsVisible = false; _control.IsVisible = false; } private void Button_machine(object sender, EventArgs e) { _real.IsVisible = false; _machine.IsVisible = true; _history.IsVisible = false; _control.IsVisible = false; } private void Button_history(object sender, EventArgs e) { _real.IsVisible = false; _machine.IsVisible = false; _history.IsVisible = true; _control.IsVisible = false; } private async void Button_control(object sender, EventArgs e) { _real.IsVisible = false; _machine.IsVisible = false; _history.IsVisible = false; _control.IsVisible = true; await DisplayAlertAsync("限制", "当前功能暂不可用", "是"); } }