public UserOverviewViewModel(IPlatformServices platformServices,
                                     UserOverviewViewModelParams p)
            : base(platformServices)
        {
            this.dataController = ServiceRegistry.GetService <IUserOverviewDataController>();

            this.flow = new MainThreadObservableCollectionAdapter <ITrackViewModel>(dataController.Flow,
                                                                                    PlatformServices.MainThreadDispatcher);

            this.playlists = new MainThreadObservableCollectionAdapter <IPlaylistViewModel>(dataController.Playlists,
                                                                                            PlatformServices.MainThreadDispatcher);

            this.dataController.OnFlowFetchStateChanged            += OnFlowFetchStateChanged;
            this.dataController.OnPlaylistFetchStateChanged        += OnPlaylistFetchStateChanged;
            this.dataController.OnCompleteProfileFetchStateChanged += OnHeaderFetchStateChanged;

            this.dataController.FetchUserProfileAsync(p.UserId);
        }
示例#2
0
 public IUserOverviewViewModel CreateUserOverviewViewModel(UserOverviewViewModelParams p)
 => new UserOverviewViewModel(ServiceRegistry.PlatformServices,
                              p);