示例#1
0
 public void RemoveSelecedType(ChannelTypeItem channelType)
 {
     if (_selectedViewModel.Count > 1)
     {
         _selectedViewModel.Remove(channelType);
         _allViewModel[0].Remove(channelType);
         _allViewModel[1].Add(channelType);
         SaveRoaming();
         TileUtils.CreateBasicToast(
                 string.Format("首页已经移除了\"{0}\" 您在\"频道\"内可以找到它", channelType.TypeName));
     }
     else
     {
         TileUtils.CreateBasicToast("已经不能再移除了");
     }
 }
示例#2
0
        private void ProcessViewModel(string[] roamingValues, int typeId, string typeName)
        {
            var groupItem = new ChannelTypeItem()
            {
                TypeId = typeId,
                TypeName = typeName
            };

            if (_typeImages.ContainsKey(groupItem.TypeName))
                groupItem.ImageUri = _typeImages[groupItem.TypeName];
            else
                groupItem.ImageUri = _defaultImage;

            if (roamingValues.Contains(typeId.ToString()))
            {
                _allViewModel[0].Add(groupItem);
            }
            else
            {
                _allViewModel[1].Add(groupItem);
            }
        }
示例#3
0
 public void AddSelectedType(ChannelTypeItem channelType)
 {
     _selectedViewModel.Add(channelType);
     _allViewModel[0].Add(channelType);
     _allViewModel[1].Remove(channelType);
     SaveRoaming();
 }