public EditListAccount() { NavigationPage.SetHasBackButton(this, false); Label label = new TitleLabel { Text = "Список аккаунтов" }; Button button = new EndButton { Text = "Добавить" }; button.Clicked += AddBicycle; #region ListView list = new ListView { RowHeight = 220, }; list.ItemTapped += List_ItemTapped; list.ItemTemplate = new DataTemplate(() => { Label lIdAccount = new Label { FontSize = 14, }; lIdAccount.SetBinding(Label.TextProperty, new Binding { Path = "IdAccount", StringFormat = "ID: {0}", }); Label lName = new Label { FontSize = 14, }; lName.SetBinding(Label.TextProperty, new Binding { Path = "Name", StringFormat = "Имя: {0}", }); Label lSurname = new Label { FontSize = 14, }; lSurname.SetBinding(Label.TextProperty, new Binding { Path = "Surname", StringFormat = "Фамилия: {0}", }); Label lPrice = new Label { FontSize = 14, }; lPrice.SetBinding(Label.TextProperty, new Binding { Path = "Patronymic", StringFormat = "Отчество: {0}", }); Label lMoney = new Label { FontSize = 14, }; lMoney.SetBinding(Label.TextProperty, new Binding { Path = "Money", StringFormat = "Кол-во валюты: {0}", }); Label lAdmin = new Label { FontSize = 14, }; lAdmin.SetBinding(Label.TextProperty, new Binding { Path = "Admin", StringFormat = "Администратор: {0}", }); Image image = new Image { Aspect = Aspect.AspectFit }; image.SetBinding(Image.SourceProperty, new Binding { Path = "ImageLink" }); #region RelativeLayout RelativeLayout relative = new RelativeLayout { }; relative.Children.Add(image, Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => parent.Width * 0.075 + 150), Constraint.RelativeToParent((parent) => 150)); relative.Children.Add(lIdAccount, Constraint.RelativeToView(image, (parent, view) => view.X + view.Width + 10), Constraint.RelativeToView(image, (parent, view) => 5)); relative.Children.Add(lName, Constraint.RelativeToView(lIdAccount, (parent, view) => view.X), Constraint.RelativeToView(lIdAccount, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lSurname, Constraint.RelativeToView(lName, (parent, view) => view.X), Constraint.RelativeToView(lName, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lPrice, Constraint.RelativeToView(lSurname, (parent, view) => view.X), Constraint.RelativeToView(lSurname, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lMoney, Constraint.RelativeToView(lPrice, (parent, view) => view.X), Constraint.RelativeToView(lPrice, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lAdmin, Constraint.RelativeToView(lMoney, (parent, view) => view.X), Constraint.RelativeToView(lMoney, (parent, view) => view.Y + view.Height + 2)); #endregion return(new ViewCell { View = new Frame { Margin = 15, Content = relative, CornerRadius = 20, BackgroundColor = Color.LightSkyBlue, HeightRequest = 70 } }); }); #endregion Content = new StackLayout { Children = { label, list, button }, }; }
public BasketMovie(MainPage _main) { main = _main; NavigationPage.SetHasBackButton(this, false); Label label = new TitleLabel { Text = "Корзина" }; labelSum = new TitleLabel { HorizontalTextAlignment = TextAlignment.End, BackgroundColor = Color.Transparent }; Button button = new EndButton { Text = "Купить" }; button.Clicked += Buy; #region ListView list = new CollectionViewCustom { }; list.ItemsSource = main.GetBasketMovies; list.SelectionChanged += ListSpecial_ItemTapped; list.ItemTemplate = new DataTemplate(() => { Label lName = new Label { FontSize = 14, }; lName.SetBinding(Label.TextProperty, new Binding { Path = "Name", StringFormat = "Название: {0}", }); Label lSurname = new Label { FontSize = 14, }; lSurname.SetBinding(Label.TextProperty, new Binding { Path = "Surname", StringFormat = "Дата выхода: {0}", }); Label lPrice = new Label { FontSize = 14, }; lPrice.SetBinding(Label.TextProperty, new Binding { Path = "Price", StringFormat = "Цена: {0}", }); Image image = new Image { Aspect = Aspect.AspectFit }; image.SetBinding(Image.SourceProperty, new Binding { Path = "ImageLink" }); #region RelativeLayout RelativeLayout relative = new RelativeLayout { }; relative.Children.Add(image, Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => parent.Width * 0.25), Constraint.RelativeToParent((parent) => 150)); relative.Children.Add(lName, Constraint.RelativeToView(image, (parent, view) => view.X + view.Width + 10), Constraint.RelativeToView(image, (parent, view) => 5)); relative.Children.Add(lSurname, Constraint.RelativeToView(lName, (parent, view) => view.X), Constraint.RelativeToView(lName, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lPrice, Constraint.RelativeToView(lSurname, (parent, view) => view.X), Constraint.RelativeToView(lSurname, (parent, view) => view.Y + view.Height + 2)); #endregion return(new CustomFrameCollection { Content = relative }); }); #endregion Content = new StackLayout { Children = { label, list, labelSum, button }, }; }
public ListBuyMovie(MainPage _main) { main = _main; NavigationPage.SetHasBackButton(this, false); Label label = new TitleLabel { Text = "Купленные фильмы" }; listMovie = new CollectionViewCustom(); listMovie.ItemTemplate = new DataTemplate(() => { Label lName = new Label { FontSize = 14, }; lName.SetBinding(Label.TextProperty, new Binding { Path = "Name", StringFormat = "Наименование фильма: {0}", }); Label lDateCreate = new Label { FontSize = 14, }; lDateCreate.SetBinding(Label.TextProperty, new Binding { Path = "DateCreate", StringFormat = "Дата выпуска фильма: {0:dd/MM/yyyy}", }); Label lPrice = new Label { FontSize = 14, }; lPrice.SetBinding(Label.TextProperty, new Binding { Path = "Price", StringFormat = "Цена: {0}", }); Label lDateBuy = new Label { FontSize = 14, }; lDateBuy.SetBinding(Label.TextProperty, new Binding { Path = "DateBuy", StringFormat = "Дата покупки фильма: {0:dd/MM/yyyy}", }); Image image = new Image { Aspect = Aspect.AspectFit }; image.SetBinding(Image.SourceProperty, new Binding { Path = "ImageLink" }); #region RelativeLayout RelativeLayout relative = new RelativeLayout { }; relative.Children.Add(image, Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => parent.Width * 0.075 + 150), Constraint.RelativeToParent((parent) => 150)); relative.Children.Add(lName, Constraint.RelativeToView(image, (parent, view) => view.X + view.Width + 10), Constraint.RelativeToView(image, (parent, view) => 5)); relative.Children.Add(lDateCreate, Constraint.RelativeToView(lName, (parent, view) => view.X), Constraint.RelativeToView(lName, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lPrice, Constraint.RelativeToView(lDateCreate, (parent, view) => view.X), Constraint.RelativeToView(lDateCreate, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lDateBuy, Constraint.RelativeToView(lPrice, (parent, view) => view.X), Constraint.RelativeToView(lPrice, (parent, view) => view.Y + view.Height + 2)); #endregion return(new CustomFrameCollection { Content = relative }); }); Content = new StackLayout { Children = { label, listMovie } }; }
public PanelListMovie(MainPage _main) { main = _main; NavigationPage.SetHasBackButton(this, false); Label labelTitle = new TitleLabel { Text = "Список фильмов" }; listMovie = new CollectionViewCustom(); listMovie.ItemTemplate = new DataTemplate(() => { Label lName = new Label { FontSize = 14, }; lName.SetBinding(Label.TextProperty, new Binding { Path = "Name", StringFormat = "Наименование фильма: {0}", }); Label lSurname = new Label { FontSize = 14, }; lSurname.SetBinding(Label.TextProperty, new Binding { Path = "DateCreate", StringFormat = "Дата выпуска фильма: {0:dd/MM/yyyy}", }); Label lPrice = new Label { FontSize = 14, }; lPrice.SetBinding(Label.TextProperty, new Binding { Path = "Price", StringFormat = "Цена: {0}", }); Image image = new Image { Aspect = Aspect.AspectFit }; image.SetBinding(Image.SourceProperty, new Binding { Path = "ImageLink" }); #region RelativeLayout RelativeLayout relative = new RelativeLayout { }; relative.Children.Add(image, Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => parent.Width * 0.125 + 75), Constraint.RelativeToParent((parent) => 150)); relative.Children.Add(lName, Constraint.RelativeToView(image, (parent, view) => view.X + view.Width + 10), Constraint.RelativeToView(image, (parent, view) => 5)); relative.Children.Add(lSurname, Constraint.RelativeToView(lName, (parent, view) => view.X), Constraint.RelativeToView(lName, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lPrice, Constraint.RelativeToView(lSurname, (parent, view) => view.X), Constraint.RelativeToView(lSurname, (parent, view) => view.Y + view.Height + 2)); #endregion return(new CustomFrameCollection { Content = relative }); }); listMovie.SelectionChanged += ListSpecial_ItemTapped; RelativeLayout mainR = new RelativeLayout { }; #region mainR mainR.Children.Add(labelTitle, Constraint.RelativeToParent((parent) => 0), Constraint.RelativeToParent((parent) => 0), Constraint.RelativeToParent((parent) => parent.Width), Constraint.RelativeToParent((parent) => parent.Height * 0.08)); mainR.Children.Add(listMovie, Constraint.RelativeToParent((parent) => 0), Constraint.RelativeToView(labelTitle, (parent, view) => view.Height + view.Y), Constraint.RelativeToParent((parent) => parent.Width), Constraint.RelativeToParent((parent) => parent.Height * 0.92)); #endregion Content = mainR; }
public EditListMovie() { NavigationPage.SetHasBackButton(this, false); Label label = new TitleLabel { Text = "Список фильмов" }; Button button = new EndButton { Text = "Добавить" }; button.Clicked += AddBicycle; #region ListView list = new CollectionViewCustom { }; list.SelectionChanged += List_ItemTapped; list.ItemTemplate = new DataTemplate(() => { Label lIdAccount = new Label { FontSize = 14, }; lIdAccount.SetBinding(Label.TextProperty, new Binding { Path = "IdMovie", StringFormat = "ID BuyMovie: {0}", }); Label lName = new Label { FontSize = 14, }; lName.SetBinding(Label.TextProperty, new Binding { Path = "Name", StringFormat = "Наименование фильма: {0}", }); Label lSurname = new Label { FontSize = 14, }; lSurname.SetBinding(Label.TextProperty, new Binding { Path = "DateCreate", StringFormat = "Дата выпуска фильма: {0:dd/MM/yyyy}", }); Label lPrice = new Label { FontSize = 14, }; lPrice.SetBinding(Label.TextProperty, new Binding { Path = "Price", StringFormat = "Цена: {0}", }); Image image = new Image { Aspect = Aspect.AspectFit }; image.SetBinding(Image.SourceProperty, new Binding { Path = "ImageLink" }); #region RelativeLayout RelativeLayout relative = new RelativeLayout { }; relative.Children.Add(image, Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => - 5), Constraint.RelativeToParent((parent) => parent.Width * 0.075 + 150), Constraint.RelativeToParent((parent) => 150)); relative.Children.Add(lIdAccount, Constraint.RelativeToView(image, (parent, view) => view.X + view.Width + 10), Constraint.RelativeToView(image, (parent, view) => 5)); relative.Children.Add(lName, Constraint.RelativeToView(lIdAccount, (parent, view) => view.X), Constraint.RelativeToView(lIdAccount, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lSurname, Constraint.RelativeToView(lName, (parent, view) => view.X), Constraint.RelativeToView(lName, (parent, view) => view.Y + view.Height + 2)); relative.Children.Add(lPrice, Constraint.RelativeToView(lSurname, (parent, view) => view.X), Constraint.RelativeToView(lSurname, (parent, view) => view.Y + view.Height + 2)); #endregion return(new CustomFrameCollection { Content = relative }); }); #endregion Content = new StackLayout { Children = { label, list, button }, }; }