public ResultsViewModel(IMainModel mainModel, INavigationService navigationService, IEmailComposeService emailComposeService, ISmsComposeService smsComposeService, IShareStatusService shareStatusService) { _mainModel = mainModel; _navigationService = navigationService; _emailComposeService = emailComposeService; _smsComposeService = smsComposeService; _shareStatusService = shareStatusService; SendEmailCommand = new RelayCommand(() => { var selectedResult = Results[SelectedResultIndex]; var subject = selectedResult.ToString(); var body = selectedResult.Result.ToString(); _emailComposeService.Show(subject, body); }, () => SelectedResultIndex != -1); SendMessageCommand = new RelayCommand(() => { var selectedResult = Results[SelectedResultIndex]; var subject = selectedResult.ToString(); var body = selectedResult.Result.ToString(); _smsComposeService.Show(string.Empty, subject + " - " + body); }, () => SelectedResultIndex != -1); ShareCommand = new RelayCommand(() => { var selectedResult = Results[SelectedResultIndex]; var subject = selectedResult.ToString(); var body = selectedResult.Result.ToString(); _shareStatusService.Show(subject + " - " + body); }, () => SelectedResultIndex != -1); RefreshCommand = new RelayCommand(() => { _navigationService.NavigateTo(new Uri("/View/RefreshPage.xaml", UriKind.Relative)); }); ShowAboutCommand = new RelayCommand(() => { _navigationService.NavigateTo(new Uri("/View/AboutPage.xaml", UriKind.Relative)); }); ApplicationBarStateChangedCommand = new RelayCommand <ApplicationBarStateChangedEventArgs>(e => { ApplicationBarMenuVisible = e.IsMenuVisible; }); PageLoadedCommand = new RelayCommand(() => { _navigationService.RemoveBackEntry(); }); }
private void OnShareOnSocialNetworkCommand() { _shareStatusService.Show(GetMessageForSharing()); }
private void OnShareOnSocialNetworkCommand() { _shareStatusService.Show(Title + ": " + Description); }