Ejemplo n.º 1
0
		public Settings ()
		{
			Title = "Settings";
			voiceCell=new SwitchCell(){Text="Voice files"};
			voiceCell.On = voice;

			soundCell=new SwitchCell(){Text="Sound effects"};
			soundCell.On = sound;
			TableView tableView = new TableView
			{
				Intent = TableIntent.Settings,
				Root = new TableRoot
				{
					new TableSection
					{
						voiceCell,
						soundCell
					}
				}
			};
			voiceCell.OnChanged+= VoiceCell_OnChanged;
			soundCell.OnChanged+= SoundCell_OnChanged;
		
			this.Content = new StackLayout
			{
				Children =
				{
					tableView
				}
			};
		}
Ejemplo n.º 2
0
		public MenuPage ()
		{
			Title = "LoginPattern";
			Icon = "slideout.png";

			var section = new TableSection () {
				new TextCell {Text = "Sessions"},
				new TextCell {Text = "Speakers"},
				new TextCell {Text = "Favorites"},
				new TextCell {Text = "Room Plan"},
				new TextCell {Text = "Map"},
			};

			var root = new TableRoot () {section} ;

			tableView = new TableView ()
			{ 
				Root = root,
				Intent = TableIntent.Menu,
			};

			var logoutButton = new Button { Text = "Logout" };
			logoutButton.Clicked += (sender, e) => {
				App.Current.Logout();
			};

			Content = new StackLayout {
				BackgroundColor = Color.Gray,
				VerticalOptions = LayoutOptions.FillAndExpand,
				Children = {
					tableView, 
					logoutButton
				}
			};
		}
Ejemplo n.º 3
0
		public ScheduleMenu (int mode=0)
		{
			schedules=new List<CustomCell>();
			NavigationPage.SetBackButtonTitle (this, "Back");
			Title = "Study Schedules";
			schedules.Add (new CustomCell(){Text="Table of study schedules"});
			schedules.Add (new CustomCell(){Text="勉強スケジュールの比較"});
			schedules.Add (new CustomCell(){Text="100-minute lessons"});
			schedules.Add (new CustomCell(){Text="90-minute lessons"});
			schedules.Add (new CustomCell(){Text="80-minute lessons"});
			schedules.Add (new CustomCell(){Text="60-minute lessons"});

			mainSection = new TableSection ();

			tableView = new TableView ();
			foreach(var schedule in schedules)
			{
				mainSection.Add (schedule);
				schedule.Tapped+= Schedule_Tapped;
			}

			tableView.Intent = TableIntent.Menu;
			tableView.Root = new TableRoot{ 
				mainSection,
			};

			Content = tableView;
		}
Ejemplo n.º 4
0
        public TableView1()
        {
            var tv = new TableView
            {
                Intent = TableIntent.Settings,
                Root = new TableRoot
                {
                    new TableSection("TableView")
                    {
                        new TextCell {
                            Text = "2-1",
                            //TextColor = Color.Red,
                            Command = new Command(async () => await Navigation.PushAsync(new Page21())),
                        },
                        new TextCell {
                            Text = "2-2",
                            //TextColor = Color.Blue,
                            Detail = "PushModal to Page 2-2",
                            //DetailColor = Color.Yellow,
                            Command = new Command(async ()=> await Navigation.PushModalAsync(new Page22())),
                        },
                    },
                }
            };

            Title = "TableView1";
            Content = tv;
        }
Ejemplo n.º 5
0
		public HelpPage ()
		{

			var helpOptions = new TableSection ("User Guide");
			foreach (string option in CONSTANTS.helpOptions) {
				var cell = new TextCell {
					Text = option, 
					TextColor = Color.White,
					Command = new Command (async o => await Application.Current.MainPage.Navigation.PushModalAsync (new HelpOptionPage(option[8]))),
				};

				helpOptions.Add (cell);
			}

			Title = "Help Page";
			Icon = "Help.png";

			TableRoot root = new TableRoot ();
			root.Add (helpOptions);
			TableView tableView = new TableView (root);

			var stackLayout = new StackLayout ();
			stackLayout.Children.Add (tableView);
			Content = stackLayout;

		}
Ejemplo n.º 6
0
        public SettingsPage(IFileRepository fileRepository, IExternalBrowserService externalBrowserService, ApplicationEvents applicationEvents)
        {
            Title = "Settings";
            _fileRepository = fileRepository;
            _applicationEvents = applicationEvents;

            InitializeStorageSettings(fileRepository);
            InitializeDropboxSettings(externalBrowserService, applicationEvents);

            var autoSyncValue = new EntryCell
            {
                Label = "Interval in minutes",
                IsEnabled = PersistedState.SyncInterval > 0,
                Text = PersistedState.SyncInterval > 0 ? PersistedState.SyncInterval.ToString() : string.Empty
            };
            var autoSyncSwitch = new SwitchCell
            {
                Text = "Auto sync",
                On = PersistedState.SyncInterval > 0
            };
            autoSyncSwitch.OnChanged += (sender, args) =>
            {
                if (args.Value)
                {
                    autoSyncValue.Text = "10";
                    autoSyncValue.IsEnabled = true;
                    SetSyncInterval(10);
                }
                else
                {
                    autoSyncValue.Text = string.Empty;
                    autoSyncValue.IsEnabled = false;
                    SetSyncInterval(0);
                }
            };
            autoSyncValue.Completed += (sender, args) =>
            {
                int value;
                SetSyncInterval(int.TryParse(autoSyncValue.Text, out value) ? value : 0);
            };

            Content = new TableView
            {
                Intent = TableIntent.Settings,
                Root = new TableRoot
                {
                    new TableSection("Storage")
                    {
                        _customStorageSwitch,
                        _customStorageDirectoryEntry
                    },
                    new TableSection("Cloud sync")
                    {
                        autoSyncSwitch,
                        autoSyncValue,
                        _dropboxSwitch
                    }
                }
            };
        }
        public TableViewMenuDemoPage()
        {
            Label header = new Label
            {
                Text = "TableView for a menu",
                Font = Font.BoldSystemFontOfSize(30),
                HorizontalOptions = LayoutOptions.Center
            };

            TableView tableView = new TableView
                {
                    Intent = TableIntent.Menu,
                    Root = new TableRoot
                    {
                        new TableSection("Views for Presentation")
                        {
                            new TextCell
                            {
                                Text = "Label",
                                Command = new Command(async () => 
                                    await Navigation.PushAsync(new LabelDemoPage()))
                            },

                            new TextCell
                            {
                                Text = "Image",
                                Command = new Command(async () => 
                                    await Navigation.PushAsync(new ImageDemoPage()))
                            },

                            new TextCell
                            {
                                Text = "BoxView",
                                Command = new Command(async () => 
                                    await Navigation.PushAsync(new BoxViewDemoPage()))
                            },

                            new TextCell
                            {
                                Text = "WebView",
                                Command = new Command(async () => 
                                    await Navigation.PushAsync(new WebViewDemoPage()))
                            },
                        }
                    }
                };

            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            // Build the page.
            this.Content = new StackLayout
            {
                Children = 
                {
                    header,
                    tableView
                }
            };
        }
Ejemplo n.º 8
0
        private void InitializeComponents()
        {
            // Primero: Creamos el Layout
            // *Cuando sólo hay un control en el Page no se usa Layout

            // Segundo: Agregamos los controles al Layout
            categoriesTable = new TableView();
            TableRoot tableRoot = new TableRoot ("Categorías");
            categoriesTable.Root = tableRoot;
            categoriesTable.HasUnevenRows = true;
            categoriesTable.Intent = TableIntent.Data;

            foreach( Category category in categories ) {
                TableSection section = new TableSection ( category.ToString() );
                foreach( Subcategory subcategory in subcategories ) {
                    TextCell cell = new TextCell ();
                    cell.Text = subcategory.ToString ();
                    cell.Detail = "Prueba";
                    cell.Tapped += (object sender, EventArgs e) => {
                        Navigation.PushAsync(
                            new ProductsPage( category, subcategory )
                        );
                    };
                    section.Add ( cell );
                }
                tableRoot.Add ( section );
            }

            // Tercero: Asignamos el Layout como contenido del Page
            Content = categoriesTable;
        }
Ejemplo n.º 9
0
        } //end ctor

        private StackLayout BuildView()
        {
            Editor editor = new Editor();
            editor.SetBinding(Editor.TextProperty, "Account.Notes");
         
            TableView tblView = new TableView() 
            {
                Root = new TableRoot() 
                {
                    new TableSection("NOTES")
                }
            };

            StackLayout stack = new StackLayout()
            {
                Padding = 10,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = 
                {
                    tblView,
                    editor
                }
            };

            return stack;
        } //end BuildView
		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;
		}
Ejemplo n.º 11
0
        public FriendSettingsPage()
        {
            ch = new ColorHandler();
            Title = "User Settings";
            BackgroundColor = ch.fromStringToColor("lightGray");
            TableView tableView = new TableView
            {
                Root = new TableRoot()
            };
            TableSection tSection = new TableSection();
            tableView.Root.Add(tSection);
            TextCell removeFriendCell = new TextCell
            {
                Text = "Remove Friend",
                TextColor = ch.fromStringToColor("gray"),

            };
            removeFriendCell.Tapped += RemoveFriendCell_Tapped;
            TextCell reportTextCell = new TextCell
            {
                Text = "Report",
                TextColor = ch.fromStringToColor("gray"),


            };
            reportTextCell.Tapped += ReportTextCell_Tapped;
            tSection.Add(removeFriendCell);
            tSection.Add(reportTextCell);
            Content = tableView;
        }
		Cell GetCategoryCell (string cat) {
			var cell = new TextCell {Text = cat};
			cell.Tapped += (sender, ea) => {;
				var category = cat;

				var tableView = new TableView ();
				var root = new TableRoot (category);
				var section = new TableSection ();
				section.Add (exampleInfoList
					.Where (e => e.Category == category)
					.OrderBy (e => e.Title)
					.Select (e => GetGraphCell(e.Title) ));
				root.Add (section);
				tableView.Root = root;

				var contentPage = new ContentPage {
					Title = category,
					Content = new StackLayout {
						Children = {tableView}
					}
				};

				Navigation.PushAsync (contentPage);
			};
			return cell;
		}
        public SwitchCellDemoPage()
        {
            Label header = new Label
            {
                Text = "SwitchCell",
                Font = Font.SystemFontOfSize(50, FontAttributes.Bold),
                HorizontalOptions = LayoutOptions.Center
            };

            TableView tableView = new TableView
            {
                Intent = TableIntent.Form,
                Root = new TableRoot
                {
                    new TableSection
                    {
                        new SwitchCell
                        {
                            Text = "SwitchCell:"
                        }
                    }
                }
            };

            // Build the page.
            this.Content = new StackLayout
            {
                Children = 
                {
                    header,
                    tableView
                }
            };
        }
		public SettingsPage ()
		{
			var svm = new SettingsViewModel { 
				AirplaneMode = true
			};
			BindingContext = svm;

			var airplaneModeCell = new SwitchCell {Text = "Airplane Mode"};
			airplaneModeCell.SetBinding(SwitchCell.OnProperty, "AirplaneMode");

			Title = "Settings";
			Content = new TableView {
				Root = new TableRoot {
					new TableSection (" ") {
						airplaneModeCell,
						new SwitchCell {Text = "Notifications"}
					},
					new TableSection (" ") {
						new EntryCell { Label="Login", Placeholder = "username" }
						, new EntryCell {Label="Password", Placeholder = "password" }
					},
					new TableSection ("Silent") {
						new SwitchCell {Text = "Vibrate", },
						new ViewCell { View = new Slider() }
					},
				
					new TableSection ("Ring") {
						new SwitchCell {Text = "New Voice Mail"},
						new SwitchCell {Text = "New Mail", On = true}
					},
				},
			};
		}
Ejemplo n.º 15
0
		public AboutMenu ()
		{
			this.Title="About Kana Keys";

			NavigationPage.SetBackButtonTitle (this, "Back");
			versionCell = new CustomCell{  Text= "Version #"};
			copyrightCell = new CustomCell{  Text = "Copyright notice"};
			termsCell = new CustomCell{  Text = "Terms of use"};

			mainSection = new TableSection ();

			tableView = new TableView ();
			mainSection.Add (versionCell);
			mainSection.Add(copyrightCell);	
			mainSection.Add(termsCell);	
			versionCell.Tapped += VersionCell_Tapped;
			copyrightCell.Tapped+= CopyrightCell_Tapped;
			termsCell.Tapped+= TermsCell_Tapped;
			tableView.Intent = TableIntent.Menu;

			tableView.Root = new TableRoot{ 
				mainSection,
			};
			Content = tableView;
		}
Ejemplo n.º 16
0
        private void AddDescriptionSection(TableView table)
        {
            const int HEIGHT = 150;

            var descriptionSection = new TableSection ("Description");

            var descriptionGrid = new Grid {
                Padding = new Thickness(10),
                HeightRequest = HEIGHT,
                VerticalOptions = LayoutOptions.FillAndExpand,
                ColumnDefinitions = {
                    new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) }
                }
            };

            var descriptionEntry = new Editor {
                HeightRequest = HEIGHT
            };

            descriptionEntry.SetBinding (Editor.TextProperty, "Description");

            descriptionGrid.Children.Add (descriptionEntry, 0, 0);

            descriptionSection.Add (new ViewCell {
                View = descriptionGrid,
                Height = HEIGHT
            });

            table.Root.Add (descriptionSection);
        }
Ejemplo n.º 17
0
        public StepPage(Steps step)
        {
            Title = string.Format("{0}: Pick an Activity", StepNames.LookUpStepNameGivenCode (step));
            Debug.WriteLine ("Screen for step: " + step);
            theStep = step;

            lblStepTotal = new Label () {
                FontSize = 14, FontAttributes = FontAttributes.Italic, HorizontalOptions = LayoutOptions.Center,
                TextColor = Color.Red,
            };

            tableRoot = new TableRoot ("TableRoot");
            ts = new TableSection ();

            tableView = new TableView {
                Intent = TableIntent.Form,
                Root = tableRoot,
            };

            // Define command for the items in the TableView.
            navigateCommand =
                new Command<Activity> (async (Activity a) => {
                Debug.WriteLine ("navigate to Activity =" + a.FullName);
                Page page = new ActivityPage (a);
                await this.Navigation.PushAsync (page);
            });

            ListSubTasks ();

            //Title = string.Format("{0} ({1} points earned)", StepNames.LookUpStepNameGivenCode (theStep), ListSubTasks ());
        }
Ejemplo n.º 18
0
        public AboutPage()
        {
            Content = new TableView {
                Root = new TableRoot {
                    new TableSection {
                        new TextLabelCell {
                            Label = "UTS : Helps",
                            XAlign = TextAlignment.Center,
                        }
                    },
                    new TableSection {
                        new TextLabelCell {
                            Label = "Copyright © Group 15 2015",
                            XAlign = TextAlignment.Center,
                        }
                    }
                },
                BackgroundColor = new Color (1, 1, 1, 0),
                Intent = TableIntent.Menu

            };

            BackgroundColor = App.GetContentPageBackgroundColor ();
            Appearing += (sender, e) =>  BackgroundColor = App.GetContentPageBackgroundColor ();
        }
Ejemplo n.º 19
0
		public Issue2794 ()
		{

			var tableView = new TableView ();
			_dataSection = new TableSection ();
			var cell1 = new TextCell { Text = "Cell1" };
			cell1.ContextActions.Add (new MenuItem {
				Text = "Delete me after",
				IsDestructive = true,
				Command = new Command (Delete),
				CommandParameter = 0
			});

			var cell2 = new TextCell { Text = "Cell2" };
			cell2.ContextActions.Add (new MenuItem {
				Text = "Delete me first",
				IsDestructive = true,
				Command = new Command (Delete),
				CommandParameter = 1
			});

			_dataSection.Add (cell1);
			_dataSection.Add (cell2);
			tableView.Root.Add (_dataSection);

			Content = tableView;
		}
Ejemplo n.º 20
0
        /// <summary>
        /// Initializes the component.
        /// </summary>
        void InitializeComponent()
        {
            var layout = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center
            };

            var label = new Label
            {
                Text = "T-Shirt shop",
                FontSize = 36.0,
                TextColor = Color.FromRgb(52, 152, 219),
                HorizontalOptions = LayoutOptions.Center
            };

            var tableView = new TableView
            {
                Intent = TableIntent.Menu,
                Root = new TableRoot
                {
                    GetTableSection("C# T-Shirt", MockData.GetCsharp()),
                    GetTableSection("F# T-Shirt", MockData.GetFsharp())
                }
            };

            layout.Children.Add(label);
            layout.Children.Add(tableView);

            Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);
            Content = layout;
        }
Ejemplo n.º 21
0
        public void PopTablePage(string title, string []texts)
        {
            TableView table = new TableView {
                Root = new TableRoot (),
                BackgroundColor = new Color(1, 1, 1, 0),
            };

            TableSection section = new TableSection ();

            foreach (string text in texts) {

                section.Add (new TextLabelCell {
                    Label = text
                });
            }

            table.Root.Add (section);

            var page = new ContentPage {
                Title = title,
                Content = table,
                BackgroundColor = new Color(1, 1, 1, 0.2)
            };

            View.Navigation.PushAsync (page);
        }
Ejemplo n.º 22
0
		public MenuPage (MasterDetailPage m)
		{
			master = m;

			Title = "Evolve13";
			Icon = "slideout.png";

			var section = new TableSection () {
				new MenuCell {Text = "Sessions", Host = this},
				new MenuCell {Text = "Speakers", Host = this},
				new MenuCell {Text = "Favorites", Host = this},
				new MenuCell {Text = "Room Plan", Host = this},
				new MenuCell {Text = "Map", Host = this},
				new MenuCell {Text = "About", Host = this},
			};

			var root = new TableRoot () {section} ;
		
			tableView = new MenuTableView ()
			{ 
				Root = root,
//				HeaderTemplate = new DataTemplate (typeof(MenuHeader)),
				Intent = TableIntent.Menu,
			};


			Content = new StackLayout {
				BackgroundColor = Color.Gray,
				VerticalOptions = LayoutOptions.FillAndExpand,
				Children = {tableView}
			};
		}
Ejemplo n.º 23
0
        public SpecialEvents()
        {
            Icon = "Events.png";
            Title = "Special Events";
            Content = new TableView {
                Intent = TableIntent.Menu,
                Root = new TableRoot () {

                    new TableSection ("Meeting Times") {
                        new ImageCell () {
                            Text = "Monday 3:20 PM - 4:15 PM",
                            Detail = "Fleming 24-106",
                            ImageSource = new FileImageSource () { File = "Recommendations.png" }
                        },
                        new ImageCell () {
                            Text = "Monday 3:20 PM - 4:15 PM",
                            Detail = "Fleming 24-106",
                            ImageSource = new FileImageSource () { File = "Recommendations.png" }
                        },
                        new ImageCell () {
                            Text = "Monday 3:20 PM - 4:15 PM",
                            Detail = "Fleming 24-106",
                            ImageSource = new FileImageSource () { File = "Recommendations.png" }
                        }
                    }
                }
            };

            //To Enable Navigation on Navigation Bar
            /*ToolbarItems.Add(new ToolbarItem {
                Name = "Launch",
                Order = ToolbarItemOrder.Primary,
                Command = new Command(() => Navigation.PushAsync(new LoginPage(App.Current)))
            });*/
        }
Ejemplo n.º 24
0
        private async void Init()
        {
            var samples = new[]
            {
                typeof (TcpSocketListenerPage),
                typeof (TcpSocketClientPage),
                typeof (UdpSocketReceiverPage),
                typeof (UdpSocketClientPage),
                typeof (UdpSocketMulticastClientPage),
            };

            var netCell = new TextCell() {Text = "View Network Interfaces "};
            netCell.Tapped += (sender, args) =>
            {
                var netPage = new NetworkInterfacesPage()
                {
                    Title = "Network Interfaces"
                };

                _parentTabPage.Children.Add(netPage);
            };

            var cells = await Task.Run(() => samples.Select(t =>
            {
                var title = t.Name.Substring(0, t.Name.IndexOf("Page", StringComparison.Ordinal));

                var cell = new TextCell()
                {
                    Text = String.Format("Add {0}", title)
                };

                cell.Tapped += (sender, args) =>
                {
                    var page = (ContentPage)Activator.CreateInstance(t);
                    page.Title = title;
                    _parentTabPage.Children.Add(page);
                };

                return cell;

            })
                .Concat(new[]
                {
                    netCell
                    // more cells here, one day . . . 
                })            
                .ToList());

            var tableRoot = new TableRoot() {new TableSection("Classes") { cells } };
            var tableView = new TableView(tableRoot);

			this.Content = new StackLayout {
				Padding = new Thickness (0, Device.OnPlatform (20, 0, 0), 0, 0),
				Children = { 
					tableView
				}
			};
        }
        public TableViewMenuDemoPage()
        {
            Label header = new Label
            {
                Text = "TableView for a menu",
				FontSize = 30,
				FontAttributes = FontAttributes.Bold,
                HorizontalOptions = LayoutOptions.Center
            };

            TableView tableView = new TableView
                {
                    Intent = TableIntent.Menu,
                    Root = new TableRoot
                    {
                        new TableSection("Views for Presentation")
                        {
                            new TextCell
                            {
                                Text = "Label",
                                Command = new Command(async () => 
                                    await Navigation.PushAsync(new LabelDemoPage()))
                            },

                            new TextCell
                            {
                                Text = "Image",
                                Command = new Command(async () => 
                                    await Navigation.PushAsync(new ImageDemoPage()))
                            },

                            new TextCell
                            {
                                Text = "BoxView",
                                Command = new Command(async () => 
                                    await Navigation.PushAsync(new BoxViewDemoPage()))
                            },

                            new TextCell
                            {
                                Text = "WebView",
                                Command = new Command(async () => 
                                    await Navigation.PushAsync(new WebViewDemoPage()))
                            },
                        }
                    }
                };

            // Build the page.
            this.Content = new StackLayout
            {
                Children = 
                {
                    header,
                    tableView
                }
            };
        }
Ejemplo n.º 26
0
        public HomePage(string title)
        {
            BackgroundColor = Color.Gray.WithLuminosity(.9);
            Title = title;
            Padding = 0;
            PopupButton = new ToolbarItem
            {
                Text = "Show Popup",
                Priority = 0
            };

            ToolbarItems.Add(PopupButton);
            PopupButton.Clicked += ((object sender, EventArgs e) =>
            {
                if (!PopupContent.PopupVisible)
                {
                    #region popup content

                    //optional remove popup toolbaritem from navigation bar
                    ToolbarItems.Remove(PopupButton);

                    TableRoot = new TableRoot();
                    TableView = new TableView(TableRoot)
                    {
                        Intent = TableIntent.Data,
                        HasUnevenRows = false
                    };
                    TableSection = new TableSection("");
                    TableRoot.Add(TableSection);
                    for (var i = 0; i < 20; i++)
                    {
                        TableSection.Add(new SwitchCell { Text = "Switch Cell #" + i });
                    }

                    //scale the size of the modal popup min=.25 max=1 default=.80 optional title
                    //if the size=1 the dialog will fill the content area like a sheet window

                    PopupContent.ShowPopup(TableView, 1, modal: true, title: "Perfect Popup ");
                    foreach (var cell1 in TableSection)
                    {
                        var cell = (SwitchCell)cell1;
                        cell.OnChanged += ((cellsender, cellevent) =>
                        {
                            PopupContent.PopupChanged = true;
                            
                        });
                    }

                    #endregion
                }
                else
                {
                    PopupContent.DismisPopup();
                }
            });
        }
		public TableViewModelRenderer(TableView model)
		{
			View = model;
			View.ModelChanged += (s, e) =>
			{
				if (Table != null)
					Table.ReloadData();
			};
			AutomaticallyDeselect = true;
		}
Ejemplo n.º 28
0
        public AddFeriadosView(GerenciarFeriadosViewModel viewModel)
        {
            Title = "Feriado";
            BindingContext = viewModel;

            FloatButton.AnimateWithAction ();
            FloatButton.Command = viewModel.toolbarSaveCommand;

            entryName.SetBinding (Entry.TextProperty, "holidayName", BindingMode.TwoWay);
            dateHoliday.SetBinding (DatePicker.DateProperty, "holidayDate", BindingMode.TwoWay);
            Recursive.SetBinding (SwitchCell.OnProperty, "recursive", BindingMode.TwoWay);

            //ToolbarItems.Add(new ToolbarItem
            //{
            //	Icon = Images.Save,
            //	Order = ToolbarItemOrder.Primary,
            //	Command = viewModel.toolbarSaveCommand
            //});

            tableHoliday = new TableView {
                Intent = TableIntent.Settings,
                BackgroundColor = Color.Default,
                Root = new TableRoot {
                    new TableSection ("Nome"){ new ViewCell { View = entryName } },
                    new TableSection ("Data"){ new ViewCell{ View = dateHoliday } },
                    new TableSection (){ Recursive }
                }
            };

            var absoluteLayout = new AbsoluteLayout {
                VerticalOptions = LayoutOptions.FillAndExpand,
            };
            //var background = new Image { Source = Images.Background, Aspect = Aspect.Fill };

            //absoluteLayout.Children.Add (background, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            //AbsoluteLayout.SetLayoutFlags(background, AbsoluteLayoutFlags.All);
            //AbsoluteLayout.SetLayoutBounds(background, new Rectangle(0, 0, 1, 1));

            //absoluteLayout.Children.Add (stack, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutFlags (tableHoliday, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds (tableHoliday, new Rectangle (0, 0, 1, 1));

            //absoluteLayout.Children.Add (Add, new Rectangle (0.85, 0.85, 0.185, 0.1), AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutFlags (FloatButton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds (FloatButton, new Rectangle (0.99f, 0.98f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

            //absoluteLayout.Children.Add(background);
            absoluteLayout.Children.Add (tableHoliday);
            absoluteLayout.Children.Add (FloatButton);

            Content = absoluteLayout;
        }
Ejemplo n.º 29
0
		public NewEntryPage ()
		{
			Title = "New Entry";

			// Form fields
			var title = new EntryCell { Label = "Titel" };
			title.SetBinding (EntryCell.TextProperty, "Title", BindingMode.TwoWay);

			var latitude = new EntryCell { Label = "Latitude", Keyboard = Keyboard.Numeric };
			latitude.SetBinding (EntryCell.TextProperty, "Latitude", BindingMode.TwoWay);

			var longitude = new EntryCell {Label = "Longitude", Keyboard = Keyboard.Numeric };
			longitude.SetBinding (EntryCell.TextProperty, "Longitude", BindingMode.TwoWay);


			var date = new DatePickerEntryCell {Label = "Date"};
			date.SetBinding (DatePickerEntryCell.DateProperty,
				"Date",BindingMode.TwoWay);


			var rating = new EntryCell { Label = "Rating", Keyboard = Keyboard.Numeric };
			rating.SetBinding (EntryCell.TextProperty, "Rating", BindingMode.TwoWay);


			var notes = new EntryCell { Label = "Notes" };
			notes.SetBinding (EntryCell.TextProperty, "Notes", BindingMode.TwoWay);


			// Form
			var entryForm = new TableView {
				Intent = TableIntent.Form,
				Root = new TableRoot {
					new TableSection () {
						title,
						latitude,
						longitude,
						date,
						rating,
						notes
					}
				}
			};

			Content = entryForm;

			var save = new ToolbarItem {
				Text = "Save"
			};
			save.SetBinding (ToolbarItem.CommandProperty, "SaveCommand");

			ToolbarItems.Add (save);
		}
		public DetalhesDoPerfil_Page (GerenciarPerfisViewModel viewModel)
		{
			BindingContext = viewModel;
			gerenciarPerfis = (GerenciarPerfisViewModel)BindingContext;

			ToolbarItems.Add (toolbarSave);
			toolbarSave.Command = new Command (ToolbarCommand);

			entryName.SetBinding (Entry.TextProperty, "Name", BindingMode.TwoWay);
			expirationDatePicker.SetBinding (DatePicker.DateProperty, "ExpireDate", BindingMode.TwoWay);
			switchAutomovel.SetBinding (SwitchCell.OnProperty, "IsAutoMovel", BindingMode.TwoWay);
			switchPedestre.SetBinding (SwitchCell.OnProperty, "IsPedestre", BindingMode.TwoWay);

			var configTable = new TableView {
				Intent = TableIntent.Settings,
				BackgroundColor = Color.Default,
				Root = new TableRoot {
					new TableSection ("Nome") {
						new ViewCell { View = entryName }
					},
					new TableSection ("Data de validade") {
						new ViewCell{ View = expirationDatePicker }
					},
					new TableSection ("Tipo de portao acessivel") {
						switchAutomovel,
						switchPedestre
					},
					new TableSection () {
						hoursCell
					}
				}
			};

			var stack = new StackLayout {
				Padding = new Thickness (0, 0, 0, 0),
				Spacing = 0,
				Children = { configTable }
			};

			var absoluteLayout = new AbsoluteLayout ();
			var background = new Image {
				Style = Styles.BackgroundImage
			};

			absoluteLayout.Children.Add (background, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
			absoluteLayout.Children.Add (stack, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);

			Content = absoluteLayout;

			hoursCell.Tapped += HoursCell_Tapped;
		}
Ejemplo n.º 31
0
        public TableViewPage()
        {
            //var customCell = new DataTemplate(typeof(MyCell));
            //customCell.SetBinding(MyCell.NameProperty, "Joe Smith");
            //customCell.SetBinding(MyCell.CategoryProperty, "underpants");
            //customCell.SetBinding(MyCell.ImageFilenameProperty, "image");

            var table = new Xamarin.Forms.TableView();

            table.HasUnevenRows = true;
            table.Intent        = TableIntent.Menu;
            table.Root          = new TableRoot
            {
                new TableSection("top level")
                {
                    new MyCell(new MyCellViewModel
                    {
                        Name          = "Scotty",
                        Category      = "Employee",
                        Description   = "Strenths in kicking shit and taking names.",
                        ImageFileName = "one.jpg"
                    })
                },
                new TableSection
                {
                    new TextCell
                    {
                        Text = "another one!"
                    }
                },
                new TableSection
                {
                    new TextCell
                    {
                        Text = "another one!"
                    }
                },
                new TableSection
                {
                    new TextCell
                    {
                        Text = "another one!"
                    }
                },
            };
            Content = table;
        }
Ejemplo n.º 32
0
        public TableView()
        {
            InitializeComponent();
            this.Title = "LiftMore";
            var table = new Xamarin.Forms.TableView()
            {
                Intent = TableIntent.Data
            };
            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;
        }
Ejemplo n.º 33
0
 public TableViewModelRenderer(Context context, Android.Widget.ListView listView, Xamarin.Forms.TableView view) : base(context, listView, view)
 {
     _TableView = view as TableView;
 }
Ejemplo n.º 34
0
 protected override Xamarin.Forms.Platform.Android.TableViewModelRenderer GetModelRenderer(Android.Widget.ListView listView, Xamarin.Forms.TableView view)
 {
     return(new TableViewModelRenderer(Context, listView, view));
 }