コード例 #1
0
ファイル: UploadVideoViewModel.cs プロジェクト: dw5/Viddi
        protected override void WireMessages()
        {
            Messenger.Default.Register <NotificationMessage>(this, m =>
            {
                if (m.Notification.Equals(Constants.Messages.VideoFileMsg))
                {
                    var file = m.Sender as StorageFile;
                    if (file == null)
                    {
                        return;
                    }

                    _channel = m.Target != null ? m.Target as ChannelItemViewModel : null;

                    //IsUploading = true;
                    EditVideo.CanEdit = IsUploading = false;
                    File  = file;
                    Image = File;
                }
            });

            Messenger.Default.Register <VideoMessage>(this, m =>
            {
                if (m.Notification.Equals(Constants.Messages.EditVideoMsg))
                {
                    EditVideo.SetVideo(m.Video.Video);
                    Image = m.Video.Video.ThumbnailUrl;
                }
            });

            base.WireMessages();
        }
コード例 #2
0
ファイル: ChannelViewModel.cs プロジェクト: dw5/Viddi
        protected override void WireMessages()
        {
            Messenger.Default.Register <ChannelMessage>(this, m =>
            {
                _fromProtocol = false;
                Channel       = m.Channel;
            });

            Messenger.Default.Register <ProtocolMessage>(this, m =>
            {
                if (m.Type != ProtocolMessage.ProtocolType.Channel)
                {
                    return;
                }

                _fromProtocol = true;
                Channel       = new ChannelItemViewModel(new Channel())
                {
                    ProgressIsVisible = true
                };
                GetChannel(m.Content);
            });

            base.WireMessages();
        }
コード例 #3
0
ファイル: VideoRecordViewModel.cs プロジェクト: dw5/Viddi
 protected override void WireMessages()
 {
     base.WireMessages();
     Messenger.Default.Register <ChannelMessage>(this, m =>
     {
         if (m.Notification.Equals(Constants.Messages.AddVideoToChannelMsg))
         {
             _channel = m.Channel;
         }
     });
 }
コード例 #4
0
ファイル: ChannelViewModel.cs プロジェクト: dw5/Viddi
        private async Task GetChannel(string channelId)
        {
            try
            {
                var response = await _vidMeClient.GetChannelAsync(channelId);

                if (response != null)
                {
                    if (Channel == null)
                    {
                        Channel = new ChannelItemViewModel(response.Channel);
                    }
                    else
                    {
                        Channel.Channel = response.Channel;
                    }

                    await LoadChannelVideos();
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #5
0
 public ChannelMessage(ChannelItemViewModel channel, string notification) : base(notification)
 {
     Channel = channel;
 }
コード例 #6
0
 public ChannelMessage(ChannelItemViewModel channel) : base(string.Empty)
 {
     Channel = channel;
 }
コード例 #7
0
 public ChannelDeleteEvent(Channel channel, ChannelItemViewModel channelItemViewModel)
 {
     ChannelItemViewModel = channelItemViewModel;
     Channel = channel;
 }
コード例 #8
0
 public ChannelDeleteEvent(Channel model, ChannelItemViewModel viewModel)
 {
     ViewModel = viewModel;
     Model     = model;
 }