✅典型的setting画面

来源:互联网 发布:ecshop源码下载 编辑:程序博客网 时间:2024/06/06 08:49

✅典型的setting画面
一:布局

(1)新建一个类,有title和每一行点击的一个Action
public class SettingMenuContent
 {

 public string Title { get; set; }

 public Action SelectAction { get; set; }
 }

(2)创建一个(1)步的数组对象

(3)其中的一个就可以表示为:

private SettingMenuContent NotificationSetting ()
 {

 SettingMenuContent notificationSetting = new SettingMenuContent () {
 Title = “通知设置”,
 SelectAction = () => {
 ShowViewModel ();
 }
 } ;

 return notificationSetting;
 }


(4)跳转绑定
private MvxCommand _itemSelectdCommand;

 public System.Windows.Input.ICommand ItemSelectedCommand {
 get {
 _itemSelectdCommand = _itemSelectdCommand ?? new MvxCommand (item => item.SelectAction ());
 return _itemSelectdCommand;
 }
 }


(5)viewcontroller中:


(6)tableview的settingMenuDataSource,这里就不说了,其他文章里涉及到。

这里写图片描述

0 0