private void OnListsLoaded(Model.UserLists lists)
        {
            var editableGroups = new List <WrappedListList>();

            foreach (var group in lists.Groups)
            {
                var newGroup = new WrappedListList
                {
                    Name = group.Name,
                    Type = group.Type,
                };

                foreach (var item in group)
                {
                    if ((item.IsEditable || (item.User != null && item.User.IsSelf))
                        &&
                        !item.Id.Contains("/dones")
                        &&
                        !item.Id.Contains("/tips")
                        )
                    {
                        newGroup.Add(new WrappedList(item));
                    }
                }

                if (newGroup.Count > 0)
                {
                    editableGroups.Add(newGroup);
                }
            }

            HookOrUnhook(editableGroups, true);

            DataContext = editableGroups;
        }
Ejemplo n.º 2
0
        private void OnListsLoaded(Model.UserLists uls)
        {
            PriorityQueue.AddUiWorkItem(() =>
            {
                StatusToken.TryComplete(ref _refreshToken);

                NavigationService.GoBack();
            });
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string value;

            if (NavigationContext.QueryString.TryGetValue("venueid", out value))
            {
                _itemId   = value;
                _itemType = "venue";
            }
            if (NavigationContext.QueryString.TryGetValue("tipid", out value))
            {
                _itemId   = value;
                _itemType = "tip";
            }
            if (NavigationContext.QueryString.TryGetValue("listid", out value))
            {
                _itemType       = "item";
                _optionalListId = value;

                if (NavigationContext.QueryString.TryGetValue("itemid", out value))
                {
                    _itemId = value;
                }
                // else, bad!
            }

            if (_lists == null)
            {
                _lists = DataManager.Current.Load <Model.UserLists>(
                    new LoadContext("self"),
                    OnListsLoaded,
                    OnListsFailed);
            }
            else
            {
                UpdateAppBar();
            }

            if (AddNewList.NewlyCreatedList != null)
            {
                Refresh();
            }
        }