x++ Run Object in AOT

本文介绍了一段X++代码,该代码用于在AX应用中通过自动化对象表(AOT)来运行特定的对象实例,包括表格和作业。通过查找AOT树节点并调用其AOTrun方法来实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The following X++ Code is used to running Object in AOT.

remak by Jimmy on 2010-04-08

 

using AIToy.Common; using System.Collections.ObjectModel; using System.ComponentModel; namespace AIToy.Pages.My; public partial class UpdateResources : BasePage { public ObservableCollection<MenuItem> MenuItems { get; set; } = new(); public UpdateResources() { InitializeComponent(); LoadMenuItems(); BindingContext = this; } private async void LoadMenuItems() { await Task.Run(() => { var data = GenerateMenuItems(); Dispatcher.Dispatch(() => { MenuItems.Clear(); foreach (var item in data) MenuItems.Add(item); }); }); } private List<MenuItem> GenerateMenuItems() { var female = new[] { "female01", "female02", "female03", "female04", "female05", "female06" }; var male = new[] { "male01", "male02", "male03", "male04", "male05", "male06" }; var result = new List<MenuItem>(12); for (int i = 0; i < 12; i++) { result.Add(new MenuItem { Name = i > 5 ? female[i - 6] : male[i], SubItems = new ObservableCollection<SubItem> { new() { Name = "视频" }, new() { Name = "音频" } } }); } return result; } public class MenuItem : INotifyPropertyChanged { public string Name { get; set; } public ObservableCollection<SubItem> SubItems { get; set; } = new(); private bool _isChecked; public bool IsChecked { get => _isChecked; set { _isChecked = value; foreach (var subItem in SubItems) { subItem.IsChecked = value; } OnPropertyChanged(); } } private bool _isExpanded = true; public bool IsExpanded { get => _isExpanded; set { _isExpanded = value; OnPropertyChanged(); } } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } public class SubItem : INotifyPropertyChanged { public string Name { get; set; } private bool _isChecked; public bool IsChecked { get => _isChecked; set { _isChecked = value; OnPropertyChanged(); } } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }<?xml version="1.0" encoding="utf-8" ?> <common:BasePage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="AIToy.Pages.My.UpdateResources" xmlns:common="clr-namespace:AIToy.Common" xmlns:m="clr-namespace:AIToy.Manager" xmlns:controls="clr-namespace:AIToy.Controls" Title="UpdateResources" BackgroundColor="#0D0C0D"> <ScrollView> <VerticalStackLayout Padding="20" Spacing="15"> <Label Text="资源管理器" FontSize="24" FontAttributes="Bold" HorizontalOptions="Center"/> <Border Stroke="#512BD4" StrokeThickness="2" StrokeShape="RoundRectangle 10" Padding="10"> <VerticalStackLayout Spacing="10"> <CollectionView ItemsSource="{Binding MenuItems}"> <CollectionView.ItemTemplate> <DataTemplate> <VerticalStackLayout Spacing="5"> <Grid> <CheckBox IsChecked="{Binding IsChecked}" VerticalOptions="Center"/> <Label Text="{Binding Name}" FontSize="18" FontAttributes="Bold" Margin="30,0,0,0"/> </Grid> <BoxView HeightRequest="1" Color="LightGray" Margin="30,0,0,0"/> <StackLayout Margin="30,0,0,0" Spacing="5" IsVisible="{Binding IsExpanded}"> <CollectionView ItemsSource="{Binding SubItems}"> <CollectionView.ItemTemplate> <DataTemplate> <Grid> <CheckBox IsChecked="{Binding IsChecked}" VerticalOptions="Center"/> <Label Text="{Binding Name}" Margin="30,0,0,0"/> </Grid> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView> </StackLayout> </VerticalStackLayout> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView> </VerticalStackLayout> </Border> </VerticalStackLayout> </ScrollView> </common:BasePage> 这是.net maui代码,加载需要6-7秒,如何优化让他秒开,前端写死也行
最新发布
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

fandyxie2014

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值