private CircleImage GetPhoto(KeyValuePair <string, string> s, bool isStudent) { Stream studentstream; if (isStudent) { studentstream = Attendance.GetStudentPhoto(s.Key); } else { studentstream = Attendance.GetTeacherPhoto(s.Key); } CircleImage profilePicture = new CircleImage { Source = ImageSource.FromStream(() => { return(studentstream); }), HeightRequest = 50, WidthRequest = 50 }; if (studentstream == null) { profilePicture = new CircleImage { Source = "blankprofile.png", HeightRequest = 50, WidthRequest = 50 }; } return(profilePicture); }
public Node() { for (int i = 0; i < 100; i++) { this.image = new CircleImage(); } }
public void InitIcon(CircleImage icon) { // build the loading page with native base icon.Parent = Xamarin.Forms.Application.Current.MainPage; icon.Layout(new Rectangle(Xamarin.Forms.Application.Current.MainPage.Width - icon.WidthRequest, Xamarin.Forms.Application.Current.MainPage.Height - icon.HeightRequest, icon.WidthRequest, icon.HeightRequest)); var renderer = icon.GetOrCreateRenderer(); _iconNativeView = renderer.View; _iconDialog = new Dialog(CrossCurrentActivity.Current.Activity); _iconDialog.RequestWindowFeature((int)WindowFeatures.NoTitle); _iconDialog.SetCancelable(true); _iconDialog.SetCanceledOnTouchOutside(true); _iconDialog.SetContentView(_iconNativeView); Window window = _iconDialog.Window; window.SetLayout(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); window.SetGravity(GravityFlags.Bottom); window.ClearFlags(WindowManagerFlags.DimBehind); window.SetBackgroundDrawable(new ColorDrawable(Android.Graphics.Color.Transparent)); _isIconInitialized = true; }
public MainPage() { InitializeComponent(); camera = (CircleImage)FindByName("Camera"); camera.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.camera.jpg"); gallery = (CircleImage)FindByName("Gallery"); gallery.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.gallery.jpg"); send = (CircleImage)FindByName("Send"); send.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.send.jpg"); prescribeimage = (Image)FindByName("PrescribeImage"); prescribesList = new List <Prescribes>(); hubConnection = new HubConnectionBuilder() .WithUrl("http://10.0.2.2:55011/Hubs/PrescriptionHub") .Build(); hubConnection.On <int>("DrugstoreResponse", (id) => { }); // hubConnection.On<string>("New Message", (message) => //{ // string mytext = message; // //DisplayAlert("Ouch", message,"OK"); //}); }
protected override void ClearUIComponents() { ImgGoldBg = null; BtnGold = null; TvGold = null; BtnIntegral = null; TvMedal = null; BtnMedal = null; BtnRobot = null; BtnChineseShop = null; BtnEnglishShop = null; BtnLearningShop = null; ImgChineseNoBind = null; ImgEnglishNoBind = null; ImgLearningNoBind = null; BtnAddRobot = null; BtnListen = null; BtnGift = null; BtnPhotoWall = null; BtnMessage = null; BtnScan = null; BtnSetting = null; ImageHead = null; TvUserName = null; TvUserAge = null; mData = null; }
public MenuHeader() { if (((App)Application.Current).User == null) { return; } CircleImage Profile = new CircleImage { Source = API.PictureHelper.GetUserPictureUri(((App)Application.Current).User.Picture, ((App)Application.Current).User.Login, Epitech.Intra.API.PictureHelper.PictureSize.Light), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Aspect = Aspect.Fill, HeightRequest = 120, WidthRequest = 120 }; Label Name = new Label { Text = ((App)Application.Current).User.Title, HorizontalOptions = LayoutOptions.Center, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), TextColor = Color.White, }; BackgroundColor = Color.Transparent; Padding = new Thickness(0, 30, 0, 20); Children.Add(Profile); Children.Add(Name); }
public void AddSpeaker(Speaker speaker, int size) { var circleImage = new CircleImage { Source = speaker.Headshot, BorderColor = (Color)App.Current.Resources["AvatarBorder"], BorderThickness = 2, Aspect = Aspect.AspectFill, WidthRequest = size, HeightRequest = size, VerticalOptions = new LayoutOptions(LayoutAlignment.Start, true), HorizontalOptions = new LayoutOptions(LayoutAlignment.Center, false) }; var label = new Label { Text = speaker.Name, HorizontalOptions = new LayoutOptions(LayoutAlignment.Center, true), VerticalOptions = new LayoutOptions(LayoutAlignment.Center, true), HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center }; Control.Children.Add(circleImage); Control.Children.Add(label); }
private void SetupVisual() { var hostVisual = ElementCompositionPreview.GetElementVisual(element: ShadowHost); var compositor = hostVisual.Compositor; // Create a drop shadow DropShadow dropShadow = compositor.CreateDropShadow(); dropShadow.Color = Color.FromArgb(255, 22, 33, 44); dropShadow.BlurRadius = 15.0f; dropShadow.Offset = new Vector3(12.5f, 2.5f, 0.0f); // Associate the shape of the shadow with the shape of the target element dropShadow.Mask = CircleImage.GetAlphaMask(); // Create a Visual to hold the shadow SpriteVisual shadowVisual = compositor.CreateSpriteVisual(); shadowVisual.Shadow = dropShadow; // Add the shadow as a child of the host (Ellipse) in the visual tree ElementCompositionPreview.SetElementChildVisual(element: ShadowHost, visual: shadowVisual); // Ensure the size of shadow host and shadow visual always stay in sync ExpressionAnimation bindSizeAnimation = compositor.CreateExpressionAnimation(expression: "hostVisual.Size"); bindSizeAnimation.SetReferenceParameter(key: "hostVisual", compositionObject: hostVisual); shadowVisual.StartAnimation(propertyName: nameof(shadowVisual.Size), animation: bindSizeAnimation); }
private View CreateProfileImage() { mainImage = new CircleImage { Source = "profile_boy.png", BorderThickness = 1, BorderColor = (Color)Application.Current.Resources["Primary"] }; minorImage = new CircleImage { Source = "profile_girl.png", HeightRequest = WidthRequest = 40, BorderThickness = 2, BorderColor = (Color)Application.Current.Resources["PrimaryDark"] }; minorImage2 = new CircleImage { Source = "profile_girl.png", HeightRequest = WidthRequest = 40, BorderThickness = 2, BorderColor = (Color)Application.Current.Resources["Accent"] }; AbsoluteLayout imageLayout = new AbsoluteLayout() { HeightRequest = WidthRequest = 144, Margin = new Thickness(10, 0, -5, 0) }; imageLayout.Children.Add(mainImage); imageLayout.Children.Add(minorImage, new Rectangle(1.3, 0.4, 48, 48), AbsoluteLayoutFlags.PositionProportional); imageLayout.Children.Add(minorImage2, new Rectangle(0.8, 0.9, 48, 48), AbsoluteLayoutFlags.PositionProportional); return(imageLayout); }
public SpeakerPage() { InitializeComponent(); viewModel = App.SimpleIoC.Resolve <SpeakersViewModel> (); BindingContext = viewModel; if (viewModel.CurrentSpeaker.HeadshotUrl.Length > 0) { try { var photo = new CircleImage { BorderColor = Color.White, BorderThickness = 3, HeightRequest = 75, WidthRequest = 75, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, Source = UriImageSource.FromUri(new Uri(viewModel.CurrentSpeaker.HeadshotUrl)) //Source = UriImageSource.FromFile("TeamMirMaheed") //Source = UriImageSource.FromUri (new Uri ("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG")) }; stackCircles.Children.Clear(); stackCircles.Children.Add(photo); } catch (Exception exc) { } } }
private void AddInfoLayout() { var image = new CircleImage(); image.Source = _client is Customer ? _client.CustomerImage : ((MuaArtist)_client).ArtistImage; image.Margin = new Thickness(20, 20, 20, 20); image.HeightRequest = 60; image.WidthRequest = image.HeightRequest; image.Aspect = Aspect.AspectFill; var name = new CustomLabel { Text = _client.FullName, FontSize = 22, FontFamily = UIUtils.FONT_BEBAS_REGULAR, TextColor = Color.Black, VerticalOptions = LayoutOptions.CenterAndExpand }; var layout = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { image, name } }; var separator = UIUtils.MakeSeparator(true); this.Children.Add(layout); this.Children.Add(separator); }
public ButtonCardView(string text, string buttonImageUrl) { CircleImage btn = new CircleImage() { Source = buttonImageUrl + ".png", HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, WidthRequest = 80, HeightRequest = 80 }; Label lbl = new Label { Text = text, TextColor = Color.FromHex("#3d454f"), FontFamily = "'Helvetica Neue','Segoe UI',Helvetica,Verdana,sans-serif", HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, FontSize = 10, FontAttributes = FontAttributes.Bold, HorizontalTextAlignment = TextAlignment.Center }; Children.Add(btn); Children.Add(lbl); }
private static void OnSpeakersPropertyChanged(BindableObject bindable, object oldValue, object newValue) { var context = (HeadshotListControl)bindable; if (context != null) { context.Control.Children.Clear(); var items = (IEnumerable <Speaker>)newValue; if (items == null) { return; } if (items.Count() == 1) { context.AddSpeaker(items.FirstOrDefault(), 70); } else { var speakers = items.ToArray(); int itemsPerRow = 2; StackLayout container = new StackLayout { Orientation = StackOrientation.Vertical, VerticalOptions = new LayoutOptions(LayoutAlignment.Center, true), HorizontalOptions = new LayoutOptions(LayoutAlignment.Center, true) }; StackLayout row = new StackLayout(); for (int index = 0; index < speakers.Length; index++) { if (index % itemsPerRow == 0) { row = new StackLayout { Orientation = StackOrientation.Horizontal }; container.Children.Add(row); } var circleImage = new CircleImage { Source = speakers[index].Headshot, BorderColor = (Color)App.Current.Resources["AvatarBorder"], BorderThickness = 1, Aspect = Aspect.AspectFill, WidthRequest = 45, HeightRequest = 45, VerticalOptions = new LayoutOptions(LayoutAlignment.Start, true), HorizontalOptions = new LayoutOptions(LayoutAlignment.Center, false) }; row.Children.Add(circleImage); } context.Control.Children.Add(container); } } }
public void Init() { VM.BindData(); ListView lv = new ListView(); lv.HorizontalOptions = LayoutOptions.FillAndExpand; lv.VerticalOptions = LayoutOptions.FillAndExpand; lv.SetBinding(ListView.ItemsSourceProperty, new Binding("ItemCollection")); lv.ItemSelected += (sender, e) => { if (e.SelectedItem != null) { Navigation.PushAsync(new JegerPage((Jeger)e.SelectedItem), true); ((ListView)sender).SelectedItem = null; } }; //Remember to remove this event handler on dispoing of the page; DataTemplate dt = new DataTemplate(typeof(CircleImageCell)); dt.SetBinding(CircleImageCell.TextProperty, "Navn"); dt.SetBinding(CircleImageCell.ImageSourceProperty, "Image"); lv.ItemTemplate = dt; if (VM.ItemCollection.Any()) { Content = lv; } else { var btn = new Button() { HorizontalOptions = LayoutOptions.CenterAndExpand, Text = "Opprett første jeger", BackgroundColor = Color.FromHex("#74B058") }; btn.Clicked += delegate(object sender, EventArgs args) { Navigation.PushAsync(new JegerPage(new Jeger()), true); }; var myImage = new CircleImage() { Source = FileImageSource.FromFile("placeholder_hunter.jpg"), BorderThickness = 2, BorderColor = Color.White, Aspect = Aspect.AspectFill, Margin = 20 }; Content = new StackLayout() { VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.Center, Children = { myImage, btn } }; } }
void onTap(object sender, EventArgs e) { this.deselectBase(); CircleImage selected = (CircleImage)sender; int id = Convert.ToInt32(selected.StyleId); this.setLocation(id); this.selectBase(); }
public StackLayout AddConctact(string DisplayName, string PhoneNumber) { CircleImage Image = new CircleImage { Margin = new Thickness(0, 0, 10, 0), BorderColor = Color.White, BorderThickness = 1, HeightRequest = 75, WidthRequest = 75, FillColor = Color.DimGray, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Start, Source = "megu.jpg" }; StackLayout Info = new StackLayout() { Spacing = 3, Children = { new Label { Text = DisplayName, TextColor = Color.Black, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), }, new Label { Text = PhoneNumber, TextColor = Color.FromHex("#8c8c8c"), FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), } } }; StackLayout Card = new StackLayout() { Spacing = 0, Orientation = StackOrientation.Horizontal, Children = { Image, Info } }; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += async(s, e) => { ClickAnimation(Card); await DelayAsync(1000); DetailInit(DisplayName, PhoneNumber); //await DelayAsync(1000); this.CurrentPage = this.Children[1]; }; Card.GestureRecognizers.Add(tapGestureRecognizer); return(Card); }
public Dia(DateTime fecha, bool seleccionado) { this.fecha = fecha; Grid grid = new Grid { RowSpacing = 1, ColumnSpacing = 5, BackgroundColor = Color.White, VerticalOptions = LayoutOptions.FillAndExpand, RowDefinitions = { new RowDefinition { Height = new GridLength(30, GridUnitType.Absolute) } }, ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, } }; var circulo = new CircleImage { BorderThickness = 0, HeightRequest = 25, WidthRequest = 25, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, }; dia = new Button { BackgroundColor = Color.Transparent, TextColor = Color.FromHex("B2B2B2"), Text = this.fecha.Day.ToString(), HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, FontFamily = Device.OnPlatform("OpenSans-Bold", "OpenSans-Bold", null) }; grid.Children.Add(circulo, 0, 0); grid.Children.Add(dia, 0, 0); if (fecha.Date == DateTime.Now.Date) { circulo.Source = Images.Actual; dia.TextColor = Color.White; } if (seleccionado) { circulo.Source = Images.Seleccionada; dia.TextColor = Color.White; } dia.Clicked += Dia_Clicked; Content = grid; }
private void SetupUserInterface() { BackgroundColor = Colors.BackgroundColor; NavigationPage.SetHasNavigationBar(this, false); profileImage = new CircleImage { Aspect = Aspect.AspectFill, BorderColor = Color.White, BorderThickness = 3, Source = GetProfileImageUrl(), HeightRequest = 125, HorizontalOptions = LayoutOptions.Center, WidthRequest = 125 }; nameLabel = new Label { Style = Application.Current.Resources["MainLabelStyle"] as Style, Text = GetProfileName() }; signOutButton = new Button { Text = Strings.SignOut }; separator = new Image { BackgroundColor = Colors.SeparatorColor, HeightRequest = 1, WidthRequest = this.Width }; deleteAccountButton = new Button { Text = Strings.DeleteAccount }; aboutMomentsButton = new Button { Text = Strings.AboutMoments }; var buttonStack = new StackLayout { Children = { signOutButton, separator, deleteAccountButton }, Spacing = 0 }; var topStack = new StackLayout { Children = { profileImage, nameLabel, buttonStack }, Spacing = 30, Padding = new Thickness(0, 50, 0, 0) }; var mainLayout = new StackLayout { Children = { topStack, aboutMomentsButton }, Spacing = 50 }; Content = mainLayout; }
public MocaCell() { var Codigo = new Label { HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.Start, FontSize = 16, FontAttributes = FontAttributes.Bold, }; Codigo.SetBinding(Label.TextProperty, new Binding("Codigo")); var Guerra = new Label { FontSize = 24, FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.Start, Margin = 5 }; Guerra.SetBinding(Label.TextProperty, new Binding("Guerra")); var Image = new CircleImage { BorderColor = Color.White, BorderThickness = 3, HeightRequest = 60, WidthRequest = 60, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, Source = "Login" }; Image.SetBinding(Label.TextProperty, new Binding("Image")); var line1 = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { Image, Codigo } }; var line2 = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { Guerra } }; View = new StackLayout { Orientation = StackOrientation.Vertical, Children = { line1, line2 } }; }
public MasterDetailPage1Master() { InitializeComponent(); BindingContext = new MasterDetailPage1MasterViewModel(); ListView = MenuItemsListView; LoginBtn = Userimg; OptionBtn = Option; usernameLabel = Username; }
public SettingsUserView() { BindingContext = profileViewModel = new ProfileViewModel(); profileViewModel.GetCPFeedCommand.Execute(null); var activityIndicator = new ActivityIndicator { Color = Color.Black, }; activityIndicator.SetBinding(IsVisibleProperty, "IsBusy"); activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy"); var circleImage = new CircleImage { BorderColor = Color.White, BorderThickness = 2, HeightRequest = 80, WidthRequest = 80, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, Source = new UriImageSource { Uri = new Uri("http://bit.ly/1s07h2W"), CacheValidity = TimeSpan.FromDays(15) }, }; var label = new Label() { Text = "Usuario", TextColor = Color.White, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, }; Content = new StackLayout() { Padding = new Thickness(0, 10, 0, 0), Spacing = 15, Orientation = StackOrientation.Vertical, Children = { circleImage, label, activityIndicator, } }; circleImage.SetBinding(CircleImage.SourceProperty, "Avatar"); label.SetBinding(Label.TextProperty, "DisplayName"); //var tapGestureRecognizer = new TapGestureRecognizer(); //tapGestureRecognizer.Tapped += // (sender, e) => // Navigation.PushModalAsync(new NavigationPage(new Profile(profileViewModel.myProfile)) { BarBackgroundColor = App.BrandColor }); //circleImage.GestureRecognizers.Add(tapGestureRecognizer); }
protected async override void OnAppearing() { base.OnAppearing(); var source = new JsonImageListSource(Resolver.Resolve <IJsonSerializer>()); var items = await source.GetListItems(); var list = new ListView { HasUnevenRows = true, ItemsSource = items, ItemTemplate = new DataTemplate(() => { var image = new CircleImage { Aspect = Aspect.AspectFill, HeightRequest = Device.OnPlatform(50, 75, 75), WidthRequest = Device.OnPlatform(50, 75, 75), }; image.SetBinding(Image.SourceProperty, "Image"); var label = new Label { FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), YAlign = TextAlignment.Center, XAlign = TextAlignment.Center }; label.SetBinding(Label.TextProperty, "Title"); return(new ViewCell { View = new StackLayout { Padding = new Thickness(20), Spacing = 10, Orientation = StackOrientation.Horizontal, Children = { image, label } } }); }) }; this.Content = new StackLayout { Children = { new Label { Text = Device.OnPlatform( "Works on iOS", "Works on Android now as well", "Works on WP") }, list } }; }
private void CreateViews() { homeImage = new GradientImage { Source = ImageSource.FromResource("Zwaby.Images.child-1245893_1280.jpg", typeof(MainPage).GetTypeInfo().Assembly), Aspect = Aspect.AspectFit, StartColor = Color.FromHex("#008c49"), EndColor = Color.FromHex("#00d2b4") }; zwabyImage = new CircleImage { Source = ImageSource.FromResource("Zwaby.Images.zwabyhomefive.png", typeof(MainPage).GetTypeInfo().Assembly), Aspect = Aspect.AspectFit, BackgroundColor = Color.White, HorizontalOptions = LayoutOptions.Center, Margin = new Thickness(20, 20, 20, 20), CornerRadius = 4.0 }; calendarImage = new CircleImage { Source = "calendaricon.png", Style = Resources["imageIcon"] as Style }; bookingImage = new CircleImage { Source = "bookingicon.png", Style = Resources["imageIcon"] as Style }; profileImage = new CircleImage { Source = "profileicon.png", Style = Resources["imageIcon"] as Style }; bookServiceLabel = new Label { Text = "Book Cleaning", FontFamily = Device.RuntimePlatform == Device.iOS ? "Cabin-Bold" : "Cabin-Bold.ttf#Cabin-Bold" }; bookingDetailsLabel = new Label { Text = "Booking Details", FontFamily = Device.RuntimePlatform == Device.iOS ? "Cabin-Bold" : "Cabin-Bold.ttf#Cabin-Bold" }; profileLabel = new Label { Text = "Profile", FontFamily = Device.RuntimePlatform == Device.iOS ? "Cabin-Bold" : "Cabin-Bold.ttf#Cabin-Bold" }; }
private async Task GetPets() { await Task.Run(() => { Device.BeginInvokeOnMainThread(() => { petListStackLayout.Children.Clear(); }); foreach (var item in GlobalVariables.Mypetlist) { Frame frame = new Frame() { //BorderColor = Color.LightGray, //Padding = 10, //BackgroundColor = Color.FromHex("#F5F6F8") BackgroundColor = Color.White }; StackLayout stackLayout = new StackLayout() { Orientation = StackOrientation.Vertical }; CircleImage petProfilePictureImage = new CircleImage { HeightRequest = 55, WidthRequest = 55, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, Source = ImageSource.FromStream(() => new System.IO.MemoryStream(item.ProfilePictureURL)) }; Label nameLabel = new Label() { Text = item.Name, HorizontalOptions = LayoutOptions.Center, TextColor = Color.Black }; Device.BeginInvokeOnMainThread(() => { stackLayout.GestureRecognizers.Add(new TapGestureRecognizer() { NumberOfTapsRequired = 1, TappedCallback = delegate { TapPet(item.petid); } }); stackLayout.Children.Add(petProfilePictureImage); stackLayout.Children.Add(nameLabel); frame.Content = stackLayout; petListStackLayout.Children.Add(frame); }); } }); }
protected async override void OnAppearing() { base.OnAppearing(); var source = new JsonImageListSource(Resolver.Resolve<IJsonSerializer>()); var items = await source.GetListItems(); var list = new ListView { HasUnevenRows = true, ItemsSource = items, ItemTemplate = new DataTemplate(() => { var image = new CircleImage { Aspect = Aspect.AspectFill, HeightRequest = Device.OnPlatform(50, 75, 75), WidthRequest = Device.OnPlatform(50, 75, 75), }; image.SetBinding(Image.SourceProperty, "Image"); var label = new Label { FontSize = Device.GetNamedSize(NamedSize.Medium, typeof (Label)), YAlign = TextAlignment.Center, XAlign = TextAlignment.Center }; label.SetBinding(Label.TextProperty, "Title"); return new ViewCell { View = new StackLayout { Padding = new Thickness(20), Spacing = 10, Orientation = StackOrientation.Horizontal, Children = { image, label } } }; }) }; this.Content = new StackLayout { Children = { new Label { Text = Device.OnPlatform( "Works on iOS", "Works on Android now as well", "Works on WP") }, list } }; }
public EmployeeNameCell() { var EmpImage = new CircleImage() { HorizontalOptions = LayoutOptions.Start, //BorderThickness=5, //Source = "Pics/ 5b571de8-5e8c-4991-9bcb-113348e66d69.jpeg", //BorderColor=Color.White, Aspect = Aspect.Fill, }; EmpImage.SetBinding(Image.SourceProperty, new Binding("EmpProfileImage")); EmpImage.WidthRequest = EmpImage.HeightRequest = 70; var nameLabel = new Label { HorizontalOptions = LayoutOptions.Start, TextColor = Color.White }; nameLabel.FontSize = 15; nameLabel.SetBinding(Label.TextProperty, "FullName"); var Designation = new Label { HorizontalOptions = LayoutOptions.Start, TextColor = Color.White }; Designation.FontSize = 15; Designation.SetBinding(Label.TextProperty, "EmailAddress"); View = new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.Start, Padding = new Thickness(0, 2.5, 0, 1.5), HeightRequest = 10, Spacing = 0, Children = { EmpImage, //new Image{Source="index.jpg",HeightRequest=50,WidthRequest=50}, new StackLayout { Spacing = 0, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.Start, Padding = 0, Children = { nameLabel, Designation } }, } }; }
public MunCell() { var vetProfileImage = new CircleImage { HeightRequest = 50, WidthRequest = 50, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, }; vetProfileImage.SetBinding(Image.SourceProperty, "ImageSource"); var nameLabel = new Label() { FontFamily = Definitions.FontFamily, FontSize = Definitions.LoginLabelText, TextColor = Color.FromHex(Definitions.DefaultTextColor), YAlign = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; nameLabel.SetBinding(Label.TextProperty, "Name"); var vetDetailsLayout = new StackLayout { Padding = new Thickness(15, 0, 0, 0), Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { nameLabel } }; var tapImage = new Image() { Source = "Resources/right.png", IsVisible = true, Opacity = 0.4, HorizontalOptions = LayoutOptions.End, }; var cellLayout = new StackLayout { Spacing = 0, Padding = new Thickness(20, 5, 20, 5), Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { vetProfileImage, vetDetailsLayout, tapImage } }; this.View = cellLayout; }
public NewPlayerPage() { Entry playerNameEntry = new Entry { Placeholder = "Imie gracza" }; //playerNameEntry.SetBinding(Entry.TextProperty, new Binding("PlayerName", BindingMode.OneWay)); Button choosePicFromGalleryButton = new Button { Text = "Wybierz istniejace zdjecie" }; choosePicFromGalleryButton.Clicked += ChoosePicFromGalleryButton_Clicked; Button takeAPictureButton = new Button { Text = "Zrob zdjecie", }; takeAPictureButton.Clicked += TakeAPictureButton_Clicked; uploadedImage = new CircleImage { WidthRequest = 200, HeightRequest = 200, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.CenterAndExpand, Aspect = Aspect.AspectFill, }; //uploadedImage.SetBinding(CircleImage.SourceProperty, new Binding("ImageSource")); Button addPlayerButton = new Button { Text = "Dodaj" }; addPlayerButton.Clicked += AddPlayerButton_Clicked; Content = new StackLayout { Children = { playerNameEntry, choosePicFromGalleryButton, takeAPictureButton, uploadedImage, addPlayerButton } }; }
private StackLayout apartatPerfil() { var userFoto = new CircleImage { BorderColor = Color.White, BorderThickness = 3, HeightRequest = 80, WidthRequest = 80, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, Source = "perfil.jpg", }; var nom = new Label { Text = "Joan Pol", TextColor = Color.White, }; var cognoms = new Label { Text = "Farre Serrano", TextColor = Color.White, }; nom.FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)); cognoms.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)); var logout = new Button { Text = "Log out", TextColor = Color.Blue, BackgroundColor = Color.Transparent, BorderColor = Color.Transparent, }; logout.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)); var principal = new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, }; var secundari = new StackLayout { Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.CenterAndExpand, //HorizontalOptions = LayoutOptions.EndAndExpand, }; secundari.Children.Add(nom); secundari.Children.Add(cognoms); secundari.Children.Add(logout); //secundari.BackgroundColor = Color.White; principal.Spacing = 10; principal.Children.Add(userFoto); principal.Children.Add(secundari); principal.Children[0].WidthRequest = 100; principal.Padding = new Thickness(10, 0, 0, 0); return(principal); }
public MainPageTabbed() { InitializeComponent(); camera = (CircleImage)FindByName("Camera"); camera.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.camera.jpg"); gallery = (CircleImage)FindByName("Gallery"); gallery.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.gallery.jpg"); send = (CircleImage)FindByName("Send"); send.Source = ImageSource.FromResource("KooshDaroo.Customer.Images.send.jpg"); prescribeimage = (Image)FindByName("PrescribeImage"); PrescribeList = new List <Prescribe>(); responseS = new SelectableObservableCollection <Response>(); //var _r = new Response //{ // NDI = "8:8", // Tag = "154" //}; //responseS.Add(_r); //RemoveSelectedCommand = new Command(OnRemoveSelected); RouteToPharmacyCommand = new Command(OnRouteToPharmacy); AcceptCommand = new Command(OnAccept); BindingContext = this; hubConnection = new HubConnectionBuilder() .WithUrl(App.hubAddress) .Build(); //hubConnection.On<double, double, DateTime, string>("New Prescribe", (X, Y, dateOf, phoneNo) => //{ // string _phoneNo = phoneNo; // // DisplayAlert("Ouch", prescribe.DateOf.ToString() + "\n" + prescribe.PhoneNo, "OK"); //}); hubConnection.On <int, int>("SendAcceptToMember", (prescribeResourceId, prescribeId) => { if (_prescribeId != prescribeId) { return; } GetPrescribeResourseData(prescribeResourceId); }); //GetPrescribeResourseData(23); }
public ImagePage() { InitializeComponent(); //var imageSource = (UriImageSource)ImageSource.FromUri(new Uri("http://")); //var imageSource = new UriImageSource //{ // Uri = new Uri("http://lorempixel.com/1920/1080/sports/7/") //}; //imageSource.CachingEnabled = false; //imageSource.CacheValidity = TimeSpan.FromHours(1); //bkgImage.Source = imageSource; //bkgImage.Source = ImageSource.FromResource("manage_contacts.Images.background.jpg"); //bkgImage.Aspect = Aspect.Fill; //switch(Device.RuntimePlatform) //{ // case Device.iOS : // case Device.Android: // btnImage.Image = (FileImageSource)ImageSource.FromFile("clock.png"); // break; // case Device.WinPhone: // btnImage.Image = (FileImageSource)ImageSource.FromFile("Images/clock.png"); // break; //} var imageCircle = new CircleImage { BorderColor = Color.White, BorderThickness = 3, HeightRequest = 150, WidthRequest = 150, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, //Source = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG")) Source = ImageSource.FromResource("manage_contacts.Images.background.jpg") }; var layout = new StackLayout(); layout.HorizontalOptions = LayoutOptions.Center; layout.VerticalOptions = LayoutOptions.Center; layout.Children.Add(imageCircle); Content = layout; }
public MunCell() { var vetProfileImage = new CircleImage { HeightRequest = 50, WidthRequest = 50, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, }; vetProfileImage.SetBinding(Image.SourceProperty, "ImageSource"); var nameLabel = new Label() { FontFamily = Definitions.FontFamily, FontSize = Definitions.LoginLabelText, TextColor = Color.FromHex(Definitions.DefaultTextColor), YAlign = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; nameLabel.SetBinding(Label.TextProperty, "Name"); var vetDetailsLayout = new StackLayout { Padding = new Thickness(15, 0, 0, 0), Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { nameLabel } }; var tapImage = new Image() { Source = "Resources/right.png", IsVisible = true, Opacity = 0.4, HorizontalOptions = LayoutOptions.End, }; var cellLayout = new StackLayout { Spacing = 0, Padding = new Thickness(20, 5, 20, 5), Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { vetProfileImage, vetDetailsLayout, tapImage } }; this.View = cellLayout; }
public Image CreateShapeView(ShapeViewModel shape) { Image i; if (shape is CircleViewModel) { i = new CircleImage {WidthRequest = shape.Width, HeightRequest = shape.Width, BindingContext = shape}; i.SetBinding(CircleImage.FillColorProperty, new Binding("Color")); } else { i = new Image() { WidthRequest = shape.Width, HeightRequest = shape.Height, BindingContext = shape }; i.SetBinding(BackgroundColorProperty, new Binding("Color")); } i.BindingContext = shape; i.SetBinding(Image.SourceProperty, new Binding("ImageSource")); return i; }
public View CreateCellView() { var nameLabel = new Label(); nameLabel.SetBinding(Label.TextProperty, "name"); nameLabel.TextColor=Colors.DarkGray.ToFormsColor(); var locationLabel = new Label(); locationLabel.SetBinding(Label.TextProperty,"location"); locationLabel.TextColor=Colors.DarkGray.ToFormsColor(); expert = new Label(); expert.SetBinding(Label.TextProperty, "expert"); var profileImage = new CircleImage(); profileImage.Aspect=Aspect.AspectFill; //profileImage.Source = "img1.png"; profileImage.SetBinding(CircleImage.SourceProperty, "image", BindingMode.Default); var retView = new StackLayout { Padding = new Thickness (3, 3, 0, 3), BackgroundColor = Color.White, Orientation = StackOrientation.Horizontal, Children = { profileImage, new StackLayout { VerticalOptions = LayoutOptions.Center, Spacing = 0, Children = { nameLabel, locationLabel } }, GenEventTablelGrid () } }; return retView; }
public void CreateImageLayout () { imageLayout = new RelativeLayout { HeightRequest = 230, VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand, }; coverImage = new Image { Source = model.CoverImage, Aspect = Aspect.AspectFill }; profileImage = new CircleImage { Source = model.ProfileImage, WidthRequest = 80, HeightRequest = 80 }; imageLayout.Children.Add(coverImage, Constraint.Constant(0), Constraint.Constant(0), Constraint.RelativeToParent((p) => { return p.Width; }), Constraint.RelativeToParent((p) => { return imageLayout.HeightRequest; }) ); imageLayout.Children.Add(profileImage, Constraint.RelativeToParent((p) => { return (p.Width - profileImage.WidthRequest) / 2; }), Constraint.RelativeToParent((p) => { return (imageLayout.HeightRequest - profileImage.HeightRequest) + 20; }) ); mainLayout.Children.Add (imageLayout); }
public UserRegistrationView () { BindingContext = new UserViewModel(this.Navigation); indicator = new ActivityIndicator { Color = Colors.DarkGray.ToFormsColor(), HorizontalOptions=LayoutOptions.Center, VerticalOptions=LayoutOptions.Center, }; //indicator.SetBinding (ActivityIndicator.IsRunningProperty, "IsLoading"); //indicator.SetBinding (ActivityIndicator.IsVisibleProperty, "IsLoading"); stack_CoverPage = new StackLayout { WidthRequest=Width, HeightRequest = Width/4, //BackgroundColor=Color.Red, BackgroundColor=Colors.DarkGray.ToFormsColor(), }; img_User = new CircleImage { WidthRequest = Width/4, HeightRequest = Width/4, HorizontalOptions = LayoutOptions.Center, //BackgroundColor=Color.Yellow, TranslationY=-((Width/4)/2+10), Aspect=Aspect.Fill, Source="CircleImage.png", }; img_User.SetBinding(CircleImage.SourceProperty, "ImageSource", BindingMode.Default); ViewModel.ProfilePicture = img_User; btn_camera = new Image { Source="camera.png", WidthRequest=Width/8, HeightRequest=Height/8, HorizontalOptions=LayoutOptions.Start, VerticalOptions = LayoutOptions.Center, BackgroundColor=Xamarin.Forms.Color.Red, }; var Cameratap = new TapGestureRecognizer(OnCameraTapped); btn_camera.IsEnabled = true; btn_camera.GestureRecognizers.Clear(); btn_camera.GestureRecognizers.Add(Cameratap); btn_gallery = new Image { Source="gallery.png", WidthRequest=Width/8, HeightRequest=Height/8, HorizontalOptions=LayoutOptions.End, VerticalOptions = LayoutOptions.Center, BackgroundColor=Xamarin.Forms.Color.Green, }; var Gallerytap = new TapGestureRecognizer(OnGalleryTapped); btn_gallery.IsEnabled = true; btn_gallery.GestureRecognizers.Clear(); btn_gallery.GestureRecognizers.Add(Gallerytap); stack_pop = new StackLayout { HeightRequest = Width / 2, WidthRequest = Width / 2, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, BackgroundColor = Xamarin.Forms.Color.White, TranslationY=Width / 2, Opacity = 1, Children = { new StackLayout { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Orientation = StackOrientation.Horizontal, TranslationY=Width/6, Children= { btn_camera, btn_gallery } } } }; stack_popup = new StackLayout { WidthRequest = Width, HeightRequest = Height, BackgroundColor=Xamarin.Forms.Color.Transparent, Children= { stack_pop } }; image_bg = new Image { WidthRequest = Width, HeightRequest = Height, HorizontalOptions=LayoutOptions.FillAndExpand, VerticalOptions=LayoutOptions.FillAndExpand, Source="bg.png", IsVisible=false }; var PopUpGestureRecognizer = new TapGestureRecognizer { //ViewModel.SelectPictureCommand.Execute(null); Command = new Command (() => { //ViewModel.SelectPictureCommand.Execute(null); var eAndN = new Tuple<Easing, string>[] { new Tuple<Easing, string> (Easing.Linear, "Linear") }; double w = Width; double h = Height; var newPos = new Rectangle(0, h, w, h); var eAndName = eAndN[iClicks]; var easing = eAndName.Item1; stack_popup.LayoutTo(newPos, 80, easing); iClicks %= eAndN.Length; image_bg.IsVisible=false; }), NumberOfTapsRequired = 1 }; stack_popup.GestureRecognizers.Add(PopUpGestureRecognizer); var ProfilePictureGestureRecognizer = new TapGestureRecognizer { //ViewModel.SelectPictureCommand.Execute(null); Command = new Command (() => { var eAndN = new Tuple<Easing, string>[] { new Tuple<Easing, string> (Easing.Linear, "Linear") }; double w = Width; double h = Height; var newPos = new Rectangle(0, 0, w, h); var eAndName = eAndN[iClicks]; var easing = eAndName.Item1; stack_popup.LayoutTo(newPos, 80, easing); iClicks %= eAndN.Length; image_bg.IsVisible=true; }), NumberOfTapsRequired = 1 }; img_User.GestureRecognizers.Add(ProfilePictureGestureRecognizer); txt_Name = new EditText { WidthRequest = Width, HorizontalOptions = LayoutOptions.Center, Placeholder="FullName", TextColor=Colors.DarkGray.ToFormsColor(), BackgroundColor=Xamarin.Forms.Color.Transparent, HeightRequest=Width/10, }; txt_Name.SetBinding(Entry.TextProperty, "UserRegInfo.name"); txt_Email = new EditText { WidthRequest = Width, HorizontalOptions = LayoutOptions.Center, Keyboard=Keyboard.Email, Placeholder="Email", TextColor=Colors.DarkGray.ToFormsColor(), BackgroundColor=Xamarin.Forms.Color.Transparent, HeightRequest=Width/10 }; txt_Email.SetBinding(Entry.TextProperty, "UserRegInfo.email"); txt_Password = new EditText { WidthRequest = Width, HorizontalOptions = LayoutOptions.Center, IsPassword=true, Placeholder="Password", TextColor=Colors.DarkGray.ToFormsColor(), BackgroundColor=Xamarin.Forms.Color.Transparent, HeightRequest=Width/10 }; txt_Password.SetBinding(Entry.TextProperty, "UserRegInfo.password"); picker_Country = new CustomPicker { WidthRequest = Width, HorizontalOptions = LayoutOptions.Center, Title="Location", HeightRequest=Width/10, BackgroundColor=Xamarin.Forms.Color.Transparent, }; picker_Country.SelectedIndexChanged+=((sender, e) => { ViewModel.SelectedIndex=picker_Country.SelectedIndex; }); btn_Submit= new Button { WidthRequest = Width/2, HorizontalOptions = LayoutOptions.Center, HeightRequest=Width/8, Text="Submit", FontSize=17, TextColor=Xamarin.Forms.Color.White, BackgroundColor=Colors.DarkGray.ToFormsColor(), //CommandParameter = 1, Command= ViewModel.RegisterUser, }; stack_TopView = new StackLayout { HorizontalOptions = LayoutOptions.Fill, HeightRequest=Width/3, Padding= new Thickness(0,0,0,Height/45), //BackgroundColor=Color.Blue, Children= { stack_CoverPage,img_User } }; lbl_Expert = new Label { Text="Experts", FontSize=18, TextColor=Colors.DarkGray.ToFormsColor(), FontAttributes=FontAttributes.Bold }; stack_MiddleView = new StackLayout { HorizontalOptions = LayoutOptions.Center, VerticalOptions=LayoutOptions.StartAndExpand, Padding= new Thickness(Width/8,Height/40,Width/8,0), //BackgroundColor=Color.Pink, Spacing=Height/45, Children= { txt_Name,txt_Email,txt_Password,picker_Country,lbl_Expert } }; img_iOS = new Image { WidthRequest=Width/7, HeightRequest=Width/7, HorizontalOptions=LayoutOptions.Start, Source="iOS.png", BackgroundColor=Colors.DarkGray.ToFormsColor(), IsEnabled=false }; var iOStap = new TapGestureRecognizer(OniOSTapped); iOStap.NumberOfTapsRequired = 1; img_iOS.IsEnabled = true; img_iOS.GestureRecognizers.Clear(); img_iOS.GestureRecognizers.Add(iOStap); img_Certified = new Image { WidthRequest=Width/7, HeightRequest=Width/7, HorizontalOptions=LayoutOptions.Center, Source="Certified.png", BackgroundColor=Colors.DarkGray.ToFormsColor(), IsEnabled=false }; var Certifiedtap = new TapGestureRecognizer(OnCertifiedTapped); img_Certified.IsEnabled = true; img_Certified.GestureRecognizers.Clear(); img_Certified.GestureRecognizers.Add(Certifiedtap); img_Android = new Image { WidthRequest=Width/7, HeightRequest=Width/7, HorizontalOptions=LayoutOptions.End, Source="Android.png", BackgroundColor=Colors.DarkGray.ToFormsColor(), IsEnabled=false }; var Androidtap = new TapGestureRecognizer(OnAndroidTapped); Androidtap.NumberOfTapsRequired = 1; img_Android.IsEnabled = true; img_Android.GestureRecognizers.Clear(); img_Android.GestureRecognizers.Add(Androidtap); img_Forms = new Image { WidthRequest=Width/7, HeightRequest=Width/7, HorizontalOptions=LayoutOptions.Start, Source="Forms.png", BackgroundColor=Colors.DarkGray.ToFormsColor(), IsEnabled=false }; var Formstap = new TapGestureRecognizer(OnFormsTapped); img_Forms.IsEnabled = true; img_Forms.GestureRecognizers.Clear(); img_Forms.GestureRecognizers.Add(Formstap); img_Insights = new Image { WidthRequest=Width/7, HeightRequest=Width/7, HorizontalOptions=LayoutOptions.Center, Source="Insight.png", BackgroundColor=Colors.DarkGray.ToFormsColor(), IsEnabled=false }; var Insightstap = new TapGestureRecognizer(OnInsightTapped); img_Insights.IsEnabled = true; img_Insights.GestureRecognizers.Clear(); img_Insights.GestureRecognizers.Add(Insightstap); img_Testcloud = new Image { WidthRequest=Width/7, HeightRequest=Width/7, HorizontalOptions=LayoutOptions.End, Source="TestCloud.png", BackgroundColor=Colors.DarkGray.ToFormsColor(), IsEnabled=false }; var Testcloudtap = new TapGestureRecognizer(OnTestCloudTapped); img_Testcloud.IsEnabled = true; img_Testcloud.GestureRecognizers.Clear(); img_Testcloud.GestureRecognizers.Add(Testcloudtap); stack_FirstExpert = new StackLayout { HorizontalOptions=LayoutOptions.Center, VerticalOptions=LayoutOptions.StartAndExpand, Orientation=StackOrientation.Horizontal, //BackgroundColor=Color.Yellow, Spacing=Height/40, Children= { img_iOS,img_Certified,img_Android } }; stack_SecondExpert = new StackLayout { HorizontalOptions=LayoutOptions.Center, VerticalOptions=LayoutOptions.StartAndExpand, Orientation=StackOrientation.Horizontal, //BackgroundColor=Color.Red, Spacing=Height/40, Children= { img_Forms,img_Insights,img_Testcloud } }; StackLayout stack_MainLayout = new StackLayout { HorizontalOptions = LayoutOptions.StartAndExpand, VerticalOptions=LayoutOptions.Fill, //BackgroundColor=Color.Aqua, Spacing=Width/25, Children= { stack_MiddleView,stack_FirstExpert,stack_SecondExpert,btn_Submit } }; scroll_Main = new ScrollView { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions=LayoutOptions.Start, }; scroll_Main.Content=stack_MainLayout; mainLayout = new StackLayout { HorizontalOptions = LayoutOptions.Fill, VerticalOptions=LayoutOptions.End, BackgroundColor=Xamarin.Forms.Color.White, WidthRequest=Width, HeightRequest=Height, Children = { stack_TopView,scroll_Main } }; rltv_main = new RelativeLayout { WidthRequest = Width, HeightRequest = Height }; rltv_main.Children.Add(mainLayout, Constraint.Constant(0), Constraint.Constant(0),Constraint.Constant(Width),Constraint.Constant(Height)); rltv_main.Children.Add(image_bg, Constraint.Constant(0), Constraint.Constant(0),Constraint.Constant(Width),Constraint.Constant(Height)); rltv_main.Children.Add(stack_popup, Constraint.Constant(0), Constraint.Constant(Height),Constraint.Constant(Width),Constraint.Constant(Height)); this.Content = rltv_main; }
public VetCell() { var vetProfileImage = new CircleImage { BorderColor = App.BrandColor, BorderThickness = 2, HeightRequest = 50, WidthRequest = 50, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, }; vetProfileImage.SetBinding(Image.SourceProperty, "ImageSource"); var nameLabel = new Label() { FontFamily = "HelveticaNeue-Medium", FontSize = 18, TextColor = Color.Black }; nameLabel.SetBinding(Label.TextProperty, "Name"); var distanceLabel = new Label() { FontAttributes = FontAttributes.Bold, FontSize = 12, TextColor = Color.FromHex("#666") }; distanceLabel.SetBinding( Label.TextProperty, new Binding( "Distance", stringFormat: "{0} Miles Away") ); // Online image and label var onlineImage = new Image() { Source = "online.png", HeightRequest = 8, WidthRequest = 8 }; onlineImage.SetBinding(Image.IsVisibleProperty, "ShouldShowAsOnline"); var onLineLabel = new Label() { Text = "Online", TextColor = App.BrandColor, FontSize = 12, }; onLineLabel.SetBinding(Label.IsVisibleProperty, "ShouldShowAsOnline"); // Offline image and label var offlineImage = new Image() { Source = "offline.png", HeightRequest = 8, WidthRequest = 8 }; offlineImage.SetBinding(Image.IsVisibleProperty, "ShouldShowAsOffline"); var offLineLabel = new Label() { Text = "5 hours ago", TextColor = Color.FromHex("#ddd"), FontSize = 12, }; offLineLabel.SetBinding(Label.IsVisibleProperty, "ShouldShowAsOffline"); // Vet rating label and star image var starLabel = new Label() { FontSize = 12, TextColor = Color.Gray }; starLabel.SetBinding(Label.TextProperty, "Stars"); var starImage = new Image() { Source = "star.png", HeightRequest = 12, WidthRequest = 12 }; var ratingStack = new StackLayout() { Spacing = 3, Orientation = StackOrientation.Horizontal, Children = { starImage, starLabel } }; var statusLayout = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { distanceLabel, onlineImage, onLineLabel, offlineImage, offLineLabel } }; var vetDetailsLayout = new StackLayout { Padding = new Thickness(10, 0, 0, 0), Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { nameLabel, statusLayout, ratingStack } }; var tapImage = new Image() { Source = "tap.png", HorizontalOptions = LayoutOptions.End, HeightRequest = 12, }; var cellLayout = new StackLayout { Spacing = 0, Padding = new Thickness(10, 5, 10, 5), Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { vetProfileImage, vetDetailsLayout, tapImage } }; this.View = cellLayout; }
/// <summary> /// Method that creates the page content /// </summary> public View SetContent() { var emblem = new Image { HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Start, HeightRequest = 160 }; emblem.SetBinding(Image.SourceProperty, UploadingViewModel.EmblemProperty); var spinner = new CircleImage { Source = "Resources/spinner.gif", HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Start, }; spinner.SetBinding(Image.SourceProperty, UploadingViewModel.SpinnerProperty); var text = new Label { TextColor = Color.FromHex(Definitions.DefaultTextColor), FontSize = Definitions.HeaderFontSize - 12, HorizontalOptions = LayoutOptions.CenterAndExpand, YAlign = TextAlignment.Center, }; text.SetBinding(Label.TextProperty, UploadingViewModel.UploaderTextProperty); text.SetBinding(Label.IsVisibleProperty, UploadingViewModel.UploadingTextVisibilityProperty); var img = new Image { HeightRequest = 120, WidthRequest = 120, HorizontalOptions = LayoutOptions.Center, }; img.SetBinding(Image.RotationProperty, UploadingViewModel.RotateProperty); img.SetBinding(Image.SourceProperty, UploadingViewModel.SpinnerProperty); img.SetBinding(Image.IsVisibleProperty, UploadingViewModel.UploadingSpinnerVisibilityProperty); var loadingStack = new StackLayout { Orientation = StackOrientation.Vertical, BackgroundColor = Color.FromHex(Definitions.BackgroundColor), VerticalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0, 20, 0, 0), Spacing = 60, Children = { img, text, } }; var layout = new StackLayout { Orientation = StackOrientation.Vertical, BackgroundColor = Color.FromHex(Definitions.BackgroundColor), VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(10, 70, 10, 10), Children = { emblem, loadingStack, ErrorStack(), } }; return layout; }