Beispiel #1
0
        public LiveWatchViewModel(LiveViewModel vm, NicoNicoLive instance, NicoNicoLiveContent content)
        {
            Owner        = vm;
            LiveInstance = instance;
            Content      = content;

            DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => {
                LiveFlash = new LiveFlash()
                {
                    DataContext = this
                };

                if (Content.GetPlayerStatus.Archive)
                {
                    Controller = new TimeShiftController()
                    {
                        DataContext = this
                    };
                }
                else
                {
                    Controller = new LiveController()
                    {
                        DataContext = this
                    };
                }
            }));

            Task.Run(() => Initialize());
        }
        public LiveGateViewModel(LiveViewModel vm, NicoNicoLive instance, NicoNicoLiveContent content)
        {
            Owner        = vm;
            LiveInstance = instance;
            Content      = content;

            Task.Run(() => Initialize());
        }
        public void Initialize()
        {
            Status   = "読込中";
            IsActive = true;

            var LiveInstance = new NicoNicoLive(LiveUrl);

            Content = LiveInstance.GetPage();
            Name    = Content.Title;

            if (Content.Type == LivePageType.Gate || Content.Type == LivePageType.TimeShiftGate)
            {
                ContentViewModel = new LiveGateViewModel(this, LiveInstance, Content);
            }
            else
            {
                ContentViewModel = new LiveWatchViewModel(this, LiveInstance, Content);
            }

            IsActive = false;
            Status   = "";
        }