企业网站建设最新技术推荐网站网页

news/2025/9/27 13:08:59/文章来源:
企业网站建设最新技术,推荐网站网页,wordpress 美容主题,理财网站开发适用于初学者的 .NET MAUI | Microsoft Learn 记录微软Learn中用到的代码。文章比较粗糙#xff0c;大部分是项目代码粘贴。想详细学习的可到上面的链接学习#xff0c;代码可以从这里复制后直接运行。 练习中一共有两个页面#xff1a; 1、MainPage.xaml 用于添加列表中的… 适用于初学者的 .NET MAUI | Microsoft Learn 记录微软Learn中用到的代码。文章比较粗糙大部分是项目代码粘贴。想详细学习的可到上面的链接学习代码可以从这里复制后直接运行。 练习中一共有两个页面 1、MainPage.xaml 用于添加列表中的内容。主要功能有向列表中添加一项左滑删除该项点击该选项进入详情页面。 2、DetailPage.xaml 显示详细信息实际上显示的很少。返回主界面。 用到的MVVM包有 1、CommunityToolkit.Mvvm 接下来是MainPage.xaml代码 ?xml version1.0 encodingutf-8 ? ContentPage xmlnshttp://schemas.microsoft.com/dotnet/2021/mauixmlns:xhttp://schemas.microsoft.com/winfx/2009/xamlx:ClassMauiAppDemo1.MainPagexmlns:viewmodeclr-namespace:MauiAppDemo1.ViewModelx:DataTypeviewmode:MainViewModelGrid RowDefinitions100,Auto,*ColumnDefinitions.75*,.25*Padding10RowSpacing10ColumnSpacing10Image Grid.ColumnSpan2Sourcedotnet_bot.pngBackgroundwhite/Entry PlaceholderEnter taskText{Binding Text}Grid.Row1/Button TextAddCommand{Binding AddCommand}Grid.Row1Grid.Column1/CollectionView Grid.Row2 Grid.ColumnSpan2ItemsSource{Binding Items}SelectionModeNone!--CollectionView.ItemsSourcex:Array Type{x:Type x:String}x:StringApples/x:Stringx:StringBananas/x:Stringx:StringOranges/x:String/x:Array/CollectionView.ItemsSource--CollectionView.ItemTemplateDataTemplate x:DataType{x:Type x:String}SwipeViewSwipeView.RightItemsSwipeItems SwipeItem TextDeleteBackgroundColorRedCommand{Binding Source{RelativeSource AncestorType{x:Type viewmode:MainViewModel}},PathDeleteCommand}CommandParameter{Binding .}//SwipeItems/SwipeView.RightItemsGrid Padding0,5FrameFrame.GestureRecognizersTapGestureRecognizer Command{Binding Source{RelativeSource AncestorType{x:Type viewmode:MainViewModel}},PathTapCommand}CommandParameter{Binding .}//Frame.GestureRecognizersLabel Text{Binding .}FontSize24//Frame/Grid/SwipeView/DataTemplate/CollectionView.ItemTemplate/CollectionView/Grid/ContentPageusing MauiAppDemo1.ViewModel;namespace MauiAppDemo1;public partial class MainPage : ContentPage {int count 0;public MainPage(MainViewModel vm){InitializeComponent();BindingContext vm;}} using MauiAppDemo1.ViewModel;namespace MauiAppDemo1;public static class MauiProgram {public static MauiApp CreateMauiApp(){var builder MauiApp.CreateBuilder();builder.UseMauiAppApp().ConfigureFonts(fonts {fonts.AddFont(OpenSans-Regular.ttf, OpenSansRegular);fonts.AddFont(OpenSans-Semibold.ttf, OpenSansSemibold);});builder.Services.AddSingletonMainPage();builder.Services.AddSingletonMainViewModel();builder.Services.AddTransientDetailPage();builder.Services.AddSingletonDetailViewModel(); return builder.Build();} }namespace MauiAppDemo1;public partial class AppShell : Shell {public AppShell(){InitializeComponent();Routing.RegisterRoute(nameof(DetailPage),typeof(DetailPage));} }using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks;namespace MauiAppDemo1.ViewModel {/// summary/// CommunityToolkit.Mvvm/// /summarypublic partial class MainViewModel : ObservableObject{public MainViewModel(){items new ObservableCollectionstring();}[ObservableProperty]ObservableCollectionstring items;[ObservableProperty]string text;[RelayCommand]void Add(){if (string.IsNullOrWhiteSpace(Text)) return;items.Add(Text);Text string.Empty;}[RelayCommand]void Delete(string s){if (items.Contains(s)){items.Remove(s);}}[RelayCommand] async Task Tap(string s){await Shell.Current.GoToAsync(${nameof(DetailPage)}?Text{s});}}/// summary/// 基本写法/// /summary//public class MainViewModel : INotifyPropertyChanged//{// string text;// public string Text// {// get text;// set// {// textvalue;// OnPropertyChanged(nameof(Text));// }// }// public event PropertyChangedEventHandler PropertyChanged;// void OnPropertyChanged(string name)PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));//} }DetailPage.xaml ?xml version1.0 encodingutf-8 ? ContentPage xmlnshttp://schemas.microsoft.com/dotnet/2021/mauixmlns:xhttp://schemas.microsoft.com/winfx/2009/xamlx:ClassMauiAppDemo1.DetailPagexmlns:viewmodelclr-namespace:MauiAppDemo1.ViewModelx:DataTypeviewmodel:DetailViewModelTitleDetailPageVerticalStackLayout Padding20Label Text{Binding Text}FontSize25VerticalOptionsCenter HorizontalOptionsCenter /Button TextGo BackCommand{Binding GoBackCommand}//VerticalStackLayout /ContentPage using MauiAppDemo1.ViewModel;namespace MauiAppDemo1;public partial class DetailPage : ContentPage {public DetailPage(DetailViewModel vm){InitializeComponent();BindingContext vm;} } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input;namespace MauiAppDemo1.ViewModel {[QueryProperty(Text,Text)]public partial class DetailViewModel:ObservableObject{[ObservableProperty]string text;[RelayCommand]async Task GoBack(){await Shell.Current.GoToAsync(..);}} }

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/919489.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

涉及各种高级特性的c++ lambda表达式例子

复杂C++ Lambda表达式,涉及嵌套Lambda、高阶函数、可变捕获、移动捕获、模板参数以及异常处理等概念。#include <iostream> #include <functional> #include <vector> #include <memory> #in…

网站建设前期如何规划wordpress客户端开发

文章目录 华为eNSP配置专题-OSPF路由协议的配置0、概要介绍1、前置环境1.1、宿主机1.2、eNSP模拟器 2、基本环境搭建2.1、终端构成和连接2.2、终端的基本配置 3、OSPF路由的配置3.1、OSPF路由的配置3.1.1、在R1上配置OSPF3.1.2、在R2和R3上配置OSPF3.1.3、查看和监控OSPF 华为e…

Altium Designer(AD)自定义PCB外观颜色 - 实践

Altium Designer(AD)自定义PCB外观颜色 - 实践pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", &q…

使用 Azure AD 实现认证与权限管理:原理解析与操作指南 - 详解

使用 Azure AD 实现认证与权限管理:原理解析与操作指南 - 详解pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Co…

西安网站开发公司有哪家好wordpress自定义json

利用欧姆定律进行计算&#xff1a;根据串、并联电路的特点和欧姆定律的公式可进行有关计算。解题的方法是&#xff1a;(1)根据题意画出电路图&#xff0c;看清电路的组成(串联还是并联)&#xff1b;(2)明确题目给出的已知条件与未知条件&#xff0c;并在电路图上标明&#xff1…

C++23特性全解析:从编译器支撑矩阵到多维数组性能优化实战

C++23特性全解析:从编译器支撑矩阵到多维数组性能优化实战2025-09-27 12:52 tlnshuju 阅读(0) 评论(0) 收藏 举报pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !importan…

2025 年地坪研磨机厂家推荐榜单:盘点 TOP 品牌的格力,宁德时代等标杆客户合作案例

随着城市更新与工业园区升级加速,环氧地坪、固化抛光混凝土等项目对研磨精度与效率的要求持续提升,地坪研磨机市场需求年均复合增长率达 3.5%。但市场中设备质量参差不齐,部分产品存在动力不足、操控精度低、故障率…

分拆数

将n分成恰有k个部分的分拆,称为k部分拆数,记作p(n,k)。p(n−k, k)是将每个数都加1,从而对p(n, k)有贡献。(如 1 1 1 -> 2 2 2) p(n-1, k-1)是在开头增加一个数1,从而对p(n, k)有贡献。(如 1 1 -> 1 1 1,从而…

了解学习Nginx反向代理与缓存作用

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

宁波龙山建设有限公司网站深圳网站seo优化

很高兴告诉大家&#xff0c;我们StoneDB-8.0-V2.1.0企业版正式发布了&#xff01;经过一个月的开发&#xff0c;我们的研发团队用极高的效率对2.0新架构版本查漏补缺&#xff0c;完善了最新架构的代码&#xff0c;并对性能、稳定性做出了优化&#xff0c;同时也修复了一些用户们…

【PLC】昱控兼容三菱FX3U PLC作为Modbus RTU从机,使用串口调试助手访问

设备: 1、昱控 PLC工控板国产兼容三菱FX3U控制器(型号:10MR-2AD-2DA 继电器) 2、FX- USB下载线 3、USB转485 技术资料:FX3U FX3UC系列微型可编程控制器 用户手册 MODBUS通信篇链接: https://pan.baidu.com/s/18E…

做网站 使用权 所有权海安网站建设公司

前些天大雄无意间听见几个线下班小伙伴说真的是无(te)意(di)的“我要补英文”“对&#xff0c;英文真的很重要”“如果编码用中文就好了”...听见这大雄就不淡定了中文代码小伙伴确定能够搞懂&#xff1f;&#xff1f;首先我们大概的看一下中文编码&#xff1a;你以为会写中文写…

企业网站域名在哪申请上海招聘信息最新招聘2022

1. 什么是进程和线程&#xff1f;它们之间有什么区别&#xff1f; a. 进程是操作系统中运行的一个程序实例。它拥有独立的地址空间和资源&#xff0c;可以独立执行。 b. 线程是进程内的一个执行单元&#xff0c;一个进程可以包含多个线程。 c. 线程共享进程的资源&#xff0c;…

宁乡建设局网站手机网站打开微信号

MacBook安装Git三种方式 git官方下载地址: https://git-scm.com/download 方式一(推荐) Git官网下载最新git Mac版本安装 下载地址: https://git-scm.com/download/mac Binary installer 二进制安装 下载 git-2.27.0-intel-universal-mavericks.dmg 点击安装 查看版本 git …

Tomcat 简介与 Linux 环境部署 - 指南

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

深入解析:GraphRAG(知识图谱结合大模型)对人工智能中自然语言处理的深层语义分析的影响与启示

深入解析:GraphRAG(知识图谱结合大模型)对人工智能中自然语言处理的深层语义分析的影响与启示pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !i…

基于python网站开发vue做的小网站

文章目录 实现两数交换方法一、&#xff08;数组的方式进行交换&#xff09;方法二、&#xff08;对象的方式进行交换&#xff09;总结 实现两数交换 实现两数交换&#xff0c;没有办法通过直接传递数字达到交换的结果&#xff0c;定义的int型变量是被存储在栈空间上的&#xf…

深圳网站建设g淇县住房和城乡建设局网站

python引用DLL文件的方法转载于:https://www.cnblogs.com/Regle/p/7003261.html

双一流建设网站深圳宝安中心医院

1. Composition API(常用部分) 文档: ​ https://composition-api.vuejs.org/zh/api.html 1) setup 新的option, 所有的组合API函数都在此使用, 只在初始化时执行一次函数如果返回对象, 对象中的属性或方法, 模板中可以直接使用2) ref 作用: 定义一个数据的响应式语法: cons…

免费网站建设信息北京网站推广排名

ArXiv&#xff1a;https://arxiv.org/abs/1910.01108 Train Loss: DistilBERT&#xff1a; DistilBERT具有与BERT相同的一般结构&#xff0c;层数减少2倍&#xff0c;移除token类型嵌入和pooler。从老师那里取一层来初始化学生。 The token-type embeddings and the pooler a…