예제 #1
0
        public ShellViewModel(IRegionManager regionManager, IListPublisher listPublisher, ITweetsProvider tweetsProvider)
        {
            Disposable    = new CompositeDisposable();
            ListPublisher = listPublisher;

            Messanger = new Messanger4Tweets(tweetsProvider);

            SelectedTweet = Messanger.SelectedTweet.ToReadOnlyReactivePropertySlim();
            ExpandedLists = new ReactiveCommand <RoutedEventArgs>()
                            .AddTo(Disposable);
            OnLoaded = new ReactiveCommand()
                       .AddTo(Disposable);
            OpenBrowser = new ReactiveCommand()
                          .AddTo(Disposable);
            InitialAuth = new ReactiveCommand()
                          .AddTo(Disposable);
            OpenList = new ReactiveCommand <RoutedEventArgs>()
                       .AddTo(Disposable);
            OpenTweetFlyOut = new ReactiveCommand()
                              .AddTo(Disposable);
            SendTweet = new ReactiveCommand <KeyEventArgs>()
                        .AddTo(Disposable);
            ClearInReplyCommand = new ReactiveCommand()
                                  .AddTo(Disposable);

            ExpandedLists.Subscribe(_ => FetchTwitterLists())
            .AddTo(Disposable);
            OnLoaded.Subscribe(_ => Loaded())
            .AddTo(Disposable);
            OpenBrowser.Subscribe(_ => OpenBrowserAction())
            .AddTo(Disposable);
            InitialAuth.Subscribe(_ => Auth())
            .AddTo(Disposable);
            OpenList.Subscribe(e => OpenListAction(e))
            .AddTo(Disposable);
            OpenTweetFlyOut.Subscribe(_ => OpenTweetFlyOutAction())
            .AddTo(Disposable);
            SendTweet.Subscribe(_ => SendTweetAction())
            .AddTo(Disposable);
            ClearInReplyCommand.Subscribe(_ => Tweet.ClearInReplyToForce())
            .AddTo(Disposable);
        }