public ShowMatchesViewModel(IMatchDataService matchDataService,
                                    IMvxMessenger messenger, IMvxWebBrowserTask webBrowser, IConnectivityService connectivityService,
                                    IDialogService dialogService)
        {
            _connectivityService = connectivityService;
            _dialogService       = dialogService;
            _webBrowser          = webBrowser;
            _comboCalcService    = new CombinationCalculator();
            matchOutcomes        = new Dictionary <Match, string>();
            _matchDataService    = matchDataService;
            _token    = messenger.Subscribe <OutcomeSelectedMessage>(UpdateVendorValue);
            Messenger = messenger;

            DirectToWebPageCommand = new MvxCommand(() => {
                if (_connectivityService.CheckOnline())
                {
                    try
                    {
                        _webBrowser.ShowWebPage(VendorValue.Vendor.Url);
                    }
                    catch (Exception)
                    {
                        _dialogService.ShowAlert("Ups, something went wrong when trying to redirct", "Couldn't redirct", "OK");
                    }
                }
                else
                {
                    _dialogService.ShowAlert("Please connect to internet and try again", "Couldn't redirct. No Internet Connection", "OK");
                }
            });
        }
示例#2
0
 public DetailViewModel(IMvxWebBrowserTask webBrowser)
 {
     this._webBrowser = webBrowser;
     OpenLinkCmd      = new MvxCommand(() =>
     {
         _webBrowser.ShowWebPage(URL);
     });
 }
示例#3
0
 private void GoToWebsite()
 {
     webBrowserTask.ShowWebPage(Constants.WEBSITE_URL);
 }
示例#4
0
 /// <summary>
 /// Handle a click of the Love it! button
 /// </summary>
 protected virtual void HandleLoveIt()
 {
     _webBrowser.ShowWebPage(_configuration.ApplicationReviewUrl);
 }