コード例 #1
0
        public override void WireMessages()
        {
            Messenger.Default.Register <SyncNotificationMessage>(this, m =>
            {
                if (m.Notification.Equals(Constants.Messages.SyncJobFinishedMsg))
                {
                    if (m.ItemType.Equals("Movie"))
                    {
                        if (!Movies.IsNullOrEmpty())
                        {
                            foreach (var group in Movies)
                            {
                                var movie = group.FirstOrDefault(x => x.Id == m.ItemId);
                                if (movie != null)
                                {
                                    movie.IsSynced = true;
                                    break;
                                }
                            }
                        }

                        if (!LatestUnwatched.IsNullOrEmpty())
                        {
                            var movie = LatestUnwatched.FirstOrDefault(x => x.Id == m.ItemId);
                            if (movie != null)
                            {
                                movie.IsSynced = true;
                            }
                        }

                        if (UnseenHeader != null && UnseenHeader.Id == m.ItemId)
                        {
                            UnseenHeader.IsSynced = true;
                        }
                    }
                }
            });
        }