public async Task DashBoard_VerifyWebViewNavigation_Pass() { ////Arrange DashboardPageViewModel vm; var key = SetupHelper.CreateFakeKeyChain(this.container); var navigationService = this.container.Resolve <INavigationService>(); vm = new DashboardPageViewModel( this.container.Resolve <IPageDialogService>(), this.container.Resolve <IAuthenticationFacade>(), this.container.Resolve <SettingsFacade>(), navigationService, this.container.Resolve <IPropertyFacade>(), this.container.Resolve <IStoryFacade>(), key); await Task.Delay(2000); vm.ImageTapCommand.Execute("abcd"); var navigation = navigationService as NavigationServiceMock; Assert.NotNull(navigation); var navUrl = navigation.LastNavigationUrl; //Assert Assert.Equal(navUrl, "EventsDetailsPage"); }
/// <summary> /// ctor(). /// </summary> public DashboardPage() { InitializeComponent(); SlideMenu = new SideMenuView(); BindingContext = _viewModel = new DashboardPageViewModel(); SfChart chart = new SfChart(); DoughnutSeries doughnutSeries = new DoughnutSeries() { ItemsSource = _viewModel.ChartData, XBindingPath = "Name", YBindingPath = "Value", DoughnutCoefficient = 0.7, ExplodeIndex = 0, }; List <Color> colors = new List <Color>() { Color.FromHex("#82DA69"), Color.FromHex("#E47132"), Color.FromHex("#9EE5FC"), }; doughnutSeries.ColorModel.Palette = ChartColorPalette.Custom; doughnutSeries.ColorModel.CustomBrushes = colors; chart.WidthRequest = 180; chart.HeightRequest = 180; chart.Series.Add(doughnutSeries); chart.Title.TextColor = Color.FromHex("#cccccc"); chart.HorizontalOptions = LayoutOptions.Center; chart.VerticalOptions = LayoutOptions.Center; chart.BackgroundColor = Color.Transparent; ChartGrid.Children.Add(chart); StackLayout MiddleStack = new StackLayout() { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, BackgroundColor = Color.Transparent }; Label MiddleText1 = new Label() { Text = "23%", FontSize = 20, FontAttributes = FontAttributes.Bold }; Label MiddleText2 = new Label() { Text = "mobile", FontSize = 10, FontAttributes = FontAttributes.Bold }; MiddleStack.Children.Add(MiddleText1); MiddleStack.Children.Add(MiddleText2); ChartGrid.Children.Add(MiddleStack); }
public DashboardPage() { InitializeComponent(); viewModel = new DashboardPageViewModel(Navigation); this.BindingContext = viewModel; }
protected async override void OnAppearing() { //Load states base.OnAppearing(); DashboardPageViewModel dashboardPageViewModel = new DashboardPageViewModel(); await dashboardPageViewModel.GetCommonUserDetails(); UserSection = await dashboardPageViewModel.GetCommonUserDetails(); PositionsListItems.ItemsSource = UserSection.data; //foreach (var item in UserSection) //{ // PositionsListItems.ItemsSource = item.data; //} }
private static void InitializeApplicationViewModelsAndLaunch() { var main = new MainWindow(); Current.MainWindow = main; Action <string, string> exec = (s, s1) => { formulaireBaseViewModel = FormulaireBaseViewModel.Instance; usersListFormViewModel = UsersListFormViewModel.Instance; medecinAppelantsListFormViewModel = MedecinAppelantsListFormViewModel.Instance; dossiersListFormViewModel = DossiersListFormViewModel.Instance; dashboardPageViewModel = DashboardPageViewModel.Instance; //Attention: Ne pas appeler le ChartsListFormViewModel qui update la vue directement. dossiersListFormViewModel.SynchroneUpdateList(); usersListFormViewModel.SynchroneUpdateList(); medecinAppelantsListFormViewModel.SynchroneUpdateList(); }; var progressWindow = new ProgressWindow(); progressWindow.SetTitle("Chargement en cours"); var backgroundWorker = new BackgroundWorker(); // set the worker to call your long-running method backgroundWorker.DoWork += (object sender, DoWorkEventArgs e) => { exec.Invoke("path", "parameters"); }; // set the worker to close your progress form when it's completed backgroundWorker.RunWorkerCompleted += (object sender, RunWorkerCompletedEventArgs e) => { progressWindow.Close(); main.Show(); MainWindowViewModel.Instance.OpenDashboardPageCommand.Execute(null); }; progressWindow.Show(); backgroundWorker.RunWorkerAsync(); }
public async Task DashBoard_TabSelectionEvents_Pass() { ////Arrange DashboardPageViewModel vm; var key = SetupHelper.CreateFakeKeyChain(this.container); vm = new DashboardPageViewModel( this.container.Resolve <IPageDialogService>(), this.container.Resolve <IAuthenticationFacade>(), this.container.Resolve <SettingsFacade>(), this.container.Resolve <INavigationService>(), this.container.Resolve <IPropertyFacade>(), this.container.Resolve <IStoryFacade>(), key); await Task.Delay(2000); vm.TableSelectionCommand.Execute("Events"); //Assert Assert.Equal(2, vm.ActiveTabData.Count); }
public async Task DashBoard_ShouldCheckIfTheDataHasBeenLoaded_Pass() { ////Arrange DashboardPageViewModel vm; var key = SetupHelper.CreateFakeKeyChain(this.container); vm = new DashboardPageViewModel( this.container.Resolve <IPageDialogService>(), this.container.Resolve <IAuthenticationFacade>(), this.container.Resolve <SettingsFacade>(), this.container.Resolve <INavigationService>(), this.container.Resolve <IPropertyFacade>(), this.container.Resolve <IStoryFacade>(), key); await Task.Delay(2000); //Assert Assert.Equal(vm.Offers.Title, "Fine Dining at Maze Grill"); Assert.Equal(24, vm.Properties.Count); Assert.Equal(4, vm.Communities.Count); Assert.Equal(2, vm.Events.Count); }
public DashboardPage() { InitializeComponent(); BindingContext = new DashboardPageViewModel(); }
public DashboardPage() { InitializeComponent(); NavigationPage.SetBackButtonTitle(this, ""); BindingContext = viewModel = new DashboardPageViewModel(this.Navigation); }