public void AddUserSuccess(bool isNewUser, UserData user)
 {
     try
     {
         UserModel newUser = new UserModel();
         newUser.UserId = user.UserId;
         newUser.UserName = user.UserName;
         foreach (RoleData item in user.Roles)
         {
             newUser.Roles += item.RoleName + ";";
         }
         this._users.Add(newUser);
         //this.UserManager.Items.Add(tile);
     }
     catch (Exception ex)
     {
         Logger.TraceEvent(System.Diagnostics.TraceEventType.Error, "AddUserSuccess.\r\n{0}", ex.ToString());
     }
 }
        private void InitUserTile(List<UserData> data)
        {
            try
            {
                this.Dispatcher.BeginInvoke((Action<List<UserData>>)delegate(List<UserData> userData)
                 {

                     //foreach (UserData item in userData)
                     //{
                     //    XamTile tile = new XamTile();
                     //    tile.CloseAction = TileCloseAction.DoNothing;
                     //    tile.Header = item.UserName;
                     //    tile.Content = new UserTileControl(item, this._roles, false, DeleteUser);
                     //    //this.UserManager.Items.Add(tile);
                     //}
                     this._AllUserData = new ObservableCollection<UserData>(userData);
                     ObservableCollection<UserModel> users = new ObservableCollection<UserModel>();
                     foreach (UserData item in userData)
                     {
                         UserModel user = new UserModel();
                         user.UserId = item.UserId;
                         user.UserName = item.UserName;
                         user.Password = string.Empty;
                         user.Roles = "";
                         foreach (RoleData role in item.Roles)
                         {
                             user.Roles += role.RoleName + ";";
                         }
                         users.Add(user);
                     }
                     this._users = users;
                     this.UserManager.ItemsSource = this._users;

                 }, data);
            }
            catch (Exception ex)
            {
                Logger.TraceEvent(System.Diagnostics.TraceEventType.Error, "InitUserTile.\r\n{0}", ex.ToString());
            }
        }