public void NotifyQueue() { MessengerInstance.Send <NotificationMessage>(new NotificationMessage("New runner in queue")); }
public void Cancel(object obj) { MessengerInstance.Send <MessageWorkObject>(new MessageWorkObject (WorkCommandEnum.None, WorkVM.Work, chosenDate)); }
protected virtual void OnClose() { MessengerInstance.Send(new CloseDocumentMessage(this)); Cleanup(); IsClosed = true; }
private void Save() { MessengerInstance.Send(new NotificationMessage("Save")); Configuration.Instance.Save(); MessengerInstance.Send(new NotificationMessage("CloseSettings")); }
void Cancel() { MessengerInstance.Send <bool>(false, MsgToken.CloseSelectUser); }
public AxesParametersViewModel() : base() { MessengerInstance.Register <GetAxesParametersMessage>(this, OnGetAxesParametersMessage); MessengerInstance.Register <SetAxesParametersMessage>(this, OnSetAxesParametersMessage); }
private void RegisterMessages() { MessengerInstance.Register <TaxExemptVerification>(this, SetVerificationStatus); }
private void OpenStartRacePage() { MessengerInstance.Send(new OpenStartRacePageMessage()); }
private void OpenOtherTeamPage() { MessengerInstance.Send(new OpenOtherTeamPageMessage()); }
public ReportViewModel(IStatisticsService statisticsService) { _statisticsService = statisticsService; MessengerInstance.Register <PropertyChangedMessage <GraphServiceClient> >(this, (property) => this.Client = property.NewValue); }
private void OpenHomePage() { MessengerInstance.Send(new OpenHomePageMessage()); }
private void RegisterMessages() { MessengerInstance.Register <FuelPrices>(this, CompleteSaveFuelPrices); MessengerInstance.Register <FuelPriceReportMessage>(this, UpdateReport); }
public DutyListViewModel() { MessengerInstance.Register <object>(this, MsgToken.RefreshDutyList, RefreshList); RefreshList(null); }
protected override void Process() { var modal = new VerifyCard(); MessengerInstance.Send <UIElement>(modal); }
//private string _notification; //public string Notification //{ // get { return _notification; } // set // { // Set(ref _notification, value); // } //} public void Notify(string message) { MessengerInstance.Send(message); }
private void OpenSearchCyclistPage() { MessengerInstance.Send(new OpenSearchCyclistPageMessage()); }
private void DoAddDoc() { var showAddNewDonationMsg = ShowPopUpMessage.ForEntity <CommitteeDocument>(OnSuccess_AddingNewDoc, CurrentCommittee); MessengerInstance.Send(showAddNewDonationMsg); }
public FanGameEditorViewModel( FanGameEditingService fanGameEditingService, FileSystemBrowserService fileSystemBrowserService ) { _fanGameEditingService = fanGameEditingService; _fileSystemBrowserService = fileSystemBrowserService; BrowseCommand = new RelayCommand(() => { var browseResult = _fileSystemBrowserService.BrowseFiles( "Select game", new("Executable files", "*.exe"), new("All files", "*.*") ); if (browseResult == null) { return; } GameLocation = browseResult; RaisePropertyChanged(nameof(GameLocation)); }); BrowseImageCommand = new RelayCommand(() => { var browseResult = _fileSystemBrowserService.BrowseFiles( "Select cover image", new("Image files", "*.png", "*.jpg"), new("All files", "*.*") ); if (browseResult == null) { return; } CoverImageLocation = browseResult; RaisePropertyChanged(nameof(CoverImageLocation)); }); DeleteCommand = new RelayCommand(async() => { var error = await _fanGameEditingService.DeleteFanGame(); if (error != null) { MessageBox.Show(error.Message, "Error"); return; } MessengerInstance.Send <object?>(null, GamePickerViewModel.UpdateGamesToken); MessengerInstance.Send("HomePage.xaml", MainViewModel.ChangePageMessageToken); }); SaveCommand = new RelayCommand(async() => { var error = await _fanGameEditingService.SaveAsync(); if (error != null) { MessageBox.Show(error.Message, "Error"); return; } MessengerInstance.Send <object?>(null, GamePickerViewModel.UpdateGamesToken); MessengerInstance.Send("HomePage.xaml", MainViewModel.ChangePageMessageToken); }); CancelCommand = new RelayCommand( () => MessengerInstance.Send("HomePage.xaml", MainViewModel.ChangePageMessageToken) ); }
public DutyInfoViewModel() { MessengerInstance.Register <object>(this, MsgToken.TransforDuty, TransforDuty); }
public HistoryViewModel() { MessengerInstance.Register <HistoryClearedMessage>(this, (h) => OnHistoryCleared()); }
public SettingsViewModel() { SaveCommand = new RelayCommand(Save); CancelCommand = new RelayCommand(Cancel); MessengerInstance.Register <int>(this, OnTabChangeRequest); }
public WeatherViewModel() { ImagePath = "../Images/DefaultImage.png"; MessengerInstance.Register <GenericMessage <Weather> >(this, WeatherInfoRecieved); }
private void Cancel() { MessengerInstance.Send(new NotificationMessage("CloseSettings")); }
public MainViewModel() { MessengerInstance.Register <UpdateAvailablePanelHolderMessage>(this, OnUpdateAvailablePanelHolderMessage); MessengerInstance.Register <GetPanelDataMessage>(this, OnGetPanelDataMessage); }
private async Task TakePhotoAsync() { IsBusy = true; string recognizeText = null; try { using (var stream = await mediaPicker.TakePhotoAsync()) { if (stream != null) { var imageBytes = await stream.ToArrayAsync(); MessengerInstance.Send(new NotificationMessage <byte[]>(imageBytes, Constants.PhotoTaken)); Message = null; if (await Network.IsInternetAvailableAsync()) { var results = await visionService.RecognizeTextAsync(stream); var text = results.GetRecognizedText(); if (string.IsNullOrWhiteSpace(text)) { recognizeText = AppResources.UnableToRecognizeText; } else { recognizeText = text; } } else { // Internet isn't available, the service cannot be reached. recognizeText = AppResources.NoConnection; } } } } catch (WebException) { // Internet isn't available, the service cannot be reached. recognizeText = AppResources.NoConnection; } catch (ClientException) { // Unable to access the service (tipically, due to invalid registration keys). recognizeText = AppResources.UnableToAccessService; } catch (Exception ex) { var error = AppResources.RecognitionError; if (Settings.ShowExceptionOnError) { error = $"{error} ({ex.Message})"; } recognizeText = error; } // Shows the result. Message = this.GetNormalizedMessage(recognizeText); IsBusy = false; }
private UserProfile createProfile() { UserProfile newProfile = null; if ((_repositorySerializer = Connections.Repository) != null) { if ((_definitionsSerializer = Connections.Definitions) != null) { UserProxy proxy; try { //Zuerst korrespondierenden Userproxy holen IRestriction r = RestrictionFactory.Eq(typeof(UserProxy), "_LoginName", _settings.Username); //IRestriction r = RestrictionFactory.Eq(typeof(UserProxy), "_LoginName", @"TestEditor"); proxy = _repositorySerializer.Connector.Load <UserProxy>(r); if (proxy == null) { _Log.Error("No User Proxy"); _operation.failure("Services_UserProfile_Error_NoProxy", ""); return(null); } if (string.IsNullOrEmpty(proxy.AgentURI)) { _Log.Error("Cannot create Profile, empty AgentURI"); #if !DEBUG _operation.failure("Services_UserProfile_Error_EmptyAgentURL", ""); return(null); #endif } newProfile = _mobileSerializer.CreateISerializableObject <UserProfile>(); newProfile.LoginName = _settings.Username; //newProfile.LoginName = @"TestEditor"; string agentName = null; using (var conn = _definitionsSerializer.CreateConnection()) { try { conn.Open(); var cmd = conn.CreateCommand(); cmd.CommandText = "SELECT [AgentName] FROM [" + _settings.CurrentConnection.TaxonNamesInitialCatalog + "].[dbo].[IBFagents] WHERE [AgentURI] = '" + proxy.AgentURI + "'"; _Log.DebugFormat("Select AgentName Command: [{0}]", cmd.CommandText); agentName = cmd.ExecuteScalar() as string; _Log.DebugFormat("AgentName: [{0}]", agentName); } finally { conn.Close(); } } newProfile.CombinedNameCache = (!string.IsNullOrEmpty(agentName)) ? agentName : proxy.CombinedNameCache; newProfile.HomeDB = _settings.CurrentConnection.InitialCatalog; newProfile.AgentURI = proxy.AgentURI; _mobileSerializer.Connector.Save(newProfile); MessengerInstance.Send <SyncStepFinished>(SyncState.ProfileChanged); } catch (Exception ex) { newProfile = null; //TODO _operation.failure("", ""); _Log.ErrorFormat("Error Creating Profile: {0}", ex); } } else { _Log.Error("Definitions N/A"); } } else { _Log.Error("Repository N/A"); } return(newProfile); }
public void OnWindowClosing(object sender, CancelEventArgs e) { MessengerInstance.Send <MessageWorkObject> (new MessageWorkObject (WorkCommandEnum.None, WorkVM.Work, chosenDate)); dialog = null; }
private void Delete() { // talk to shell to call the appropriate viewmodel MessengerInstance.Send(new DeleteFiles(), MessageToken.Delete); }
public virtual void OnIsActiveChanged() { DispatcherHelper.RunAsync(() => MessengerInstance.Send(new ActivePaneChangedMessage(this))); }
private void ShowHome() { MessengerInstance.Send <string>("DecideHomeView"); }