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(30) }, }; var label = new Label() { Text = "User", 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); }
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 VetCell() { var vetProfileImage = new CircleImage { BorderColor = Color.FromHex ("#F2995D"), 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 = Color.FromHex ("#F2995D"), 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; }
public StackLayout CreateRealtiveLayoutFor() { RelativeLayout MainView = new RelativeLayout { HorizontalOptions = LayoutOptions.Start, BackgroundColor = Xamarin.Forms.Color.Blue, Padding = new Thickness(1, 1, 1, 1), HeightRequest = 10, }; var CoverPage = new iiImage { HorizontalOptions = LayoutOptions.CenterAndExpand }; var CircleImage = new CircleImage { // BorderColor = Color.White.ToFormsColor(), // BorderThickness = 2, HorizontalOptions = LayoutOptions.Fill, }; CircleImage.SetBinding(Image.SourceProperty, "EmpProfileImage"); var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { Console.WriteLine("Yes Clicked"); }; CircleImage.GestureRecognizers.Add(tapGestureRecognizer); MainView.Children.Add(CoverPage, Constraint.Constant(0), Constraint.Constant(0), Constraint.RelativeToParent(parent => { return parent.Width; }), Constraint.RelativeToParent(parent => { return parent.Height; })); MainView.Children.Add(CircleImage, Constraint.Constant(0), Constraint.RelativeToView(CoverPage, (parent, sibling) => { return sibling.Height -50; }), Constraint.Constant(100), Constraint.Constant(100)); var st = new StackLayout { HeightRequest=150, Children = { MainView } }; return st; }
public PessoaViewCell() { var pessoaProfileImage = new CircleImage { BorderColor = AppColors.BrandColor(), BorderThickness = 2, HeightRequest = 50, WidthRequest = 50, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, }; pessoaProfileImage.SetBinding(Image.SourceProperty, "ImagemSource"); var distanciaLabel = new Label() { FontAttributes = FontAttributes.Bold, FontSize = 12, TextColor = Color.FromHex("#666") }; distanciaLabel.SetBinding( Label.TextProperty, new Binding( "Distancia", stringFormat: "{0} Kilometros ") ); var nomeLabel = new Label() { FontFamily = Device.OnPlatform("HelveticaNeue-Bold", "sans-serif-black", null), FontSize = 18, TextColor = Color.Black }; nomeLabel.SetBinding(Label.TextProperty, "Nome"); var onlineImage = new Image() { Source = ImageSource.FromResource(Constants.RetornarCaminhoParaImagens("online.png")), HeightRequest = 8, WidthRequest = 8 }; onlineImage.SetBinding(Image.IsVisibleProperty, "Online"); var onLineLabel = new Label() { FontFamily = Device.OnPlatform("HelveticaNeue-Bold", "sans-serif-black", null), Text = "Online", TextColor = AppColors.BrandColor(), FontSize = 12, }; onLineLabel.SetBinding(Label.IsVisibleProperty, "Online"); var offlineImage = new Image() { Source = ImageSource.FromResource(Constants.RetornarCaminhoParaImagens("offline.png")), HeightRequest = 8, WidthRequest = 8 }; offlineImage.SetBinding(Image.IsVisibleProperty, "Offline"); var offLineLabel = new Label() { FontFamily = Device.OnPlatform("HelveticaNeue-Bold", "sans-serif-black", null), Text = "5 horas atrás", TextColor = Color.FromHex("#ddd"), FontSize = 12, }; offLineLabel.SetBinding(Label.IsVisibleProperty, "Offline"); var starLabel = new Label() { FontFamily = Device.OnPlatform("HelveticaNeue-Bold", "sans-serif-black", null), FontSize = 12, TextColor = Color.Gray }; starLabel.SetBinding(Label.TextProperty, "Rating"); var starImage = new Image() { Source = ImageSource.FromResource(Constants.RetornarCaminhoParaImagens("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 = { distanciaLabel, onlineImage, onLineLabel, offlineImage, offLineLabel } }; var vetDetailsLayout = new StackLayout { Padding = new Thickness(10, 0, 0, 0), Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { nomeLabel, statusLayout, ratingStack } }; var tapImage = new Image() { Source = ImageSource.FromResource(Constants.RetornarCaminhoParaImagens("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 = { pessoaProfileImage, vetDetailsLayout, tapImage } }; this.View = cellLayout; }
public ContactCell() { var contactProfileImage = new CircleImage { BorderColor = Color.FromHex("#BDC3C7"), BorderThickness = 3, HeightRequest = 50, WidthRequest = 50, Aspect = Aspect.AspectFill, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, }; contactProfileImage.SetBinding(Image.SourceProperty, "ImageSource"); var nameLabel = new Label() { FontFamily = "HelveticaNeue-Medium", FontSize = 18, TextColor = Color.Black }; nameLabel.SetBinding(Label.TextProperty, "Name"); var companyLabel = new Label() { FontAttributes = FontAttributes.Bold, FontSize = 12, TextColor = Color.FromHex("#666") }; companyLabel.SetBinding(Label.TextProperty, new Binding("Company", stringFormat: "{0}")); var emailLabel = new Label() { FontSize = 12 }; emailLabel.SetBinding(Label.TextProperty, "Email"); var phoneLabel = new Label() { FontSize = 12, TextColor = Color.Gray }; phoneLabel.SetBinding(Label.TextProperty, "Phone"); var phoneStack = new StackLayout() { Spacing = 3, Orientation = StackOrientation.Horizontal, Children = { phoneLabel } }; var statusLayout = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { companyLabel, emailLabel } }; var detailLayout = new StackLayout { Padding = new Thickness(10, 0, 0, 0), Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { nameLabel, statusLayout, phoneStack } }; 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 = { contactProfileImage, detailLayout, tapImage }, }; this.View = cellLayout; }
public EmployeeViewCell() { var EmpImage = new CircleImage() { HorizontalOptions = LayoutOptions.Start, BorderThickness=5, //Source = "Dummy.jpg", BorderColor=Color.White.ToFormsColor(), Aspect=Aspect.Fill, }; EmpImage.SetBinding(Image.SourceProperty, new Binding("EmpProfileImage")); EmpImage.WidthRequest = EmpImage.HeightRequest = 40; var nameLabel = new Label { HorizontalOptions = LayoutOptions.Center, XAlign=TextAlignment.Center, TranslationX=5, TextColor=Xamarin.Forms.Color.White }; nameLabel.FontSize = 18; nameLabel.SetBinding(Label.TextProperty, "FullName"); View = new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.Start, Padding = new Thickness(5, 1.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.Center, Padding = new Thickness(5, 1.5, 0, 1.5), Children = { nameLabel } }, } }; }