Exemplo n.º 1
0
		public ImageLoadingGallery ()
		{
			Padding = new Thickness (20);

			var source = new UriImageSource {
				Uri = new Uri ("http://www.nasa.gov/sites/default/files/styles/1600x1200_autoletterbox/public/images/298773main_EC02-0282-3_full.jpg"),
				CachingEnabled = false
			};

			var image = new Image {
				Source = source,
				WidthRequest = 200,
				HeightRequest = 200,
			};

			var indicator = new ActivityIndicator {Color = new Color (.5),};
			indicator.SetBinding (ActivityIndicator.IsRunningProperty, "IsLoading");
			indicator.BindingContext = image;

			var grid = new Grid();
			grid.RowDefinitions.Add (new RowDefinition());
			grid.RowDefinitions.Add (new RowDefinition());

			grid.Children.Add (image);
			grid.Children.Add (indicator);

			var cancel = new Button { Text = "Cancel" };
			cancel.Clicked += (s, e) => source.Cancel();
			Grid.SetRow (cancel, 1);
			grid.Children.Add (cancel);

			Content = grid;
		}
        public TeamsView()
        {
            BindingContext = new TeamsViewModel();

            var stack = new StackLayout {
                Orientation = StackOrientation.Vertical,
                Padding     = new Thickness(0, 0, 0, 8)
            };

            var activity = new ActivityIndicator {
                Color     = Helpers.Color.Greenish.ToFormsColor(),
                IsEnabled = true
            };

            activity.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
            activity.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");

            stack.Children.Add(activity);
            var searchBar = new SearchBar();

            searchBar.TextChanged += (sender, e) => {
                ViewModel.FilterTeams(searchBar.Text);
            };
            var listView = new ListView();

            listView.ItemsSource = ViewModel.Teams;
            var cell = new DataTemplate(typeof(HorizontalListTextCell));

            cell.SetBinding(ImageCell.TextProperty, "Name");
            cell.SetBinding(ImageCell.DetailProperty, "Abbreviation");
            //            cell.SetBinding(ImageCell.ImageSourceProperty, "");

            listView.ItemTapped += (sender, args) => {
                if (listView.SelectedItem == null)
                {
                    return;
                }
                this.Navigation.PushAsync(new TeamDetailView(listView.SelectedItem as Team));
                listView.SelectedItem = null;
            };

            listView.ItemTemplate = cell;
            stack.Children.Add(searchBar);
            stack.Children.Add(listView);

            Content = stack;
        }
Exemplo n.º 3
0
        public ContactPage()
        {
            resultsLabel = new Label
            {
                Text            = "Result will appear here.",
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            //searchbar to search banks contacts that are available
            searchBar = new SearchBar
            {
                Placeholder   = "Enter full_name of bank",
                SearchCommand = new Command(() => { resultsLabel.Text = "Result: " + searchBar.Text + " here you go"; })
            };

            ActivityIndicator indicator = new ActivityIndicator()
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Center,
                IsRunning         = true,
                IsVisible         = true
            };

            indicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
            indicator.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");

            Task.WhenAll(Takingcareofbussiness());

            //Layout of the Contact Page, containig its title, image and final layout of the page
            Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
            Title   = "ContactPage";
            Icon    = new FileImageSource {
                File = "robot.png"
            };
            NavigationPage.SetBackButtonTitle(this, "go back");
            Content = new StackLayout
            {
                BackgroundColor = Color.Teal,
                Children        =
                {
                    new Label {
                        Text = "Getting the contact information", HorizontalTextAlignment = TextAlignment.Center, VerticalOptions = LayoutOptions.Center
                    },
                    indicator
                }
            };
        }
        private async Task InitializeDataAsync()
        {
            sesionService         = new SesionService();
            conversacionesService = new ConversacionesService();
            int idUsuario = await sesionService.GetSesionIdUserDbAsync();

            if (idUsuario != 0)
            {
                ai = new ActivityIndicator();
                ai.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
                ai.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
                stackLayout.Children.Add(ai);
                IsBusy = true;
                contentpage.Content = stackLayout;
                var listaTemp = await conversacionesService.GetConversacionesAsync(idUsuario);

                gruposOC = new ObservableCollection <Grupo>();

                listView.RowHeight    = 75;
                listView.ItemTemplate = new DataTemplate(typeof(CustomFriendsCell));
                foreach (var usuario in listaTemp)
                {
                    /*if (usuario.foto == null)
                     * {
                     *  usuario.foto = "photo.png";
                     * }
                     * else
                     * {
                     *  if (usuario.foto.Contains("https:"))
                     *  {
                     *
                     *  }
                     *  else
                     *  {
                     *      usuario.foto = "http://www.palmapplicationsv.com/techoapp/public/" + usuario.foto;
                     *  }
                     * }*/
                    gruposOC.Add(usuario);
                }
                listView.ItemsSource            = gruposOC;
                listView.IsPullToRefreshEnabled = true;
                listView.SetBinding(ListView.RefreshCommandProperty, new Binding("RefreshCommand"));
                listView.ItemTapped += ListView_ItemTapped;
                stackLayout.Children.Add(listView);
                IsBusy = false;
            }
        }
        public ActivityStatusPage()
        {
            try
            {
                datePicker.DateSelected += async(sender, e) =>
                {
                    Device.BeginInvokeOnMainThread((async() => { await CreateDisplay(e.NewDate); }));
                };
                var mainGrid = new ExGrid();
                exPickersValue.Add(0, "Yapılmadı");
                exPickersValue.Add(1, "Yapıldı");
                var scrollView = new ScrollView();
                var bodyGrid   = new ExGrid()
                {
                    Padding = new Thickness(15, 15, 15, 15)
                };
                this.Title = "Günlük Aktivite İlerlemelerim";
                var activityIndicatorLabel = new ExLabel
                {
                    Text      = "Günlük aktivite durumları getiriliyor...",
                    TextColor = Color.Black
                };
                var activityIndicatorExFrame = new ExFrame()
                {
                    CornerRadius      = 10,
                    VerticalOptions   = LayoutOptions.CenterAndExpand,
                    HorizontalOptions = LayoutOptions.Center,
                    BackgroundColor   = Color.LightGray
                };

                var activityIndicator = new ActivityIndicator()
                {
                    Color = Color.DarkRed
                };
                activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy", source: this));
                var activityIndicatorStackLayout = new ExStackLayout()
                {
                    VerticalOptions   = LayoutOptions.Center,
                    HorizontalOptions = LayoutOptions.Center
                };
                activityIndicatorStackLayout.Children.Add(activityIndicatorLabel);
                activityIndicatorStackLayout.Children.Add(activityIndicator);
                activityIndicatorExFrame.Content = activityIndicatorStackLayout;
                activityIndicatorExFrame.SetBinding(Frame.IsVisibleProperty, new Binding("IsBusy", source: this));
                bodyGrid.Children.Add(mainExStackLayout);
                scrollView.Content = bodyGrid;
                mainGrid.Children.Add(activityIndicatorExFrame);
                mainGrid.Children.Add(scrollView);
                Content = mainGrid;
                Device.BeginInvokeOnMainThread((async() =>
                {
                    await CreateDisplay(DateTime.Today);
                }));
            }
            catch (Exception e)
            {
                DisplayAlert("Hata", e.Message, "Tamam");
            }
        }
Exemplo n.º 6
0
        public ListaHojasCalculoGoogle(SpreadsheetsService servicio, string linkLibro)
        {
            InitializeComponent();
            Cabecera.Children.Add(App.Instancia.ObtenerImagen(TipoImagen.EncabezadoProyectos));
            SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado);
            _servicio  = servicio;
            _linkLibro = linkLibro;

            _indicadorActividad = new ActivityIndicator
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                IsEnabled       = true,
                BindingContext  = this
            };
            _indicadorActividad.SetBinding(IsVisibleProperty, "IsBusy");
            _indicadorActividad.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
        }
        public ListaLibrosGoogle(string tokenDeAcceso)
        {
            InitializeComponent();
            SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado);

            _servicioGoogle = new ServiciosGoogle();
            _servicio       = _servicioGoogle.ObtenerServicioParaConsultaGoogleSpreadsheets(tokenDeAcceso);

            _indicadorActividad = new ActivityIndicator
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                IsEnabled       = true,
                BindingContext  = this
            };
            _indicadorActividad.SetBinding(IsVisibleProperty, "IsBusy");
            _indicadorActividad.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
        }
Exemplo n.º 8
0
        public void showLoading()
        {
            var containerPage = Application.Current.MainPage;

            var indicator = new ActivityIndicator()
            {
                Color = Color.Blue,
            };

            indicator.SetBinding(VisualElement.IsVisibleProperty, new Binding("IsBusy", BindingMode.OneWay, source: containerPage));
            indicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy", BindingMode.OneWay, source: containerPage));
            AbsoluteLayout.SetLayoutFlags(indicator, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(indicator, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            mainLayout.Children.Add(indicator);

            containerPage.IsBusy = true;
        }
Exemplo n.º 9
0
        public SeleccionColumnasParaVer(SpreadsheetsService servicio)
        {
            InitializeComponent();
            Cabecera.Children.Add(App.Instancia.ObtenerImagen(TipoImagen.EncabezadoProyectos));
            SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado);
            ConfigurarBotones();
            _servicio = servicio;

            _indicadorActividad = new ActivityIndicator
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                IsEnabled       = true,
                BindingContext  = this
            };
            _indicadorActividad.SetBinding(IsVisibleProperty, "IsBusy");
            _indicadorActividad.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
        }
Exemplo n.º 10
0
        private void InicializarValoresGenerales()
        {
            SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado);

            var columnasInventario = CuentaUsuario.ObtenerColumnasInventario();

            _listaColumnasInventario = !string.IsNullOrEmpty(columnasInventario) ? columnasInventario.Split(',') : null;

            _indicadorActividad = new ActivityIndicator
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                IsEnabled       = true,
                BindingContext  = this
            };
            _indicadorActividad.SetBinding(IsVisibleProperty, "IsBusy");
            _indicadorActividad.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
        }
Exemplo n.º 11
0
        private void InicializarValoresGenerales(string titulo)
        {
            _esGoogle    = CuentaUsuario.ObtenerAccesoDatos() == "G";
            Titulo.Text += " " + titulo.Replace("App", "").Replace("es ", " ").Replace("s ", " ");
            Cabecera.Children.Add(App.Instancia.ObtenerImagen(TipoImagen.EncabezadoProductores));
            SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado);

            ConfigurarBotones();

            _indicadorActividad = new ActivityIndicator
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                IsEnabled       = true,
                BindingContext  = this
            };
            _indicadorActividad.SetBinding(IsVisibleProperty, "IsBusy");
            _indicadorActividad.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
        }
Exemplo n.º 12
0
        public SignInPage()
        {
            client = new HttpClient();
            this.BindingContext = this;

            InitializeComponent();

            var indicator = new ActivityIndicator()
            {
                Color = Color.Black
            };

            indicator.SetBinding(VisualElement.IsVisibleProperty, new Binding("IsBusy", BindingMode.OneWay, source: this));
            indicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy", BindingMode.OneWay, source: this));
            AbsoluteLayout.SetLayoutFlags(indicator, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(indicator, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            absoluteLayout.Children.Add(indicator);
        }
Exemplo n.º 13
0
        public CustomersPage()
        {
            #region customer list activity inidicator
            ActivityIndicator customerListActivityIndicator = new ActivityIndicator()
            {
                HeightRequest = Sizes.MediumRowHeight
            };
            customerListActivityIndicator.SetBinding(IsEnabledProperty, "IsBusy");
            customerListActivityIndicator.SetBinding(IsVisibleProperty, "IsBusy");
            customerListActivityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
            #endregion

            #region customer list
            CustomerListView customerListView = new CustomerListView();
            customerListView.SetBinding(CustomerListView.ItemsSourceProperty, "Accounts");
            customerListView.SetBinding(IsEnabledProperty, "IsBusy", converter: new InverseBooleanConverter());
            customerListView.SetBinding(IsVisibleProperty, "IsBusy", converter: new InverseBooleanConverter());

            customerListView.ItemTapped += async(sender, e) =>
            {
                Account account = (Account)e.Item;
                await PushTabbedPage(account);
            };
            #endregion

            #region compose view hierarchy
            Content = new UnspacedStackLayout()
            {
                Children =
                {
                    customerListActivityIndicator,
                    customerListView
                },
                Padding = Device.OnPlatform(Thicknesses.IosStatusBar, Thicknesses.Empty, Thicknesses.Empty)
            };
            #endregion

            #region wire up MessagingCenter
            // Catch the login success message from the MessagingCenter.
            // This is really only here for Android, which doesn't fire the OnAppearing() method in the same way that iOS does (every time the page appears on screen).
            Device.OnPlatform(Android: () => MessagingCenter.Subscribe <CustomersPage>(this, MessagingServiceConstants.AUTHENTICATED, sender => OnAppearing()));
            #endregion
        }
Exemplo n.º 14
0
        public ListPage()
        {
            _viewModel     = new ListViewModel();
            BindingContext = _viewModel;

            var loadingAzureDataActivityIndicator = new ActivityIndicator
            {
                AutomationId = AutomationIdConstants.LoadingDataFromBackendActivityIndicator,
                Color        = Color.White
            };

            loadingAzureDataActivityIndicator.SetBinding <ListViewModel>(IsVisibleProperty, vm => vm.IsDataLoading);
            loadingAzureDataActivityIndicator.SetBinding <ListViewModel>(ActivityIndicator.IsRunningProperty, vm => vm.IsDataLoading);

            _listView = new ListView(ListViewCachingStrategy.RetainElement)
            {
                //ToDo Change to ListViewCachingStrategy.RecycleElement once this bug has been fixed https://bugzilla.xamarin.com/show_bug.cgi?id=42678
                ItemTemplate           = new DataTemplate(typeof(WhiteTextImageCell)),
                BackgroundColor        = Color.FromHex("#2980b9"),
                IsPullToRefreshEnabled = true
            };
            _listView.SetBinding <ListViewModel>(ListView.ItemsSourceProperty, vm => vm.DataList);
            _listView.SetBinding <ListViewModel>(ListView.RefreshCommandProperty, vm => vm.PullToRefreshCommand);

            Title = "List Page";

            var relativeLayout = new RelativeLayout();

            Func <RelativeLayout, double> getloadingAzureDataActivityIndicatorWidth  = (p) => loadingAzureDataActivityIndicator.Measure(relativeLayout.Width, relativeLayout.Height).Request.Width;
            Func <RelativeLayout, double> getloadingAzureDataActivityIndicatorHeight = (p) => loadingAzureDataActivityIndicator.Measure(relativeLayout.Width, relativeLayout.Height).Request.Height;

            relativeLayout.Children.Add(_listView,
                                        Constraint.Constant(0),
                                        Constraint.Constant(0),
                                        Constraint.RelativeToParent(parent => parent.Width),
                                        Constraint.RelativeToParent(parent => parent.Height)
                                        );
            relativeLayout.Children.Add(loadingAzureDataActivityIndicator,
                                        Constraint.RelativeToParent((parent) => parent.Width / 2 - getloadingAzureDataActivityIndicatorWidth(parent) / 2),
                                        Constraint.RelativeToParent((parent) => parent.Height / 2 - getloadingAzureDataActivityIndicatorHeight(parent) / 2)
                                        );
            Content = relativeLayout;
        }
        public NuevoPedido(SpreadsheetsService servicio, List <Clases.Pedido> listaPedidos)
        {
            InitializeComponent();
            _servicioGoogle = new ServiciosGoogle();
            _servicio       = servicio;
            ObtenerDatosClientesDesdeHCG();
            _listaProducto = new ObservableCollection <DetallePedido>();
            _listaPedidos  = listaPedidos;

            _indicadorActividad = new ActivityIndicator
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                IsEnabled       = true,
                BindingContext  = this
            };
            _indicadorActividad.SetBinding(IsVisibleProperty, "IsBusy");
            _indicadorActividad.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
            ContenedorPedido.Children.Add(_indicadorActividad);
        }
Exemplo n.º 16
0
        private void InitListView()
        {
            var bindingContext = BindingContext as IncrementalViewModel;

            IncrementalListView listView = new IncrementalListView(ListViewCachingStrategy.RecycleElement);

            listView.ItemsSource  = bindingContext.MyItems;
            listView.PreloadCount = 5;
            //listView.RowHeight = 88;
            listView.ItemTemplate = new DataTemplate(() => CreateListViewDataTemplate());
            ActivityIndicator activityIndicator = new ActivityIndicator();

            activityIndicator.Margin = 20;
            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, nameof(bindingContext.IsLoadingIncrementally));
            activityIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, nameof(bindingContext.IsLoadingIncrementally));
            listView.Footer = activityIndicator;

            layout.Children.Add(listView);
        }
Exemplo n.º 17
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            var layout = this.Content as Layout <View>;

            if (layout != null && ActivityIndicator == null)
            {
                ActivityIndicator = new ActivityIndicator();
                if (IncludeActivityIndicator)
                {
                    ActivityIndicator.IsRunning         = true;
                    ActivityIndicator.HorizontalOptions = LayoutOptions.CenterAndExpand;
                    ActivityIndicator.VerticalOptions   = LayoutOptions.CenterAndExpand;
                    ActivityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy"));
                    ActivityIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, new Binding("IsBusy"));
                    ActivityIndicator.BackgroundColor = Color.White;
                    layout.Children.Add(ActivityIndicator);
                }
            }
        }
Exemplo n.º 18
0
#pragma warning restore CA1056 // URI-like properties should not be strings


        public WebviewDialog()
        {
            _indicator = new ActivityIndicator()
            {
                VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.Fill
            };
            _indicator.BindingContext = this;
            _indicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");

            _hybridWebView = new HybridWebView()
            {
                HeightRequest = 400
            };

            _hybridWebView.Navigating += (sender, e) => { IsBusy = true; };
            _hybridWebView.Navigated  += (sender, e) => { IsBusy = false; };


            Button retButton = new Button
            {
                Text = "返回"
            };

            retButton.Clicked += (sender, e) =>
            {
                NavigationService.Current.PopModal();
            };


            StackLayout stackLayout = new StackLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,

                Children = { _hybridWebView, retButton }
            };

            AbsoluteLayout.SetLayoutBounds(stackLayout, new Rectangle(0, 0, 1, 1));
            AbsoluteLayout.SetLayoutFlags(stackLayout, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(_indicator, new Rectangle(0.5, 0.5, -1, -1));
            AbsoluteLayout.SetLayoutFlags(_indicator, AbsoluteLayoutFlags.PositionProportional);

            Content = new AbsoluteLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Children          =
                {
                    stackLayout,
                    _indicator
                }
            };
        }
Exemplo n.º 19
0
        private void InitializeUIView()
        {
            var activityIndicator = new ActivityIndicator();

            activityIndicator.SetBinding(IsVisibleProperty, new Binding("IsBusy", BindingMode.TwoWay, null, null, null, null));
            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy", BindingMode.TwoWay, null, null, null, null));
            activityIndicator.HorizontalOptions = LayoutOptions.Center;
            activityIndicator.VerticalOptions   = LayoutOptions.Center;
            stackLayout.Children.Add(activityIndicator);
            var listview = new ListView(ListViewCachingStrategy.RecycleElement)
            {
                ItemTemplate = new DataTemplate(listTemplate)
            };

            listview.SetBinding(ListView.ItemsSourceProperty, new Binding("FileList", BindingMode.TwoWay, null, null, null, null));
            listview.RowHeight = 120;
            listview.IsPullToRefreshEnabled = true;
            listview.ItemSelected          += Listview_ItemSelected;
            stackLayout.Children.Add(listview);
        }
        private void InicializarValoresGenerales()
        {
            Cabecera.Children.Add(App.Instancia.ObtenerImagen(TipoImagen.EncabezadoProductores));
            SombraEncabezado.Source = ImageSource.FromResource(App.RutaImagenSombraEncabezado);
            ConfigurarBotones();

            if (_productoString.Length > 1)
            {
                Titulo.Text += " " + _productoString[1];
            }

            _indicadorActividad = new ActivityIndicator
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                IsEnabled       = true,
                BindingContext  = this
            };
            _indicadorActividad.SetBinding(IsVisibleProperty, "IsBusy");
            _indicadorActividad.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
        }
        public PreloaderListFooter()
        {
            var layout   = new AbsoluteLayout();
            var activity = new ActivityIndicator();

            activity.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsLoading"));
            layout.SetBinding(IsVisibleProperty, new Binding("IsLoading"));

            layout.Children.Add(activity, new Rectangle(.5, .5, 45, 45), AbsoluteLayoutFlags.PositionProportional);
            Children.Add(layout, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.SizeProportional);
        }
        public BeerListView()
        {
            // you need a view model to bind to

            // setup your ViewModel

            ViewModel = new BeerListViewViewModel
            {
            };
            // Set the binding context to the newly created ViewModel
            BindingContext = ViewModel;

            listView = new ListView {
//				HasUnevenRows = true
            };

            //need to add a Details Push Event on the ITemSelected here when working done
            listView.ItemSelected += (sender, e) => {
                Navigation.PushAsync(new BeerDetail(e.SelectedItem as Beer));
            };

            var activityIndicator = new ActivityIndicator
            {
                Color = Color.Black,
            };

            activityIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");


            this.Title   = "All our Beers on Tap";
            this.Content = new StackLayout {
                Padding     = new Thickness(0, Device.OnPlatform(0, 0, 0), 0, 0),
                Spacing     = 3,
                Orientation = StackOrientation.Vertical,
                Children    =
                {
                    activityIndicator, listView
                }
            };
        }
Exemplo n.º 23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ViewDecorator"/> class.
        /// </summary>
        /// <param name="relativeLayout">Relative layout.</param>
        /// <param name="contents">Contents.</param>
        public ViewDecorator(RelativeLayout relativeLayout, View contents)
        {
            // Add contents
            relativeLayout.Children.Add(contents, () => relativeLayout.Bounds);

            // Create overlay
            var activityIndicatorOverlay = new RelativeLayout {
                BackgroundColor = Color.FromRgba(0x05, 0x05, 0x05, 0.75)
            };

            activityIndicatorOverlay.SetBinding(RelativeLayout.IsVisibleProperty,
                                                PropertyNameHelper.GetPropertyName <TViewModel>((vm) => vm.IsBusy));

            relativeLayout.Children.Add(activityIndicatorOverlay, () => relativeLayout.Bounds);

            // Create darker rectangle in the middle
            var activityIndicatorBackground = new RoundedBorderControl {
                BackgroundColor = Color.FromRgba(0, 0, 0, 0.78),
                CornerRadius    = 8,
            };

            activityIndicatorOverlay.Children.Add(activityIndicatorBackground, () =>
                                                  new Rectangle(activityIndicatorOverlay.Width / 2 - 81, activityIndicatorOverlay.Height / 2 - 41, 81 * 2, 82));

            // Create indicator
            var activityIndicator = new ActivityIndicator {
                Color = Color.White
            };

            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty,
                                         PropertyNameHelper.GetPropertyName <TViewModel>((vm) => vm.IsBusy));

            activityIndicatorOverlay.Children.Add(activityIndicator, () =>
                                                  new Rectangle(activityIndicatorOverlay.Width / 2 - 16, activityIndicatorOverlay.Height / 2 - 24, 32, 32));

            // Create label with progress text
            var activityLabel = new Label {
                TextColor       = Color.White,
                BackgroundColor = Color.Transparent,
                FontSize        = 12,
                XAlign          = TextAlignment.Center
            };

            activityLabel.SetBinding(Label.TextProperty,
                                     PropertyNameHelper.GetPropertyName <TViewModel>((vm) => vm.IsBusyText));

            activityLabel.SetBinding(Label.IsVisibleProperty,
                                     PropertyNameHelper.GetPropertyName <TViewModel>((vm) => vm.IsBusyTextVisible));

            activityIndicatorOverlay.Children.Add(activityLabel, () =>
                                                  new Rectangle(activityIndicatorOverlay.X, activityIndicatorOverlay.Height / 2 + 14,
                                                                activityIndicatorOverlay.Width, 32));
        }
Exemplo n.º 24
0
        public ActivityLayoutTemplate()
        {
            var contentPresenter = new ContentPresenter();

            Children.Add(contentPresenter);

            // Create the Activity Indicator
            var activityIndicator = new ActivityIndicator();

            activityIndicator.SetBinding(VisualProperty, new TemplateBinding("IndicatorVisual"));
            activityIndicator.SetBinding(ActivityIndicator.ColorProperty, new TemplateBinding("IndicatorColor"));
            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new TemplateBinding("BindingContext.IsProcessing"));

            // Create the container for the activity indicator
            var activityIndicatorContainer = new Grid();

            activityIndicatorContainer.SetBinding(BackgroundColorProperty, new TemplateBinding("FadedBackgroundColor"));
            activityIndicatorContainer.SetBinding(IsVisibleProperty, new TemplateBinding("BindingContext.IsProcessing"));
            activityIndicatorContainer.Children.Add(activityIndicator);
            Children.Add(activityIndicatorContainer);
        }
Exemplo n.º 25
0
        public AuthorArticlePage(string title, AuthorDataType authorDataType)
        {
            Title = title;
            NavigationPage.SetHasNavigationBar(this, true);
            NavigationPage.SetHasBackButton(this, true);
            NavigationPage.SetBackButtonTitle(this, "Profile");
            authorDataViewModel = new AuthorDataViewModel(authorDataType);
            authorDataViewModel.GetAuthorDataCommand.Execute(null);
            var activityIndicator = new ActivityIndicator
            {
                Color = Color.Gray,
            };

            activityIndicator.SetBinding(IsVisibleProperty, "IsBusy");
            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
            var authorArticlelist = new ListView
            {
                HasUnevenRows   = false,
                ItemTemplate    = new DataTemplate(typeof(CPListCell)),
                ItemsSource     = authorDataViewModel.AutorItems,
                BackgroundColor = Color.White,
                RowHeight       = 120,
            };

            Content = new StackLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                BackgroundColor   = Color.White,
                Children          = { authorArticlelist }
            };

            authorArticlelist.ItemSelected += (sender, e) =>
            {
                var selectedObject = e.SelectedItem as CPMobile.Models.Item;

                var WebViewPage = new WebViewPage(title, selectedObject.websiteLink.HttpUrlFix());
                Navigation.PushAsync(WebViewPage);
            };
        }
Exemplo n.º 26
0
        StackLayout BalanceLeaveLayout()
        {
            BindingContext = new EmployeeViewModel();
            var activity = new ActivityIndicator
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Color             = Color.White.ToFormsColor(),
                //IsEnabled = true
            };

            activity.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
            activity.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");

            ViewModel.LoadAllEmployees.Execute(null);
            ViewModel.LoadHolidayDetail.Execute(null);
            listView = new iiListView()
            {
                ItemTemplate = new DataTemplate(typeof(EmployeeViewCell)),
                ClassId      = "2"
            };
            var listStack = new StackLayout
            {
                Padding  = new Thickness(50, 0, 50, 0),
                Children = { listView }
            };
            var BalanceLeaveTabView = new StackLayout
            {
                // HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding = new Thickness(20, 0, 20, 10),
                //Spacing = 20,
                Children =
                {
                    activity,
                    listStack,
                    GenCalGrid(),
                }
            };

            return(BalanceLeaveTabView);
        }
Exemplo n.º 27
0
        public ForumDetailListPage(string name, int forumId)
        {
            Title = name;
            NavigationPage.SetHasNavigationBar(this, true);
            BindingContext = forumViewModel = new ForumDetailsViewModel(forumId);
            forumViewModel.GetForumListCommand.Execute(null);

            var activityIndicator = new ActivityIndicator
            {
                Color = Color.Gray,
            };

            activityIndicator.SetBinding(IsVisibleProperty, "IsBusy");
            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
            var forumDetaillist = new ListView
            {
                HasUnevenRows   = false,
                ItemTemplate    = new DataTemplate(typeof(CPListCell)),
                ItemsSource     = forumViewModel.ForumList,
                BackgroundColor = Color.White,
                RowHeight       = 120,
            };

            Content = new StackLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                BackgroundColor   = Color.White,
                Children          = { forumDetaillist }
            };

            forumDetaillist.ItemSelected += (sender, e) =>
            {
                var selectedObject = e.SelectedItem as CPMobile.Models.Item;

                var WebViewPage = new WebViewPage(name, selectedObject.websiteLink);
                Navigation.PushAsync(WebViewPage);
            };
        }
Exemplo n.º 28
0
        public TrendsPage(TrendsViewModel trendsViewModel,
                          TrendsChartSettingsService trendsChartSettingsService,
                          Repository repository,
                          AnalyticsService analyticsService) : base(repository.Name, trendsViewModel, analyticsService)
        {
            _repository = repository;

            var referringSitesToolbarItem = new ToolbarItem
            {
                Text         = "Referring Sites",
                AutomationId = TrendsPageAutomationIds.ReferringSitesButton
            };

            referringSitesToolbarItem.Clicked += HandleReferringSitesToolbarItemClicked;
            ToolbarItems.Add(referringSitesToolbarItem);

            TrendsChart.TotalViewsSeries.IsVisible        = trendsChartSettingsService.ShouldShowViewsByDefault;
            TrendsChart.TotalUniqueViewsSeries.IsVisible  = trendsChartSettingsService.ShouldShowUniqueViewsByDefault;
            TrendsChart.TotalClonesSeries.IsVisible       = trendsChartSettingsService.ShouldShowClonesByDefault;
            TrendsChart.TotalUniqueClonesSeries.IsVisible = trendsChartSettingsService.ShouldShowUniqueClonesByDefault;

            var activityIndicator = new ActivityIndicator
            {
                AutomationId = TrendsPageAutomationIds.ActivityIndicator
            };

            activityIndicator.SetDynamicResource(ActivityIndicator.ColorProperty, nameof(BaseTheme.RefreshControlColor));
            activityIndicator.SetBinding(IsVisibleProperty, nameof(TrendsViewModel.IsFetchingData));
            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, nameof(TrendsViewModel.IsFetchingData));

            var absoluteLayout = new AbsoluteLayout();

            absoluteLayout.Children.Add(activityIndicator, new Rectangle(.5, .5, -1, -1), AbsoluteLayoutFlags.PositionProportional);
            absoluteLayout.Children.Add(TrendsChart, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);

            Content = absoluteLayout;

            ViewModel.FetchDataCommand.Execute((_repository.OwnerLogin, _repository.Name));
        }
Exemplo n.º 29
0
        public CustomersPage()
        {
            #region customer list activity inidicator
            ActivityIndicator customerListActivityIndicator = new ActivityIndicator()
            {
                HeightRequest = Sizes.MediumRowHeight
            };
            customerListActivityIndicator.SetBinding(IsEnabledProperty, "IsBusy");
            customerListActivityIndicator.SetBinding(IsVisibleProperty, "IsBusy");
            customerListActivityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
            #endregion

            #region customer list
            CustomerListView customerListView = new CustomerListView();
            customerListView.SetBinding(CustomerListView.ItemsSourceProperty, "Accounts");
            customerListView.SetBinding(IsEnabledProperty, "IsBusy", converter: new InverseBooleanConverter());
            customerListView.SetBinding(IsVisibleProperty, "IsBusy", converter: new InverseBooleanConverter());

            customerListView.ItemTapped += async(sender, e) =>
                                           await App.ExecuteIfConnected(async() =>
            {
                Account account = (Account)e.Item;
                await PushTabbedPage(account);
            });

            #endregion

            #region compose view hierarchy
            Content = new UnspacedStackLayout()
            {
                Children =
                {
                    customerListActivityIndicator,
                    customerListView
                },
                Padding = Device.OnPlatform(Thicknesses.IosStatusBar, Thicknesses.Empty, Thicknesses.Empty)
            };
            #endregion
        }
Exemplo n.º 30
0
        public CategoryListPage()
        {
            categoriaViewModel = new CategoryViewModel();
            categoriaViewModel.GetCPFeedCommand.Execute(null);
            var activityIndicator = new ActivityIndicator
            {
                Color = Color.White,
            };

            activityIndicator.SetBinding(IsVisibleProperty, "IsBusy");
            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
            var genralArticlelist = new ListView
            {
                HasUnevenRows   = false,
                ItemTemplate    = new DataTemplate(typeof(CPListCell)),
                ItemsSource     = categoriaViewModel.Categorias,
                BackgroundColor = Color.White,
                RowHeight       = 120,
            };

            //vetlist.SetBinding<ArticlePageViewModel>();
            Content = new StackLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                BackgroundColor   = Color.White,
                Children          = { genralArticlelist }
            };

            genralArticlelist.ItemSelected += (sender, e) =>
            {
                var selectedObject    = e.SelectedItem as CPMobile.Models.Item;
                var SingleArticleView = new SingleArticleView(selectedObject);
                //var WebViewPage = new WebViewPage("General Articles",string.Format("http:{0}",selectedObject.websiteLink));
                Navigation.PushAsync(SingleArticleView);
                // Navigation.PushAsync( );
            };
        }
Exemplo n.º 31
0
        public virtual View GetImageChooserLoadingContent()
        {
            var contentLoadingV = new ContentView();

            var activityIndicator = new ActivityIndicator();

            activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, Binding.Create <ImageChooser>(vm => vm.IsLoading));
            activityIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, Binding.Create <ImageChooser>(vm => vm.IsLoading));

            loadingLabel      = new Label();
            loadingLabel.Text = ImageChooserOptionsData?.LoadingText;
            loadingLabel.HorizontalTextAlignment = TextAlignment.Center;


            var stackLayout = new StackLayout()
            {
                Spacing           = 10,
                Padding           = 8,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center
            };

            stackLayout.Children.Add(activityIndicator);
            stackLayout.Children.Add(loadingLabel);

            stackLayout.BindingContext = this;

            if (BootStrapper.CurrentApp.StyleKit != null)
            {
                loadingLabel.TextColor          = BootStrapper.CurrentApp.StyleKit.SecondaryTextColor;
                activityIndicator.Color         = BootStrapper.CurrentApp.StyleKit.SecondaryTextColor;
                contentLoadingV.BackgroundColor = BootStrapper.CurrentApp.StyleKit.PrimaryColor;
            }

            contentLoadingV.Content = stackLayout;

            return(contentLoadingV);
        }