public ImportContactUserControl(CEPersonView cePersonView, DialogService dialogService) { InitializeComponent(); _cePersonView = cePersonView; _cePersonViewModel = (CEPersonViewModel)_cePersonView.DataContext; _dialogService = dialogService; }
/// <summary> /// Initializes a new <see cref="CreateTodoListItemViewModel"/> instance. /// </summary> /// <param name="navigationService">The navigation service, which is used to navigate between views.</param> /// <param name="applicationService">The application service, which can be used to manage the application lifecycle.</param> /// <param name="dialogService">The dialog service, which provides access to the various dialogs offered by Windows.</param> /// <param name="todoListItemsRepository">The todo list items repository, which can be used to manage the items on the todo list.</param> public CreateTodoListItemViewModel(NavigationService navigationService, ApplicationService applicationService, DialogService dialogService, TodoListItemsRepository todoListItemsRepository) { this.navigationService = navigationService; this.applicationService = applicationService; this.dialogService = dialogService; this.todoListItemsRepository = todoListItemsRepository; }
private void SecurityAdminDialog_Closing(object sender, System.ComponentModel.CancelEventArgs e) { DialogService d = new DialogService(); d.Height = 120; d.Width = 340; d.Show("Security Admin","Restart browser session required for the users whose permissions got changed!",false); }
public FindVenueUserControl(CEDateView ceDateView, DialogService dialogService, ProgressIndicator progressIndicator) { InitializeComponent(); _ceDateView = ceDateView; _ceDateViewModel = (CEDateViewModel)_ceDateView.DataContext; _dialogService = dialogService; _progressIndicator = progressIndicator; }
public void DisplaysAlert() { var page = new Mock<IPage>(); var dialogService = new DialogService(page.Object); dialogService.DisplayAlert("Alert", "You have been alerted", "OK"); page.Verify(x => x.DisplayAlert("Alert", "You have been alerted", "OK")); }
async Task<UICommand> ShowAsyncIoT(string messageBoxText, string caption, IList<UICommand> commands) { var service = new DialogService(); var str = "<DataTemplate xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">" + "<ContentControl Content=\"{Binding}\"/>" + "</DataTemplate>"; service.ViewTemplate = (Windows.UI.Xaml.DataTemplate)Windows.UI.Xaml.Markup.XamlReader.Load(str); return await service.ShowDialogAsync(commands, caption, messageBoxText); }
public ToiletOverviewViewModel() { _toiletDataService = new ToiletDataService(); _dialogService = new DialogService(); LoadData(); LoadCommand(); Messenger.Default.Register<UpdateListMessage>(this, OnUpdateListMessageReceived); }
public AccessControlViewModel() : base() { base.Title = "Access Control"; base.Type = SnapInNames.AccessControl; base.Logo = new Uri("pack://application:,,,/NFCAccessControlCenter;component/Images/Navigation/accessgroups.png", UriKind.Absolute); _accessProfileServicee = AccessProfileService.Instance; _dialogService = DialogService.Instance; }
public void TestSelectTestDisplaysData() { INavigationService navigationService = new NavigationService(); IDialogService dialogService = new DialogService(); IDataRepository dataRepository = new QuestionsDesignRepository(); SelectTestViewModel viewModel = new SelectTestViewModel(navigationService, dataRepository, dialogService); viewModel.GetTestsCommand.Execute(null); Assert.IsNotNull(viewModel.Tests); }
public static List<DialogRecord> CreateSets(bool saveToFile = false) { string speaker1 = "Roman"; Dictionary<string, string> fileDictionary = new Dictionary<string, string>(); fileDictionary.Add("Vano", @"C:\TrainingSet\Dialogs\Vano.txt"); fileDictionary.Add("Anna", @"C:\TrainingSet\Dialogs\Anna.txt"); fileDictionary.Add("Danila", @"C:\TrainingSet\Dialogs\Danila.txt"); fileDictionary.Add("Dinara", @"C:\TrainingSet\Dialogs\Dinara.txt"); fileDictionary.Add("Farit", @"C:\TrainingSet\Dialogs\Farit.txt"); fileDictionary.Add("Igor", @"C:\TrainingSet\Dialogs\Igor.txt"); fileDictionary.Add("Katherine", @"C:\TrainingSet\Dialogs\Katherine.txt"); fileDictionary.Add("Lilia", @"C:\TrainingSet\Dialogs\Lilia.txt"); fileDictionary.Add("Tanya", @"C:\TrainingSet\Dialogs\Tanya.txt"); DialogService myReplics = new DialogService(); DialogService theirReplics = new DialogService(); myReplics.Records = new List<DialogRecord>(); theirReplics.Records = new List<DialogRecord>(); foreach (KeyValuePair<string, string> file in fileDictionary) { string speaker2 = file.Key; string inputPath = file.Value; Console.WriteLine(string.Format("Processing Dialog between {0} and {1}...", speaker1, speaker2)); List<DialogRecord> wholeDialog = DialogService.GetRecordsFromFile(inputPath, speaker1, speaker2); var speaker1Role = wholeDialog.Where(x => x.Sender == speaker1).ToList(); var speaker2Role = wholeDialog.Where(x => x.Sender == speaker2).ToList(); wholeDialog.RemoveAll(x => x.Sender == speaker1 || x.Sender == speaker2); if (wholeDialog.Count > 0) { throw new Exception("Something bad happend..." + speaker2); } for (int i = 0; i < speaker2Role.Count; ++i) { if (i < speaker1Role.Count) { speaker2Role[i].RelatedRecord = speaker1Role[i]; } } myReplics.Records.AddRange(speaker1Role); theirReplics.Records.AddRange(speaker2Role); } if (saveToFile) { myReplics.SaveToFile(@"C:\TrainingSet\Me.txt"); theirReplics.SaveToFile(@"C:\TrainingSet\Them.txt"); } return theirReplics.Records; }
public UserControlCenterViewModel() : base() { base.Title = "User Control"; base.Type = SnapInNames.UserControl; base.Logo = new Uri("pack://application:,,,/NFCAccessControlCenter;component/Images/Navigation/usercontrol.png", UriKind.Absolute); _userService = UserService.Instance; _nfcTagService = NfcTagService.Instance; _accessProfileService = AccessProfileService.Instance; _dialogService = DialogService.Instance; }
public MspWizardWindow() { Settings = new WizardSettingsInfo(); OkCloseCommand = new RelayCommand(param => OkClose(), (obj) => { return Settings.IsValid; }); InitializeComponent(); edtBase.AddHandler(Button.ClickEvent, new RoutedEventHandler(Button_Click)); edtTarget.AddHandler(Button.ClickEvent, new RoutedEventHandler(Button_Click)); dialogService = new DialogService(this); }
public async void DisplaysAlertWithResponse() { var page = new Mock<IPage>(); page.Setup(x => x.DisplayAlert(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .ReturnsAsync(true); var dialogService = new DialogService(page.Object); var answer = await dialogService.DisplayAlert("Question?", "Would you like to play a game", "Yes", "No"); page.Verify(x => x.DisplayAlert("Question?", "Would you like to play a game", "Yes", "No")); Assert.That(answer, Is.True); }
public void DeleteEditedNote() { DialogService dialog = new DialogService(); dialog.ShowMessage("Do you really want to delete the selected note?", "Delete selected note!", "YES, delete", "NO, let me return", async confirmed => { if (confirmed) { await dataService.DeleteNote(Note); navigationService.GoBack(); } }); }
public void TakeTestDisplaysCorrectNumberOfQuestionsData() { INavigationService navigationService = new NavigationService(); IDialogService dialogService = new DialogService(); IDataRepository dataRepository = new QuestionsDesignRepository(); TakeTestViewModel viewModel = new TakeTestViewModel(navigationService, dataRepository, dialogService); //Pass Test to View Model viewModel.CurrentTest = dataRepository.GetTestById(0); viewModel.PrepareTestCommand.Execute(null); Assert.AreEqual(dataRepository.GetTestById(0).QuestionsGroups.SelectMany(x => x.Questions).Count(), viewModel.QuestionsCount); }
public async void DisplaysActionSheetWithResponse() { var page = new Mock<IPage>(); page.Setup(x => x.DisplayActionSheet("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook")) .ReturnsAsync("Yes"); var dialogService = new DialogService(page.Object); var answer = await dialogService.DisplayActionSheet("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook"); page.Verify(x => x.DisplayActionSheet("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook")); Assert.That(answer, Is.EqualTo("Yes")); }
public ListSettingsDialogViewModel(String listAsmxUrl, string listOrgAsmxUrl, string peopleAsmxUrl, string customPermissionsAsmxUrl, SPList dropDownSelectedList, string siteURL,string siteRootURL, StringBuilder log,List<BusinessUnit> units) { EventAggregator.Instance.Publish<bCheck.Admin.MainPage.MessageSample>(new bCheck.Admin.MainPage.MessageSample()); PeopleAsmx = peopleAsmxUrl; SPClientContext = new ClientContext(siteURL); CustomPermissionsAsmx = customPermissionsAsmxUrl; _dispatcher = Deployment.Current.Dispatcher; ListCollection = new ObservableCollection<SharepointList>(); SiteRootUrl = siteRootURL; ListSettingsAgent = new ListSettingsServiceAgent(listAsmxUrl, listOrgAsmxUrl, siteURL, SiteRootUrl); dialogService = new DialogService(); dialogService.Width = 180; dialogService.Height = 120; PermissionsAgent = new PermissionsServiceAgent(PeopleAsmx, CustomPermissionsAsmx); SaveListCommand = new RelayCommand(SaveListAction); DeleteListCommand = new RelayCommand(DeleteListAction); ListPermissionsCommand = new RelayCommand(ListPermissionsAction); CloseCommand = new RelayCommand(CloseAction); CloseCommand.IsEnabled = true; SaveListCommand.IsEnabled = false; SelectedList = new SharepointList(); SelectedList.IsQuickLaunchEnabled = true; PeoplePickerCommand = new RelayCommand(PeoplePickerAction); DropDownSelectedList = dropDownSelectedList; AvailableListName = dropDownSelectedList.ListName; IsDropDownListSelected = false; SiteUrl = siteURL; _log = log; if (AvailableListName != null) { EditListSelected = true; IsNewListEnabled = false; NewListSelected = false; IsDropDownListSelected = true; } else { NewListSelected = true; IsNewListEnabled = true; } if (units != null) { BusinessUnitDropDownValues = new ObservableCollection<string>(); foreach (BusinessUnit unit in units) BusinessUnitDropDownValues.Add(unit.Title); } }
public void DeleteNote() { DialogService dialog = new DialogService(); dialog.ShowMessage("Do you really want to delete the selected note?", "Delete selected note!", "YES, delete", "NO, let me return", confirmed => { if (confirmed) { dataService.DeleteNote(SelectedNote); RaisePropertyChanged(() => ReadList); } }); }
public void SaveEditedNote() { if (HasNoteChanged) { DialogService dialog = new DialogService(); dialog.ShowMessage("Save changes to note?", "Save changes", "YES, save", "NO, let me return", async confirmed => { if (confirmed) { await dataService.SaveNote(Note); navigationService.GoBack(); } }); } }
public MainViewModel() { this.AvailableLanguages = new ObservableCollection<string>(Settings.Default.mossLanguages.Split(',')); this.SelectedLanguage = this.AvailableLanguages.FirstOrDefault(); this.MaxMatches = 3; this.DisplayResults = 250; this.OpenFolderCommand = new RelayCommand(() => { var selectedFolder = new DialogService().OpenFolderDialog(); if (!string.IsNullOrEmpty(selectedFolder)) { this.SelectedFolder = selectedFolder; } }); this.ScanFolderCommand = new RelayCommand(this.ScanFolder); this.SubmitCommand = new RelayCommand(this.Submit, () => !this.HasValidationError && !string.IsNullOrEmpty(this.SelectedFolder)); }
private void InitializeDialog() { IDialogService dialog = new DialogService(); dialog.Register(new Views.Dialogs.CreateOrder()); dialog.Register(new Views.Dialogs.CreateOrderDetail()); dialog.Register(new Views.Dialogs.Finishing()); dialog.Register(new Views.Dialogs.Material()); dialog.Register(new Views.Dialogs.PrintQuality()); dialog.Register(new Views.Dialogs.Size()); dialog.Register(new Views.Dialogs.Warning()); dialog.Register(new Views.Dialogs.PrintInvoice()); dialog.Register(new Views.Dialogs.YesNo()); dialog.Register(new Views.Dialogs.Supplier()); dialog.Register(new Views.Dialogs.Stock()); ObjectPool.Instance.Register<IDialogService>().ImplementedBy(dialog); }
/// <summary> /// Initializes a new instance of the ViewModelLocator class. /// </summary> public ViewModelLocator() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); ////if (ViewModelBase.IsInDesignModeStatic) ////{ //// // Create design time view services and models //// SimpleIoc.Default.Register<IDataService, DesignDataService>(); ////} ////else ////{ //// // Create run time view services and models //// SimpleIoc.Default.Register<IDataService, DataService>(); ////} var dialog = new DialogService(); SimpleIoc.Default.Register<IDialogService>(() => dialog); SimpleIoc.Default.Register<INavigationOnDiskService, NavigationOnDiskService>(); SimpleIoc.Default.Register<NavigationOnDiskViewModel>(); }
public ViewModelLocator() { IDialogService dialogService = new DialogService(); INavigationService navigationService = new NavigationService(); ITranslinkService translinkService; if (ViewModelBase.IsInDesignModeStatic) { translinkService = new DesignTranslinkInfoService(); } else { translinkService = new TranslinkService(); } //Cache Service code - TODO translinkService.CacheUserPreference("0"); Main = new MainViewModel(translinkService, dialogService, navigationService); //Initializing User Preference storage }
public void TakeTestDisplaysAllAnswersForRandomQuestionData() { INavigationService navigationService = new NavigationService(); IDialogService dialogService = new DialogService(); IDataRepository dataRepository = new QuestionsDesignRepository(); TakeTestViewModel viewModel = new TakeTestViewModel(navigationService, dataRepository, dialogService); //Pass Test to View Model viewModel.CurrentTest = dataRepository.GetTestById(0); viewModel.PrepareTestCommand.Execute(null); int questionId = viewModel.CurrentQuestion.Id; Question questionById = dataRepository.GetQuestionById(questionId); foreach (Answer answerById in questionById.Answers) { Assert.AreEqual(answerById.AnswerPhrase , viewModel.CurrentQuestion.Answers.FirstOrDefault(x => x.Id == answerById.Id).AnswerPhrase); } }
public App() { InitializeComponent(); // First time initialization var nav = new NavigationService(); nav.Configure(ViewModelLocator.DetailsPageKey, typeof(DetailsPage)); nav.Configure(ViewModelLocator.AddCommentPageKey, typeof(AddCommentPage)); nav.Configure(App.ShowCommentsPageKey, typeof(ShowCommentsPage)); SimpleIoc.Default.Register<INavigationService>(() => nav); var dialog = new DialogService(); SimpleIoc.Default.Register<IDialogService>(() => dialog); var navPage = new NavigationPage(new MainPage()); nav.Initialize(navPage); dialog.Initialize(navPage); // The root page of your application MainPage = navPage; }
public void CancelNewNote() { if (String.IsNullOrEmpty(NewTextTitle)) { _navigationService.GoBack(); } else { DialogService dialog = new DialogService(); dialog.ShowMessage("Your note is not saved, Cancel without saving?", "Note not saved!", "Quit anyway", "Let me return", confirmed => { if (confirmed) { NewTextTitle = String.Empty; NewTextNote = String.Empty; _navigationService.GoBack(); } }); } }
public GroupUsersViewModel(UserSecurityAdminViewModel model, Dispatcher d) { _parentModel = model; _dispatcher = d; CancelCommand = new RelayCommand(CancelAction); CancelCommand.IsEnabled = true; RemoveUserCommand = new RelayCommand(RemoveUserAction); RemoveUserCommand.IsEnabled = true; AddUserCommand = new RelayCommand(AddUserAction); AddUserCommand.IsEnabled = false; GroupUsersCommand = new RelayCommand(GetGroupUsersAction); GroupUsersCommand.IsEnabled = false; GroupUsers = new ObservableCollection<User>(); dialogService = new DialogService(); dialogService.Width = 350; dialogService.Height = 140; }
protected async void Button0Click(UIMouseEventArgs args) { var result = await DialogService.OpenAsync <AddEmployee>("Add Employee", null); await Invoke(() => { StateHasChanged(); }); }
protected async void Button3Click(MouseEventArgs args) { DialogService.Close(null); }
protected async System.Threading.Tasks.Task Grid0RowSelect(CanErpHrPr.Models.DbAtVdc2.TblHpNhanVien args) { var result = await DialogService.OpenAsync <EditTblHpNhanVien>("Edit Tbl Hp Nhan Vien", new Dictionary <string, object>() { { "NhanVien_ID", args.NhanVien_ID } }); await InvokeAsync(() => { StateHasChanged(); }); }
protected async void Button2Click(MouseEventArgs args) { DialogService.Close(); await JSRuntime.InvokeAsync <string>("window.history.back"); }
public LoginViewModel() { navigationService = new NavigationService(); dialogService = new DialogService(); IsRemembered = true; }
private async Task ScanLocalNetwork() { ListOfScannedIpAddresses = new List <string>(); string localIpAddress = GetLocalIpAddress(); if (!String.IsNullOrEmpty(localIpAddress) && localIpAddress != "Not Connected") { List <IPAddress> IpAddressList = new List <IPAddress>(); IpAddressList = GetListOfLocalIpAddresses(localIpAddress); ShowBusy(); foreach (var ipAddress in IpAddressList) { var validAddress = await SendHttpRequestAsync(ipAddress.ToString()); if (validAddress) { ListOfScannedIpAddresses.Add(ipAddress.ToString()); break; } } #region Task.WhenAll //Task<bool>[] tasks = new Task<bool>[IpAddressList.Count]; //for (int i = 0; i < IpAddressList.Count; i++) //{ // Task<bool> task = SendHttpRequestAsync(IpAddressList[i].ToString()); // tasks[i] = task; //} //await Task.WhenAll(tasks); //for (int i = 0; i < tasks.Length; i++) //{ // if (tasks[i].Result) // { // ListOfScannedIpAddresses.Add(IpAddressList[i].ToString()); // } //} #endregion IsIpListVisible = true; HideBusy(); if (!ListOfScannedIpAddresses.Any()) { await ShowDialogAsync("WrongNetwork"); //await // _dialog.ShowAsync("Nie mogę znaleść dekodera w tej sieci. Czy Twój dekoder jest w tej samej sieci?", // "Wrong Network", new UICommand("OK")); IsIpListVisible = false; } } else { _dialog = new DialogService(); await ShowDialogAsync("NoNetwork"); //await // _dialog.ShowAsync("Nie jesteś połaczony z żadną siecią.", // "Brak połączenia z siecią.", new UICommand("OK")); IsIpListVisible = false; } }
public void DoAction(NWPlayer user, NWObject target, NWLocation targetLocation, params string[] args) { DialogService.StartConversation(user, user, "ViewSkills"); }
protected async System.Threading.Tasks.Task Grid0RowSelect(BlazorCustomPaging.Models.Sample.Product args) { var dialogResult = await DialogService.OpenAsync <EditProduct>("Edit Product", new Dictionary <string, object>() { { "Id", args.Id } }); await InvokeAsync(() => { StateHasChanged(); }); }
private void prepareDialogService() => DialogService.Confirm( Resources.DifferentWorkspaceAlertTitle, Resources.DifferentWorkspaceAlertMessage, Resources.Ok, Resources.Cancel).Returns(true);
// Shows the Login View public void Login() { OnLogin(DialogService.ShowDialog(MessageButton.OKCancel, "Please enter you credentials", "LoginView", loginViewModel)); }
public void Cancel() { DialogService.Close(DialogResult <Item> .Cancel()); }
private void Picker_OnTap(object sender, System.Windows.Input.GestureEventArgs e) { FrameworkElement frameworkElement1 = this.ParentElement ?? (FrameworkElement)this.Page; Point point1 = base.TransformToVisual((UIElement)frameworkElement1).Transform(new Point(0.0, 0.0)); // ISSUE: explicit reference operation // ISSUE: variable of a reference type double num1 = point1.X - 16.0; point1.X = num1; // ISSUE: explicit reference operation if (point1.X + this.PickerWidth > 474.0) { // ISSUE: explicit reference operation point1.X = (474.0 - this.PickerWidth); } Grid grid1 = new Grid(); int num2 = 0; ((FrameworkElement)grid1).VerticalAlignment = ((VerticalAlignment)num2); int num3 = 0; ((FrameworkElement)grid1).HorizontalAlignment = ((HorizontalAlignment)num3); Grid grid2 = grid1; ObservableCollection <ListPickerListItem> observableCollection = new ObservableCollection <ListPickerListItem>(); ListPickerListItem listPickerListItem1 = null; foreach (object fromObj in (IEnumerable)this.ItemsSource) { ListPickerListItem listPickerListItem2 = new ListPickerListItem(fromObj) { Prefix = this.ItemPrefix }; observableCollection.Add(listPickerListItem2); object selectedItem = this.SelectedItem; if (fromObj == selectedItem) { listPickerListItem2.IsSelected = true; listPickerListItem1 = listPickerListItem2; } } ListPickerItemsUC listPickerItemsUc = new ListPickerItemsUC(); listPickerItemsUc.ItemsSource = observableCollection; listPickerItemsUc.SelectedItem = listPickerListItem1; DataTemplate itemTemplate = this.ItemTemplate; listPickerItemsUc.ItemTemplate = itemTemplate; double pickerMaxHeight = this.PickerMaxHeight; listPickerItemsUc.PickerMaxHeight = pickerMaxHeight; double pickerWidth = this.PickerWidth; listPickerItemsUc.PickerWidth = pickerWidth; FrameworkElement frameworkElement2 = frameworkElement1; listPickerItemsUc.ParentElement = frameworkElement2; Point point2 = point1; listPickerItemsUc.ShowPosition = point2; ListPickerItemsUC picker = listPickerItemsUc; ((PresentationFrameworkCollection <UIElement>)((Panel)grid2).Children).Add((UIElement)picker); DialogService dialogService = new DialogService(); dialogService.AnimationType = DialogService.AnimationTypes.None; SolidColorBrush solidColorBrush = new SolidColorBrush(Colors.Transparent); dialogService.BackgroundBrush = (Brush)solidColorBrush; Grid grid3 = grid2; dialogService.Child = (FrameworkElement)grid3; DialogService ds = dialogService; ((UIElement)picker.listBox).Tap += ((EventHandler <System.Windows.Input.GestureEventArgs>)((o, args) => { ListPickerListItem selectedItem = picker.listBox.SelectedItem as ListPickerListItem; if (selectedItem != null) { this.SelectedItem = this.ItemsSource[picker.ItemsSource.IndexOf(selectedItem)]; } ((Timeline)picker.AnimClipHide).Completed += ((EventHandler)((sender1, eventArgs) => ds.Hide())); picker.AnimClipHide.Begin(); })); picker.Setup(); ds.Opened += (EventHandler)((o, args) => picker.AnimClip.Begin()); ds.Show(null); }
public RoundViewModel(DialogService dialogService, IRoundService rounderService, IPlayerService playerService, ICacheService cacheService) { _dialogService = dialogService; _roundService = rounderService; _playerService = playerService; _cacheService = cacheService; if (IsInDesignMode) { Application.Current.Dispatcher.Invoke(async () => { DemosDesignService design = new DemosDesignService(); CurrentDemo = await design.AnalyzeDemo(new Demo(), CancellationToken.None); RoundNumber = 10; await LoadDatas(); }); } }
protected async System.Threading.Tasks.Task Form0Submit(ApplicationUser args) { DialogService.Close(); await JSRuntime.InvokeAsync <string>("window.history.back"); }
public PrincipalViewModel() { IsEnabled = true; dialogService = new DialogService(); navigationService = new NavigationService(); }
protected async System.Threading.Tasks.Task Button2Click(MouseEventArgs args) { DialogService.Close(); await JSRuntime.InvokeAsync <string>("window.history.back"); }
// ReSharper disable once UnusedMember.Local public static void Main() { DialogService.OnActionsTaken(12); }
protected async System.Threading.Tasks.Task Grid0RowSelect(CanErp2.Models.DbAtVdc2.TblSoOrderDetailStatus args) { var result = await DialogService.OpenAsync <EditTblSoOrderDetailStatus>("Edit Tbl So Order Detail Status", new Dictionary <string, object>() { { "SODetailStatus_SEQ", args.SODetailStatus_SEQ } }); await InvokeAsync(() => { StateHasChanged(); }); }
private void ViewRecoveryKey(object obj) { DialogService.ShowViewRecoveryKey(MegaSdk.exportMasterKey(), CopyClipboard); }
public LoginViewModel() { dialogService = new DialogService(); this.IsRemembered = true; this.IsEnabled = true; }
public void ProcessBackupLink() { DialogService.ShowViewRecoveryKey(MegaSdk.exportMasterKey(), CopyClipboard); }
public override async Task InitializeAsync(object navigationData) { CurrentDate = DateTime.Now; IsBusy = true; try { var members = _memberService.GetMembers(); var weather = _weatherService.GetWeatherInfoAsync(); var events = _eventsService.GetEvents(); var suggestions = _ridesService.GetSuggestions(); var tasks = new List <Task> { weather, events, suggestions, members }; while (tasks.Count > 0) { var finishedTask = await Task.WhenAny(tasks); tasks.Remove(finishedTask); if (finishedTask.Status == TaskStatus.RanToCompletion) { if (finishedTask == weather) { var weatherResults = await weather; if (weatherResults is WeatherInfo) { var weatherInfo = weatherResults as WeatherInfo; Location = weatherInfo.LocationName; Temp = Math.Round(weatherInfo.Temp).ToString(); } } else if (finishedTask == events) { var eventsResults = await events; Events = new ObservableCollection <Event>(eventsResults); } else if (finishedTask == suggestions) { var suggestionsResults = await suggestions; Suggestions = new ObservableCollection <Suggestion>(suggestionsResults); } else if (finishedTask == members) { var memberResults = await members; //Invities Invitees[] invitiesObject = memberResults.Invitees; Invities = invitiesObject.Length.ToString(); //Attendees Attendees[] attendeesObject = memberResults.MeetingAttendees; Joined = attendeesObject.Length.ToString(); //New or Introduers HashSet <string> PersonIds = new HashSet <string>(invitiesObject.Select(s => s.PersonId)); var results = attendeesObject.Where(m => !PersonIds.Contains(m.PersonId)); Newjoin = results.Count().ToString(); //Not joined int attendees_invited = Math.Abs(attendeesObject.Length - results.Count()); NotJoined = Math.Abs(invitiesObject.Length - attendees_invited).ToString(); //Members var NewMember = new ObservableCollection <MeetingMembers>(); var newEvent = new ObservableCollection <Event>(); foreach (Attendees person in attendeesObject) { MeetingMembers meetingmembers = new MeetingMembers(); Event meetingevent = new Event(); if (person.EmpName.ToString().Trim() == "NaN") { meetingmembers.EmpName = "NEW"; meetingevent.Name = "NEW"; } else { meetingmembers.EmpName = person.EmpName; meetingevent.Name = person.EmpName; } meetingmembers.PersonId = person.PersonId; if (person.Department.ToString().Trim() == "NaN") { meetingmembers.Department = "NEW"; } else { meetingmembers.Department = person.Department; } meetingmembers.Gender = person.Gender; if (person.Smile == "Sad") { meetingmembers.Smiley = "Smiley1.png"; meetingevent.Emoction = "Smiley1.png"; } else if (person.Smile == "Smile") { meetingmembers.Smiley = "Smiley.png"; meetingevent.Emoction = "Smiley.png"; } else { meetingmembers.Smiley = "Smiley.png"; meetingevent.Emoction = "Smiley.png"; } meetingmembers.ImagePath = GlobalSettings.MemberEndpoint.ToString() + person.BlobName; meetingevent.ImagePath = meetingmembers.ImagePath; meetingmembers.Attendence = "Off.png"; meetingevent.Attendence = "Off.png"; meetingevent.Title = "Title"; meetingevent.Email = "*****@*****.**"; meetingevent.PhoneNumber = "123"; meetingevent.Venue = new Venue { Name = "Venue" }; newEvent.Add(meetingevent); NewMember.Add(meetingmembers); } HashSet <string> Id_Invitees = new HashSet <string>(invitiesObject.Select(s => s.PersonId)); var notPresent = attendeesObject.Where(m => !Id_Invitees.Contains(m.PersonId)); foreach (var person in notPresent) { if (person.EmpName.ToString().Trim() != "NaN") { MeetingMembers meetingmembers = new MeetingMembers(); Event meetingevent = new Event(); if (person.EmpName.ToString().Trim() == "NaN") { meetingmembers.EmpName = "NEW"; meetingevent.Name = "New"; } else { meetingmembers.EmpName = person.EmpName; meetingevent.Name = person.EmpName; } meetingmembers.PersonId = person.PersonId; if (person.Department.ToString().Trim() == "NaN") { meetingmembers.Department = "NEW"; } else { meetingmembers.Department = person.Department; } meetingmembers.Gender = person.Gender; if (person.Smile == "Sad") { meetingmembers.Smiley = "Smiley1.png"; meetingevent.Emoction = "Smiley1.png"; } else if (person.Smile == "Smile") { meetingmembers.Smiley = "Smiley.png"; meetingevent.Emoction = "Smiley.png"; } else { meetingmembers.Smiley = "Smiley.png"; meetingevent.Emoction = "Smiley.png"; } meetingmembers.ImagePath = GlobalSettings.MemberEndpoint.ToString() + person.BlobName; meetingevent.ImagePath = meetingmembers.ImagePath; meetingmembers.Attendence = "On.png"; meetingevent.Attendence = "On.png"; meetingevent.Title = "Title"; meetingevent.Email = "*****@*****.**"; meetingevent.PhoneNumber = "123"; meetingevent.Venue = new Venue { Name = "Venue" }; newEvent.Add(meetingevent); NewMember.Add(meetingmembers); } } Members = NewMember; Events = newEvent; } } } } catch (Exception ex) when(ex is WebException || ex is HttpRequestException) { await DialogService.ShowAlertAsync("Communication error", "Error", "Ok"); } catch (Exception ex) { Debug.WriteLine($"Error loading data in: {ex}"); } IsBusy = false; }
private void ChangePinLock(object obj) { DialogService.ShowPinLockDialog(true, this); }
protected async System.Threading.Tasks.Task Login0Register() { DialogService.Open <RegisterApplicationUser>("Register Application User", null); }
protected async System.Threading.Tasks.Task Grid0RowSelect(Bssr.Models.Bssr4.TblPresmetkovniEdinici args) { var dialogResult = await DialogService.OpenAsync <EditTblPresmetkovniEdinici>("Edit Tbl Presmetkovni Edinici", new Dictionary <string, object>() { { "ID", args.ID } }); await InvokeAsync(() => { StateHasChanged(); }); }
protected async void Grid0RowSelect(Employee args) { var result = await DialogService.OpenAsync <EditEmployee>("Edit Employee", new Dictionary <string, object>() { { "EmployeeID", $"{args.EmployeeID}" } }); await Invoke(() => { StateHasChanged(); }); }
protected async System.Threading.Tasks.Task Button2Click(MouseEventArgs args) { DialogService.Close(null); }
protected async System.Threading.Tasks.Task Grid0RowSelect(CanErp2.Models.DbAtVdc2.TblGnDepartment args) { var result = await DialogService.OpenAsync <EditTblGnDepartment>("Edit Tbl Gn Department", new Dictionary <string, object>() { { "Department_ID", args.Department_ID } }); await InvokeAsync(() => { StateHasChanged(); }); }
/// <summary> /// metodo para modificar la contraseña /// </summary> private async void modificar() { //Incializamos los servicios de dialog. DialogService dialog = new DialogService(); //Declaramos un objeto de tipo MetroDialogSettings al cual le asignamos las propiedades que contendra el mensaje modal. MetroDialogSettings setting = new MetroDialogSettings(); setting.AffirmativeButtonText = StringResources.lblYes; setting.NegativeButtonText = StringResources.lblNo; //Ejecutamos el método para mostrar el mensaje. El resultado lo asignamos a una variable local. MessageDialogResult result = await dialog.SendMessage(StringResources.ttlAlerta, StringResources.msgConfirmacion, setting, MessageDialogStyle.AffirmativeAndNegative); if (result == MessageDialogResult.Affirmative) { //mandamos llamar el metodo que valida que ningun campo este vacio if (Valida()) { if (confimarContraseña.Length >= 6 && _contraseñaActual.Length >= 6 && nuevaContraseña.Length >= 6) { string pass = encriptar.desencript(DataManagerControlDocumentos.GetPass(user.NombreUsuario)); if (pass.Equals(_contraseñaActual)) { if (nuevaContraseña.Equals(confimarContraseña)) { string passEncrip = encriptar.encript(nuevaContraseña); int update = DataManagerControlDocumentos.UpdatePass(user.NombreUsuario, passEncrip); if (update != 0) { await dialog.SendMessage(StringResources.ttlAlerta, StringResources.msgContraseñaModificada); } else { await dialog.SendMessage(StringResources.ttlAlerta, StringResources.msgContraseñaModificadaError); } } else { await dialog.SendMessage(StringResources.ttlAlerta, StringResources.msgContraseñaDiferente); } } else { await dialog.SendMessage(StringResources.ttlAlerta, StringResources.msgContraseñaActualDiferente); } } else { await dialog.SendMessage(StringResources.ttlAlerta, StringResources.msgContraseñaCorta); } } else { await dialog.SendMessage(StringResources.ttlAlerta, StringResources.msgFillFlields); } } }
private void ResetWorldAndDestroyPopUp() { if (dialogService == null) return; if (applicationBar != null) { dialogService.Page.ApplicationBar = applicationBar; } dialogService.Child = null; dialogService = null; }
/* * public string firstName { get; set; } * public string lastName { get; set; } * public string email { get; set; } * public bool enabled { get; set; } * public long defaultClientId { get; set; } * public Role role { get; set; } * public DateTime? birthDate { get; set; } * public string fiscalCode { get; set; } * public string companyName { get; set; } * public string stateOfBirth { get; set; } * public string provinceOfBirth { get; set; } * public string placeOfBirth { get; set; } * public string cellPhone { get; set; } * public string companyRole { get; set; } * public string companyAddress { get; set; } * public string companyCity { get; set; } */ #endregion #region Constructors public User() { dialogService = new DialogService(); }
public MainViewModel(DialogService dialogService, ICacheService cacheService) { _dialogService = dialogService; _cacheService = cacheService; CurrentPage = new PageTransition(); HomeView homeView = new HomeView(); CurrentPage.ShowPage(homeView); Task.Run(async () => { List<string> folders = await _cacheService.GetFoldersAsync(); Folders = new ObservableCollection<string>(folders); }); }
public void Save() { DialogService.Close(DialogResult <Item> .Ok(Item)); }