Example #1
0
        public async Task SaveParentListAsync()
        {
            if (this.ParentList != null)
            {
                try
                {
                    this.IsBusy = true;
                    var id = this.Model.IsNew ? -1 : this.Model.Id;
                    if (this.Model.IsNew)
                    {
                        this.ParentList.Add(this.Model);
                    }
                    this.ParentList = await this.ParentList.SaveAsync();

                    if (id > 0)
                    {
                        this.Model = this.ParentList.GetRoleById(id);
                    }
                    else
                    {
                        // There should always at leave be one, even on an add
                        // Deletes should not use this method
                        this.Model = this.ParentList.Last();
                    }
                }
                finally
                {
                    this.IsBusy = false;
                }
            }
        }
Example #2
0
 public RoleEdit(Library.Admin.RoleEditList parent)
 {
     ParentList           = parent;
     EditMode             = false;
     ManageObjectLifetime = true;
     Model = new Library.Admin.RoleEdit();
 }
Example #3
0
 public RoleEdit(Library.Admin.RoleEdit role)
 {
     ParentList           = (Library.Admin.RoleEditList)role.Parent;
     EditMode             = true;
     ManageObjectLifetime = true;
     Model = role;
 }
Example #4
0
 public RoleEditListAdapter(Activity context, Library.Admin.RoleEditList items)
     : base()
 {
     this.context = context;
     this.items   = items;
 }