Esempio n. 1
8
        /// <summary>
        /// Gets the table section.
        /// </summary>
        /// <returns>The table section.</returns>
        /// <param name="title">Title.</param>
        /// <param name="tshirts">Tshirts.</param>
        TableSection GetTableSection(string title, List<TShirt> tshirts)
        {
            var fsharpSection = new TableSection();
            fsharpSection.Title = title;
            foreach(var tshirt in tshirts)
            {
                var imageCell = new ImageCell { ImageSource = tshirt.Image, Text = tshirt.Name, Detail = tshirt.Detail, CommandParameter = tshirt };
                imageCell.Tapped += async (sender, e) => await Navigation.PushModalAsync(new OrderPage((TShirt)imageCell.CommandParameter));
                fsharpSection.Add(imageCell);
            }

            return fsharpSection;
        }
        public MyPage()
        {
            InitializeComponent();
            _tableView.Intent = TableIntent.Menu;

            var imageSection = new TableSection("One");
            var imageCell = new ImageCell();
            imageCell.ImageSource = ImageSource.FromResource("TestImageScrollBug.Images.contact_icon.png");
            imageSection.Add(imageCell);
            _tableRoot.Add(imageSection);

            var tableSection = new TableSection("Two");

            var textCell = new TextCell();
            textCell.Text = "blah1";
            tableSection.Add(textCell);

            var textCell1 = new TextCell();
            textCell1.Text = "blah1";
            tableSection.Add(textCell1);

            var textCell2 = new TextCell();
            textCell2.Text = "blah1";
            tableSection.Add(textCell2);

            var textCell3 = new TextCell();
            textCell3.Text = "blah1";
            tableSection.Add(textCell3);

            var textCell4 = new TextCell();
            textCell4.Text = "blah1";
            tableSection.Add(textCell4);

            var textCell5 = new TextCell();
            textCell5.Text = "blah1";
            tableSection.Add(textCell5);

            var textCell6 = new TextCell();
            textCell6.Text = "blah1";
            tableSection.Add(textCell6);

            var textCell7 = new TextCell();
            textCell7.Text = "blah1";
            tableSection.Add(textCell7);

            var textCell8 = new TextCell();
            textCell8.Text = "blah1";
            tableSection.Add(textCell8);

            var textCell9 = new TextCell();
            textCell9.Text = "blah1";
            tableSection.Add(textCell9);

            var textCell0 = new TextCell();
            textCell0.Text = "blah1";
            tableSection.Add(textCell0);

            _tableRoot.Add(tableSection);
        }
Esempio n. 3
0
        public GamePage()
        {
            var message = new Label {
                Text = "Click the unicorn!"
            };

            UpdateTimeLabel ();

            var unicorn = new ImageCell {
                ImageSource = ImageSource.FromFile ("Unicorn.png"),
            };

            unicorn.Tapped += (sender, e) => {
                if(_playing){
                    _clickCount++;
                    message.Text = string.Format ("Clicked {0} times", _clickCount);
                }
            };

            Content = new StackLayout {
                VerticalOptions = LayoutOptions.Center,
                Children = {
                    new TableView {
                        Intent = TableIntent.Form,
                        RowHeight = 300,
                        Root = new TableRoot { new TableSection { unicorn } }
                    },
                    message,
                    _timeLabel
                }
            };

            Device.StartTimer (TimeSpan.FromSeconds (1), HandleSecondTick);
        }
		public FormIntentCode ()
		{
			this.Title = "Form Intent";
			var table = new TableView () { Intent = TableIntent.Form };
			var root = new TableRoot ();
			var section1 = new TableSection () {Title = "First Section"};
			var section2 = new TableSection () {Title = "Second Section"};

			var text = new TextCell { Text = "TextCell", Detail = "TextCell Detail" };
			var entry = new EntryCell { Text = "EntryCell Text", Label = "Entry Label" };
			var switchc = new SwitchCell { Text = "SwitchCell Text" };
			var image = new ImageCell { Text = "ImageCell Text", Detail = "ImageCell Detail", ImageSource = "XamarinLogo.png" };

			section1.Add (text); 
			section1.Add (entry);
			section1.Add (switchc);
			section1.Add (image);
			section2.Add (text);
			section2.Add (entry);
			section2.Add (switchc);
			section2.Add (image);
			table.Root = root;
			root.Add (section1);
			root.Add (section2);

			Content = table;
		}
Esempio n. 5
0
        private async void PopulateContacts()
        {
            var vm = (MainViewModel)this.BindingContext;
            await vm.HydrateContactsMainViewModel();

            this.Contacts.HasUnevenRows = true;
            this.Contacts.ItemsSource = vm.Contacts;
            this.Contacts.WidthRequest = ((Page)this).Width * 7 / 8;
            this.Contacts.HeightRequest = ((Page)this).Height * 2 / 3;
            this.ContactsBG.WidthRequest = ((Page)this).Width * 7 / 8;
            this.ContactsBG.HeightRequest = ((Page)this).Height * 10 / 25;
            this.Contacts.HorizontalOptions = LayoutOptions.Center;
            this.Contacts.ItemTapped += (s, e) => Navigation.PushModalAsync(
                new ContactDetailView
                {
                    ContactDetailsVm = new ContactDetailsViewModel(
                        ((ListView)
                            s).SelectedItem as Contact)
                }, false);
            this.Contacts.ItemTemplate = new DataTemplate(() =>
            {
                var what = new ImageCell();
                what.SetBinding(ImageCell.TextProperty, "Name");
                what.SetBinding(ImageCell.ImageSourceProperty, "PicUrl");
                what.SetBinding(ImageCell.DetailProperty, "Phone");
                vm.IsBusy = false;
                return what;
            });
        }
Esempio n. 6
0
        public MasterPage()
        {
            var masterPageItems = new List<MasterPageItem> ();
            masterPageItems.Add (new MasterPageItem {
                Title = "Profil",
                //IconSource = "contacts.png",
                TargetType = typeof(ProfilPage)
            });
            masterPageItems.Add (new MasterPageItem {
                Title = "Actualités",
                //IconSource = "Actualite.png",
                TargetType = typeof(ActualitePage)
            });
            masterPageItems.Add (new MasterPageItem {
                Title = "Calendrier",
                //IconSource = "contacts.png",
                TargetType = typeof(CalendrierPage)
            });
            masterPageItems.Add (new MasterPageItem {
                Title = "Maps",
                //IconSource = "reminders.png",
                TargetType = typeof(MapPage)
            });
            masterPageItems.Add (new MasterPageItem {
                Title = "Messagerie",
                //IconSource = "todo.png",
                TargetType = typeof(DefaultPage)
            });
            masterPageItems.Add (new MasterPageItem {
                Title = "Deconnexion",
                //IconSource = "todo.png",
                TargetType = typeof(DeconnexionPage)

            });

            listView = new ListView {
                ItemsSource = masterPageItems,
                ItemTemplate = new DataTemplate (() => {
                    var imageCell = new ImageCell ();
                    imageCell.SetBinding (TextCell.TextProperty, "Title");
                    imageCell.SetBinding (ImageCell.ImageSourceProperty, "IconSource");
                    return imageCell;
                }),
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            Padding = new Thickness (0, 40, 0, 0);
            //Icon = "hamburger.png";
            Title = "Menu";
            Content = new StackLayout {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = {
                    listView
                }
            };
        }
        public ActiveChatsPage(ViewModelBase viewModel)
            : base(viewModel)
        {
            var listView = new BindableListView
            {
                ItemTemplate = new DataTemplate(() =>
                    {
                        var imageCell = new ImageCell();
                        imageCell.SetBinding(ImageCell.TextProperty, new Binding("Name"));
                        imageCell.SetBinding(ImageCell.DetailProperty, new Binding("DescriptionText"));
                        imageCell.SetBinding(ImageCell.ImageSourceProperty, new Binding("Image"));
                        imageCell.TextColor = Styling.CellTitleColor;
                        imageCell.DetailColor = Styling.CellDetailColor;
                        return imageCell;
                    }),
                SeparatorVisibility = SeparatorVisibility.None
            };

            listView.SetBinding(ListView.ItemsSourceProperty, new Binding("ActiveChats"));
            listView.SetBinding(BindableListView.ItemClickedCommandProperty, new Binding("SelectActiveChatCommand"));
            listView.SetBinding(ListView.IsVisibleProperty, new Binding("HasConversations", BindingMode.OneWay));

            var noItemsLabel = new Label {
                Text = "Start a conversation or open a room!",
                HorizontalOptions = LayoutOptions.Center,
                FontSize = 16,
                TextColor = Color.Gray
            };
            var noItemsLayout = new StackLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Children =
                {
                    new BoxView{HeightRequest = 20},
                    noItemsLabel
                }
            };
            noItemsLayout.SetBinding(StackLayout.IsVisibleProperty, new Binding("HasConversations", BindingMode.OneWay, converter: new InverterConverter()));

            var loadingIndicator = new ActivityIndicator ();
            loadingIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy"));
            loadingIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, new Binding("IsBusy"));

            Content = new StackLayout
            {
                Children =
                {
                    loadingIndicator,
                    listView,
                    noItemsLayout
                }
            };
        }
 private static Action <IShadow, ImageSource> GetSetAction(IShadow <Xamarin.Forms.Element> shadow)
 {
     return(shadow.Item switch
     {
         Xamarin.Forms.Button _ => ImageSourceMappers.Button,
         Xamarin.Forms.Image _ => ImageSourceMappers.Image,
         Xamarin.Forms.ToolbarItem _ => ImageSourceMappers.ToolbarItem,
         Xamarin.Forms.ImageButton _ => ImageSourceMappers.ImageButton,
         Xamarin.Forms.ImageCell _ => ImageSourceMappers.ImageCell,
         _ => throw new ArgumentException()
     });
 public HistoryListView()
 {
     Description = "";
     CodeIndex = 0;
     ItemTemplate = new DataTemplate (() => {
         var cell = new ImageCell ();
         cell.ImageSource = ImageSource.FromFile ("upload.png");
         cell.SetBinding (TextCell.TextProperty, "Header");
         cell.SetBinding (TextCell.DetailProperty, "Description");
         return cell;
     });
 }
        public MainMasterPage()
        {
            InitializeComponent();

            var masterPageItems = new List<MasterPageItem>();
            masterPageItems.Add(new MasterPageItem
            {
                Title = "Recherche de projet",
                //IconSource = "contacts.png",
                TargetType = typeof(MainPage)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = "Mon profil",
                TargetType =  typeof(Profil)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = "Map",
                TargetType = typeof(Map)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = "Ajouter un projet",
                TargetType = typeof(AddProjectPage)
            });

            listView = new ListView
            {
                ItemsSource = masterPageItems,
                ItemTemplate = new DataTemplate(() => {
                    var imageCell = new ImageCell();
                    imageCell.SetBinding(TextCell.TextProperty, "Title");
                    return imageCell;
                }),
                VerticalOptions = LayoutOptions.FillAndExpand,
            };

            Padding = new Thickness(0, 40, 0, 0);
            Title = "Menu";
            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = {
                    listView
                }
            };
        }
Esempio n. 11
0
        public OnlineUsersPage(ViewModelBase viewModel)
            : base(viewModel)
        {
            var usersCountLabel = new SquawkLabel () {
            };
            usersCountLabel.SetBinding(Label.TextProperty, new Binding("Users.Count", stringFormat: "     {0} users online"));

            var filterEntry = new SquawkEntry () {
                Placeholder = "Filter...",
            };
            filterEntry.SetBinding (Entry.TextProperty, new Binding ("FilterText"));

            var listView = new BindableListView
                {
                    ItemTemplate = new DataTemplate(() =>
                        {
                            var imageCell = new ImageCell
                                {
                                    ImageSource = Styling.ContactIcon
                                };
                            imageCell.SetBinding(TextCell.TextProperty, new Binding("Name"));
                            imageCell.SetBinding(TextCell.DetailProperty, new Binding("Description"));
                            imageCell.TextColor = Styling.CellTitleColor;
                            imageCell.DetailColor = Styling.CellDetailColor;
                            return imageCell;
                        })
                };

            listView.SetBinding(ListView.ItemsSourceProperty, new Binding("UsersDisplay"));
            listView.SetBinding(BindableListView.ItemClickedCommandProperty, new Binding("SelectUserCommand"));

            var loadingIndicator = new ActivityIndicator ();
            loadingIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy"));
            loadingIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, new Binding("IsBusy"));

            Content = new StackLayout {
                Children = {
                    new StackLayout {Children =
                        {
                            usersCountLabel,
                            filterEntry,
                            loadingIndicator
                        },
                        BackgroundColor = Styling.SubheaderYellow,
                        Padding = new Thickness(3)
                    },
                    listView
                }
            };
        }
Esempio n. 12
0
        public InviteToAppPage(ViewModelBase viewModel)
            : base(viewModel)
        {
            Title = "Contacts";

            var contactsCountLabel = new SquawkLabel();
            contactsCountLabel.SetBinding(Label.TextProperty, new Binding("Contacts.Count", stringFormat: "{0} contacts."));

            var tipLabel = new SquawkLabel();
            tipLabel.Text = "Select a contact to send an invitation";

            var listView = new BindableListView
                {
                    ItemTemplate = new DataTemplate(() =>
                        {
                            var imageCell = new ImageCell
                                {
                                    ImageSource = Device.OnPlatform(
                                        ImageSource.FromFile("empty_contact.jpg"),
                                        ImageSource.FromFile("empty_contact.jpg"),
                                        ImageSource.FromFile("Assets/empty_contact.jpg")),
                                };
                            imageCell.SetBinding(TextCell.TextProperty, new Binding("Name"));
                            imageCell.SetBinding(TextCell.DetailProperty, new Binding("Number"));
                            return imageCell;
                        }),
                    IsGroupingEnabled = true,
                    GroupDisplayBinding = new Binding("Name"),
                };

            listView.SetBinding(ListView.ItemsSourceProperty, new Binding("GroupedContacts"));
            listView.SetBinding(BindableListView.ItemClickedCommandProperty, new Binding("ContactSelectedCommand"));

            var loadingIndicator = new ActivityIndicator();
            loadingIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy"));

            Content = new StackLayout
                {
                    Children =
                        {
                            loadingIndicator,
                            contactsCountLabel,
                            tipLabel,
                            listView
                        }
                };
        }
		public MasterPage ()
		{
			var masterPageItems = new List<MasterPageItem> ();
			masterPageItems.Add (new MasterPageItem {
				Title = "Contacts",
				IconSource = "contacts.png",
				TargetType = typeof(ContactsPage)
			});
			masterPageItems.Add (new MasterPageItem {
				Title = "TodoList",
				IconSource = "todo.png",
				TargetType = typeof(TodoListPage)
			});
			masterPageItems.Add (new MasterPageItem {
				Title = "Reminders",
				IconSource = "reminders.png",
				TargetType = typeof(ReminderPage)
			});

			listView = new ListView {
				ItemsSource = masterPageItems,
				ItemTemplate = new DataTemplate (() => {
					var imageCell = new ImageCell ();
					imageCell.SetBinding (TextCell.TextProperty, "Title");
					imageCell.SetBinding (ImageCell.ImageSourceProperty, "IconSource");
					return imageCell;
				}),
				VerticalOptions = LayoutOptions.FillAndExpand,
				SeparatorVisibility = SeparatorVisibility.None
			};

			Padding = new Thickness (0, 40, 0, 0);
			Icon = (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone) ? "swap.png" : "hamburger.png";

			Title = "Personal Organiser";
			Content = new StackLayout {
				VerticalOptions = LayoutOptions.FillAndExpand,
				Children = {
					listView
				}	
			};
		}
        public OnlineUsersPage(ViewModelBase viewModel) : base(viewModel)
        {
            Title = "Participants";
            Icon = "group.png";

            var usersCountLabel = new Label();
            usersCountLabel.SetBinding(Label.TextProperty, new Binding("Users.Count", stringFormat: "  {0} users online."));
            
            var listView = new BindableListView
                {
                    ItemTemplate = new DataTemplate(() =>
                        {
                            var imageCell = new ImageCell
                                {
                                    ImageSource = Device.OnPlatform(
                                        ImageSource.FromFile("empty_contact.jpg"),
                                        ImageSource.FromFile("empty_contact.jpg"),
                                        ImageSource.FromFile("Assets/empty_contact.jpg")),
                                };
                            imageCell.SetBinding(TextCell.TextProperty, new Binding("Name"));
                            imageCell.SetBinding(TextCell.DetailProperty, new Binding("Description"));
                            return imageCell;
                        })
                };

            listView.SetBinding(ListView.ItemsSourceProperty, new Binding("Users"));
            listView.SetBinding(BindableListView.ItemClickedCommandProperty, new Binding("ContactSelectedCommand"));

            var contactsLoadingIndicator = new ActivityIndicator();
            contactsLoadingIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy"));

            Content = new StackLayout
                {
                    Children =
                            {
                                contactsLoadingIndicator,
                                usersCountLabel,
                                listView
                            }
                };
        }
Esempio n. 15
0
        private void Foo()
        {

            ImageCell cell = new ImageCell
            {
                ImageSource = null,
                Text = "hello ",

                
            };

            Page p = new Page
            {
                //BackgroundColor = "white",
            };

            var l = new Label
            {
                Font = Font.SystemFontOfSize(NamedSize.Micro),
            };

            var e = new Entry()
            {

                Keyboard = Keyboard.Numeric,
                VerticalOptions = LayoutOptions.FillAndExpand,
            };


            var c = new ContentView()
            {
                Padding = new Thickness(5),
            };

            var sl = new StackLayout
            {
                Padding = new Thickness(5),
            };
        }
Esempio n. 16
0
        public MasterpageMoma()
        {
            var masterPageItems = new List<MasterPageItem>();
            masterPageItems.Add(new MasterPageItem
            {
                Title = AppLanguageResource.Map,
                IconSource = "ic_action_navigate.png",
                TargetType = typeof(MapMoma)
            });
            masterPageItems.Add(new MasterPageItem
            {
                Title = AppLanguageResource.Storyline,
                IconSource = "ic_action_map.png",
                TargetType = typeof(StorylineMoma)
            });
            masterPageItems.Add(new MasterPageItem
            {
                Title = AppLanguageResource.Scavenger,
                IconSource = "ic_action_search.png",
                TargetType = typeof(ScavengerPageMoma)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = AppLanguageResource.Directions,
                IconSource = "ic_action_compass.png",
                TargetType = typeof(DirectionMoma)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = AppLanguageResource.Contact,
                IconSource = "ic_action_phone.png",
                TargetType = typeof(ContactMoma)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = AppLanguageResource.Help,
                IconSource = "ic_action_help.png",
                TargetType = typeof(HelpMoma)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = AppLanguageResource.Settings,
                IconSource = "ic_action_settings.png",
                TargetType = typeof(SettingsMoma)
            });

            listView = new ListView
            {
                ItemsSource = masterPageItems,
                ItemTemplate = new DataTemplate(() => {
                    var imageCell = new ImageCell();
                    imageCell.SetBinding(TextCell.TextProperty, "Title");
                    imageCell.TextColor = Color.White;
                    imageCell.SetBinding(ImageCell.ImageSourceProperty, "IconSource");
                    return imageCell;
                }),
                VerticalOptions = LayoutOptions.FillAndExpand,
        };

            Padding = new Thickness(10, 10, 0, 0);
            Icon = "menu_icon.png";
            Title = "Master";
            BackgroundColor = Color.FromHex("#001533");
            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
            Children = { 
                    listView
                }
            };
        }
 public static FluentImageCell ImageCell(ImageCell instance = null)
 {
     return new FluentImageCell (instance);
 }
Esempio n. 18
0
        public SettingPageCS()
        {
            #region // ライセンス

            #endregion

            var areaSetting = new ImageCell
            {
                ImageSource = "AreaSetting.png",
                Text = "地域設定",
                TextColor = Device.OnPlatform(Color.Default, Color.FromHex("666"), Color.Default),
                //Detail = "検索対象の都道府県を選択してください。",
                Command = new Command(async () => await Navigation.PushAsync(new AreaSettingPageXaml())),
            };
            // TODO: NG Word をカンマ区切りで作成しフィルタ対象にする
            // 2015/8/30: NGWords.cs 完成
            var ngSetting = new ImageCell
            {
                ImageSource = "NGSetting.png",
                Text = "NGワード設定",
                TextColor = Device.OnPlatform(Color.Default, Color.FromHex("666"), Color.Default),
                //Command = new Command(async () => await DisplayAlert("NG ワード", "現バージョンでは固定で\n\n恋活, 婚活, カップル, コンパ, お見合い, 合コン, 街コン, パーティ, Party, 副業, 起業, グルメ\n\nを NG ワードにしています。", "OK")),
                Command = new Command(async () => await Navigation.PushAsync(new NGWordsSettingPageCS())),
            };

            //var test = new TableSection();
            //test.Title = "Settings";

            var tv = new TableView
            {
                Intent = TableIntent.Form,
                Root = new TableRoot
                {
                    new TableSection("設定")
                    {
                        areaSetting,
                        ngSetting,
                    },
                    new TableSection("ヘルプ")
                    {
                        new TextCell
                        {
                            Text = "使い方(これから書く)",
                            TextColor = Device.OnPlatform(Color.Default, Color.FromHex("666"), Color.Default),
                            //Command = new Command(() => Device.OpenUri(new Uri("http://ytabuchi.hatenablog.com/entry/itstudysearch-help"))),
                        },
                        new TextCell {
                            Text = "プライバシーポリシー",
                            TextColor = Device.OnPlatform(Color.Default, Color.FromHex("666"), Color.Default),
                            Command = new Command(() => Device.OpenUri(new Uri("http://ytabuchi.hatenablog.com/entry/privacypolicies"))),
                        },
                        new TextCell {
                            Text = "著作権情報",
                            TextColor = Device.OnPlatform(Color.Default, Color.FromHex("666"), Color.Default),
                            Command = new Command(() => Navigation.PushAsync(new LicensePageCS())),
                        },
                    },
                    new TableSection("アプリケーション情報")
                    {
                        new ViewCell
                        {
                            View = new StackLayout
                            {
                                Orientation = StackOrientation.Horizontal,
                                HorizontalOptions = LayoutOptions.FillAndExpand,
                                Padding = new Thickness(19, 0),
                                Children =
                                {
                                    new Label
                                    {
                                        Text = "アプリケーション名",
                                        YAlign = TextAlignment.Center,
                                    },
                                    new Label
                                    {
                                        Text = "IT勉強会検索",
                                        YAlign = TextAlignment.Center,
                                        HorizontalOptions = LayoutOptions.EndAndExpand,
                                    },
                                }
                            }
                        },
                        new ViewCell
                        {
                            View = new StackLayout
                            {
                                Orientation = StackOrientation.Horizontal,
                                HorizontalOptions = LayoutOptions.FillAndExpand,
                                Padding = new Thickness(19, 0),
                                Children =
                                {
                                    new Label
                                    {
                                        Text = "バージョン",
                                        YAlign = TextAlignment.Center,
                                    },
                                    new Label
                                    {
                                        Text = "v 0.0.2",
                                        YAlign = TextAlignment.Center,
                                        HorizontalOptions = LayoutOptions.EndAndExpand,
                                    },
                                }
                            }
                        },
                        new ViewCell
                        {
                            View = new StackLayout
                            {
                                Orientation = StackOrientation.Horizontal,
                                HorizontalOptions = LayoutOptions.FillAndExpand,
                                Padding = new Thickness(19, 0),
                                Children =
                                {
                                    new Label
                                    {
                                        Text = "作成者",
                                        YAlign = TextAlignment.Center,
                                    },
                                    new Label
                                    {
                                        Text = "Yoshito Tabuchi",
                                        YAlign = TextAlignment.Center,
                                        HorizontalOptions = LayoutOptions.EndAndExpand,
                                    },
                                }
                            },
                        },

                    }
                }
            };

            Title = "このアプリについて";
            Content = tv;
        }
Esempio n. 19
0
        public MasterPage()
        {
            var masterPageItems = new List<MasterPageItem>();

            masterPageItems.Add(new MasterPageItem
            {
                Title = "Homepage",
                IconSource = "homepage.png",
                TargetType = typeof(HomePage)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = "Resources",
                IconSource = "play.png",
                TargetType = typeof(ResourcesTabbedSwipePage)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = "Conversations",
                IconSource = "chat.png",
                TargetType = typeof(ChatSelection)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = "Account",
                IconSource = "account.png",
                TargetType = typeof(AccountPage)
            });

            masterPageItems.Add(new MasterPageItem
            {
                Title = "Survey",
                IconSource = "survey.png",
                TargetType = typeof(Survey)
            });
            masterPageItems.Add(new MasterPageItem
            {
                Title = "About Us",
                IconSource = "about.png",
                TargetType = typeof(AboutPage)
            });

            //populate pull-out menu with above items
            listView = new ListView
            {
                ItemsSource = masterPageItems,
                ItemTemplate = new DataTemplate(() =>
                {
                    var imageCell = new ImageCell();
                    imageCell.SetValue(TextCell.TextColorProperty, Color.Black);
                    imageCell.SetValue(TextCell.TextProperty, FontAttributes.Bold);
                    imageCell.SetValue(TextCell.DetailColorProperty, Color.FromHex("B3B3B3"));
                    imageCell.SetBinding(TextCell.TextProperty, "Title");
                    imageCell.SetBinding(ImageCell.ImageSourceProperty, "IconSource");
                    return imageCell;
                }),
                VerticalOptions = LayoutOptions.FillAndExpand,
            };

            Icon = "drawable/menu.png";
            Title = "MENU";
            listView.RowHeight = 60;
            listView.BackgroundColor = Color.FromHex ("B3B3B3");
            Device.OnPlatform(Android: () => {
                listView.SeparatorVisibility = SeparatorVisibility.Default;
                listView.SeparatorColor = Color.FromHex("4D345D"); //separator between options
            },
            iOS: () => {
                listView.SeparatorVisibility = SeparatorVisibility.None;
                listView.SeparatorColor = Color.FromHex("4D345D"); //separator between options
            });

            var menuLabel = new ContentView
            {

                Padding = new Thickness(10, 10, 0, 10),
                Content = new Label
                {
                    TextColor = Color.Black,
                    FontSize = 18,
                    FontFamily = "Arial",
                    BackgroundColor = Color.FromHex("B3B3B3"),
                    Text = "MENU",
                }
            };

            var hotlineButton = new Button
            {
                Text = string.Format("Call Suicide Hotline")
            };
            hotlineButton.Clicked += (sender, args) => {
                Device.OpenUri(new Uri(string.Format("tel:{0}", "+1(800)2738255")));
            };

            var layout = new StackLayout
            {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor = Color.FromHex("B3B3B3")
            };
            layout.Children.Add(menuLabel);
            layout.Children.Add(
                new BoxView()
                { //Line under settings
                    Color = Color.FromHex("4D345D"),
                    HeightRequest = 6
                });

            layout.Children.Add(listView);
            layout.Children.Add(hotlineButton);
            Content = layout;
        }
		public SettingsPage(LanesViewModel viewModel)
		{
			BindingContext = viewModel;

			#region create the IsOpen Switch
			var isOpenSwitch = new SwitchCell
			{
				Text = "Is Open"
			};
			isOpenSwitch.SetBinding(SwitchCell.OnProperty,"LaneTappedIsOpen");
			#endregion

			#region Create the Needs Maintenance Switch
			var needsMaintenanceSwitch = new SwitchCell
			{
				Text = "Needs Maintenance"
			};
			needsMaintenanceSwitch.SetBinding(SwitchCell.OnProperty,"LaneTappedNeedsMaintenance");
			#endregion

			#region create the IP Address Entry
			var ipAddressText = new EntryCell
			{
				Label = "IP Address",
				HorizontalTextAlignment = TextAlignment.End
			};
			ipAddressText.SetBinding(EntryCell.TextProperty, "LaneTappedIPAddress");
			#endregion

			#region Create Image Cell
			var imageCell = new ImageCell();
			imageCell.SetBinding(ImageCell.ImageSourceProperty, "ImageCellIcon");
			#endregion

			#region Create the Icon Toggle Button
			var iconToggleButton = new Button();
			iconToggleButton.SetBinding(Button.CommandProperty, "IconToggleButton");
			iconToggleButton.SetBinding(Button.TextProperty, "ToggleButtonText");
			#endregion

			#region create the TableView
			var tableView = new TableView
			{
				Intent = TableIntent.Settings,
				Root = new TableRoot
				{
					new TableSection{
						isOpenSwitch,
						needsMaintenanceSwitch,
						ipAddressText,
						imageCell
					}
				}
			};
			#endregion

			#region Create StackLayout to Include a Button
			var settingsStack = new StackLayout
			{
				Children ={
					tableView,
					iconToggleButton
				}
			};
			#endregion

			NavigationPage.SetTitleIcon(this,"cogwheel_navigation");

			Title = $"Lane {viewModel.LanesList.IndexOf(viewModel.LaneTapped)+1} Settings";
			Content = settingsStack;
		}