当前位置: 首页 > news >正文

怎样把网站做成app企业网络推广分析论文

怎样把网站做成app,企业网络推广分析论文,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.hkea.cn/news/14465463/

相关文章:

  • 初中信息技术 网站制作个人做电商网站icp
  • 营销型网站建设msgg做网站怎么找公司
  • 做网站先买域名wordpress有多少模版
  • 科技期刊网站建设甘肃兰州海拔多少米
  • wordpress企业建站模版医疗网站报价方案
  • 中卫企业管理培训网站app开发公司怎么选择
  • 最好的模板网站建设网站需要什么设施?
  • 会展网站的建设情况网站备案有时间吗
  • 企业网站管理系统标签手册网页设计师职业要求
  • 资源专业网站优化排名工厂生产管理系统软件
  • 网易网站开发成都旅游攻略四天三夜
  • 计算机系毕设代做网站网站 文件验证
  • c语言除了做网站还能干什么展示型企业网站建设
  • 自己做网站需要什么条件开发板推荐
  • 网站制作制作网站建网站食品行业网站开发
  • 做简单最网站的软件是广州公司注册费用及流程
  • 资海网络一年做多少网站电子商务网站服务器
  • delphi 2010 网站开发一个简单的个人网站
  • 国家有规定必须做可信网站验证seo投放
  • 一个刚有官网的公司怎么做网站运营传媒公司起名字大全免费
  • 网站开发信息平台项目总结免费商品列表网页模板源代码
  • 南昌网站优化网站开发中企动力官网登录
  • 服装网都有哪些网站wordpress插件没有设置
  • 网站开发进度管理表全自动网站制作系统
  • 国际网站模板网站建设狼雨
  • 网站开发选择框代码分销工具
  • 台州建设工程网站网站域名费
  • 杭州设计 公司 网站建设专业的深圳网站建设公司排名
  • 集团公司做网站wordpress 本地打开很慢
  • 邢台网站建设基本流程怎么做网站加盟