/// <summary> /// Déclenche l'événement IsBusyChanged /// </summary> protected override void OnIsBusyChanged() { base.OnIsBusyChanged(); // Refresh commands SearchCommand.RaiseCanExecuteChanged(); }
public string this[string columnName] { get { var bulderError = new StringBuilder(); if (columnName == "OriginalSelectValue" && OriginalSelectValue == null) { bulderError.AppendLine("Нужно указать город отправления."); } else if (columnName == "DestinationSelectValue" && DestinationSelectValue == null) { bulderError.AppendLine("Нужно указать город прибытия."); } else if (columnName == "DestinationSelectValue" && DestinationSelectValue == OriginalSelectValue) { bulderError.AppendLine("Город прибытия не может совпадать с городом отправления"); } else if (columnName == "DepartDate" && !DepartDate.HasValue) { bulderError.AppendLine("Выбирите дату"); } else if (columnName == "ReturnDate" && !ReturnDate.HasValue) { bulderError.AppendLine("Выбирите дату"); } Error = bulderError.ToString(); SearchCommand.RaiseCanExecuteChanged(); return(Error); } }
private void SearchModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { switch (e.PropertyName) { case "ZoekBestand": if (ZoekBestand) { FolderPath = ""; } break; case "ZoekMap": if (ZoekMap) { FilePath = ""; } break; case "SearchTerm": case "FolderPath": case "FilePath": SearchCommand.RaiseCanExecuteChanged(); break; } }
private async Task <ImageResponse> SearchUpdateImages(string text, CancellationToken cancellationToken) { var imageResponce = await GetImagesAsync(text, cancellationToken); // _images.Clear(); _nextUrl = imageResponce.Return(x => x.NextUrl, null); if (_nextUrl == null && _lastInstagramImageId == imageResponce.MinTagId) { SearchCommand.RaiseCanExecuteChanged(); await Task.FromResult(imageResponce); } _lastInstagramImageId = imageResponce.MinTagId; foreach (var image in imageResponce.Return(x => x.Images, Enumerable.Empty <WebBrowsing.Image>())) { InstagramImageViewModel viewModel = new InstagramImageViewModel(image.Data, image.Width, image.Height, image.Url, image.FullName, image.ProfilePictureData, image.UrlAvatar, image.UserName); _images.Add(viewModel); } SearchCommand.RaiseCanExecuteChanged(); cancellationToken.ThrowIfCancellationRequested(); return(await Task.FromResult(imageResponce)); }
protected virtual void OnSearchCommandHandler() { IsSearching = true; SearchCommand.RaiseCanExecuteChanged(); IsMessageVisible = false; }
private void OnModelPropertyChanged(object sender, PropertyChangedEventArgs e) { SearchCommand.RaiseCanExecuteChanged(); AddCommand.RaiseCanExecuteChanged(); DeleteCommand.RaiseCanExecuteChanged(); SaveCommand.RaiseCanExecuteChanged(); CancelCommand.RaiseCanExecuteChanged(); }
protected virtual void RaiseAllCanExecuteChanged() { SearchCommand.RaiseCanExecuteChanged(); AddCommand.RaiseCanExecuteChanged(); DeleteCommand.RaiseCanExecuteChanged(); SaveCommand.RaiseCanExecuteChanged(); CancelCommand.RaiseCanExecuteChanged(); }
private void RaiseCanExecuteCommands() { NextMonthCommand.RaiseCanExecuteChanged(); PreviousMonthCommand.RaiseCanExecuteChanged(); RemoveUserCommand.RaiseCanExecuteChanged(); CurrentMonthCommand.RaiseCanExecuteChanged(); SearchCommand.RaiseCanExecuteChanged(); ClearAllCommand.RaiseCanExecuteChanged(); PrintCommand.RaiseCanExecuteChanged(); }
public override void AfterItemPermissionsCompleted() { base.AfterItemPermissionsCompleted(); NewCommand.RaiseCanExecuteChanged(); EditCommand.RaiseCanExecuteChanged(); SaveCommand.RaiseCanExecuteChanged(); SearchCommand.RaiseCanExecuteChanged(); DeleteCommand.RaiseCanExecuteChanged(); PrintCommand.RaiseCanExecuteChanged(); CancelCommand.RaiseCanExecuteChanged(); ExportCommand.RaiseCanExecuteChanged(); }
/// <summary> /// Déclenche l'événement <see cref="CriteriaErrorsChanged"/> si une propiété de <see cref="Criteria"/> contient une erreur /// </summary> protected virtual void OnCriteriaErrorsChanged(object sender, DataErrorsChangedEventArgs e) { CriteriaErrorsChanged?.Invoke(sender, e); if (sender != null && e != null) { OnErrorsChanged(sender, e.PropertyName); } // Refresh commands SearchCommand.RaiseCanExecuteChanged(); }
protected virtual async Task OnSearchResultHandler(SearchResultMessage message) { if (message.IsFinished) { IsSearching = false; SearchCommand.RaiseCanExecuteChanged(); } else { Message = message.Message; IsMessageVisible = !String.IsNullOrEmpty(message.Message); } await Task.Yield(); }
private void UpdateSelectedMonth(MonthViewModel monthViewModel) { MonthViewModel viewModel; bool exist = _searchQuery.SelectedMonths.TryGetValue(monthViewModel.Number, out viewModel); if (monthViewModel.IsChecked && !exist) { _searchQuery.SelectedMonths.Add(monthViewModel.Number, monthViewModel); } else if (exist) { _searchQuery.SelectedMonths.Remove(viewModel.Number); } SearchCommand.RaiseCanExecuteChanged(); }
private void Search(string text) { if (!string.IsNullOrEmpty(_previousSearch)) { if (string.Compare(text, _previousSearch, StringComparison.OrdinalIgnoreCase) != 0) { _nextUrl = null; Images.Clear(); } } _previousSearch = text; SearchCommand.RaiseCanExecuteChanged(); _searchTokenSource.Cancel(); _searchTokenSource = new CancellationTokenSource(); SearchAsyncOperation = new NotifyTaskCompletion <ImageResponse>(SearchUpdateImages(text, _searchTokenSource.Token)); }
private void SetIsBusy(bool isBusy) { _isBusy = isBusy; SearchCommand.RaiseCanExecuteChanged(); CustomSearchCommand.RaiseCanExecuteChanged(); }
private void UpdateCommands() { GoBackCommand.RaiseCanExecuteChanged(); SearchCommand.RaiseCanExecuteChanged(); }