Exemplo n.º 1
0
        public void Refresh()
        {
            IsActive = true;

            Task.Run(() => {
                MylistListCollection.Clear();

                Status = "マイリスト取得中(とりあえずマイリスト)";
                NicoNicoMylistGroupData deflist = new NicoNicoMylistGroupData();
                deflist.Name        = "とりあえずマイリスト";
                deflist.Description = "";
                deflist.Id          = "0";

                MylistListCollection.Add(new MylistListViewModel(this, deflist, MylistInstance.GetDefMylist()));

                foreach (NicoNicoMylistGroupData group in MylistGroupInstance.GetMylistGroup())
                {
                    Status = "マイリスト取得中(" + group.Name + ")";
                    MylistListCollection.Add(new MylistListViewModel(this, group, MylistInstance.GetMylist(group.Id)));
                }
                Status = "マイリスト取得完了";


                IsActive = false;
            });
        }
Exemplo n.º 2
0
 public MylistListViewModel(MylistViewModel vm, NicoNicoMylistGroupData group, List <NicoNicoMylistData> list) : base(group.Name)
 {
     EditModeViewModel = new MylistEditModeViewModel(this);
     Owner             = vm;
     Group             = group;
     Mylist            = new DispatcherCollection <MylistListEntryViewModel>(DispatcherHelper.UIDispatcher);
     foreach (NicoNicoMylistData data in list)
     {
         Mylist.Add(new MylistListEntryViewModel(this, data));
     }
     Sort(0);
 }