public MenuPrincipalPage()
        {
            List<MenuItem> data = new MenuListData();

            menus = new ListView();
            menus.ItemsSource = data;
            menus.VerticalOptions = LayoutOptions.FillAndExpand;
            menus.BackgroundColor = Color.Transparent;
            menus.SeparatorVisibility = SeparatorVisibility.None;
            menus.ItemTemplate = new DataTemplate(typeof(MenuViewCell));
            menus.ItemTapped += async (sender, e) => NavigateTo(e.Item as MenuItem);

            var mainLayout = new StackLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor = Color.Transparent,
                Orientation = StackOrientation.Vertical,
                Padding = new Thickness(10, 90, 10, 0),
                Children = { menus }
            };
            
            this.BackgroundColor = Colors._defaultColorFromHex;

            this.Content = mainLayout;
        }
示例#2
0
        public MenuListTemplate()
        {
            List<MenuItem> data = new MenuListData();
            this.ItemsSource = data;
            this.VerticalOptions = LayoutOptions.FillAndExpand;
            this.BackgroundColor = Theme.NavBackgroundColor;
            this.SeparatorColor = Color.Black;
            this.Margin = new Thickness(5);

            var menuDataTemplate = new DataTemplate(() =>
            {
                var pageImage = new Image
                {
                    VerticalOptions = LayoutOptions.Center,
                    HeightRequest = 30,
                    Margin = new Thickness(0, 0, 10, 0)
                };
                var pageLabel = new Label
                {
                    VerticalOptions = LayoutOptions.Center,
                    TextColor = Theme.TextColor,
                    FontSize = 20,
                };

                pageImage.SetBinding(Image.SourceProperty, "IconSource");
                pageLabel.SetBinding(Label.TextProperty, "Name");

                var layout = new StackLayout
                {
                    Orientation = StackOrientation.Horizontal,
                    VerticalOptions = LayoutOptions.Center,
                    Children =
                    {
                        pageImage,
                        pageLabel
                    }
                };

                var menuFrame = new Frame
                {
                    OutlineColor = Theme.NavBackgroundColor,
                    BackgroundColor = Theme.NavBackgroundColor,
                    VerticalOptions = LayoutOptions.Center,
                    Padding = new Thickness(10),
                    Content = layout
                };

                return new ViewCell { View = menuFrame };
            });



            var cell = new DataTemplate(typeof(ViewCell));
            cell.SetBinding(TextCell.TextProperty, "Name");
            cell.SetValue(TextCell.TextColorProperty, Color.FromHex("2f4f4f"));


            this.ItemTemplate = menuDataTemplate;
            this.SelectedItem = data[0];
        }
        public MenuPage()
        {
            InitializeComponent();

            List<MenuListItem> data = new MenuListData();
            TheMenu.ItemsSource = data;

            Menu = TheMenu;
        }
示例#4
0
		public MenuListView()
		{
			List<MenuItem> data = new MenuListData();

			ItemsSource = data;
			VerticalOptions = LayoutOptions.FillAndExpand;
			BackgroundColor = Color.Transparent;
			SeparatorVisibility = SeparatorVisibility.Default;
			ItemTemplate = new DataTemplate(typeof(MenuViewCell));
		}
示例#5
0
        public MenuPage()
        {
            InitializeComponent();

            List <MenuListItem> data = new MenuListData();

            TheMenu.ItemsSource = data;

            Menu = TheMenu;
        }
示例#6
0
        public MenuListView()
        {
            List<MenuItem> data = new MenuListData ();

            ItemsSource = data;
            VerticalOptions = LayoutOptions.FillAndExpand;

            var cell = new DataTemplate (typeof(sideCustomViewCell));

            ItemTemplate = cell;
        }
        //ViewModel
        public MenuListView()
        {
            List<MenuItem> data = new MenuListData();

            ItemsSource = data;
            VerticalOptions = LayoutOptions.FillAndExpand;

            var cell = new DataTemplate(typeof (TextCell));
            cell.SetBinding(TextCell.TextProperty, "Name");

            ItemTemplate = cell;
        }
示例#8
0
        public MenuListView()
        {
            BackgroundColor = Color.FromHex(UIConstants.MenuListColor);

            ItemTemplate = new DataTemplate(typeof(MenuCell));

            List <MenuOption> data = MenuListData.GetMenu();

            ItemsSource = data;

            RowHeight = 60;
        }
        public MenuListView()
        {
            List<Models.MenuItem> data = new MenuListData();

            ItemsSource = data;
            VerticalOptions = LayoutOptions.FillAndExpand;
            BackgroundColor = Color.Transparent;

            var cell = new DataTemplate(typeof(TextCell));
            cell.SetBinding(TextCell.TextProperty, "Title");

            ItemTemplate = cell;
        }
示例#10
0
        public void StoreUser(string id, string name, string photo, UserRole role, string companyId = "", bool hasLocation = false, decimal offset = 0, string idiom = "en-us", string token = "")
        {
            Helpers.Settings.DisplayUserId      = id;
            Helpers.Settings.DisplayUserName    = name;
            Helpers.Settings.DisplayUserRole    = role.ToString();
            Helpers.Settings.DisplayUserPhoto   = photo;
            Helpers.Settings.DisplayUserCompany = companyId;
            Helpers.Settings.DisplayHasLocation = hasLocation;
            Helpers.Settings.DisplayMyOffset    = offset;

            if (!string.IsNullOrEmpty(token))
            {
                Helpers.Settings.DisplayUserToken = token;
            }


            if (idiom == "1")
            {
                Helpers.Settings.DisplayUserIdiom = "pt-br";
            }
            else if (idiom == "2")
            {
                Helpers.Settings.DisplayUserIdiom = "en-us";
            }
            else if (idiom == "3")
            {
                Helpers.Settings.DisplayUserIdiom = "es-es";
            }
            else if (idiom == "0")
            {
                Helpers.Settings.DisplayUserIdiom = "en-us";
            }
            else if (idiom == "4")
            {
                Helpers.Settings.DisplayUserIdiom = "it-it";
            }
            else
            {
                Helpers.Settings.DisplayUserIdiom = idiom;
            }

            //20190104 - XND - Alterei aqui pra so mudar a cultura do resources inves da cultura do app todo
            var culture = new CultureInfo(Helpers.Settings.DisplayUserIdiom);

            AppResource.Culture    = culture;
            App.AppCurrent.Culture = culture;
            MenuListData.Reload();

            //Culture = CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(Helpers.Settings.DisplayUserIdiom);
            //AppResource.Culture = Culture;
        }
示例#11
0
        public MenuListView()
        {
            List<MenuItem> data = new MenuListData ();
            ItemsSource = data;
            VerticalOptions = LayoutOptions.FillAndExpand;
            BackgroundColor = Color.Transparent;
            SeparatorVisibility = SeparatorVisibility.None;

            var cell = new DataTemplate (typeof(MenuCell));
            cell.SetBinding (MenuCell.TextProperty, "Title");
            cell.SetBinding (MenuCell.ImageSourceProperty, "IconSource");

            ItemTemplate = cell;
        }
示例#12
0
 public MenuListView ()
 {
 List<MenuItemForMaster> data = new MenuListData ();
 
 ItemsSource = data;
 VerticalOptions = LayoutOptions.FillAndExpand;
 BackgroundColor = Color.Accent;
 
 var cell = new DataTemplate (typeof(MenuCell));
 //cell.SetBinding (MenuCell.TextProperty, "Title");
 //cell.SetBinding (MenuCell.ImageSourceProperty, "IconSource");
 this.HasUnevenRows = false;
 ItemTemplate = cell;
 }
示例#13
0
            public MenuListView()
            {
                List <MenuItem> data = new MenuListData();

                ItemsSource     = data;
                VerticalOptions = LayoutOptions.FillAndExpand;
                BackgroundColor = Color.Transparent;

                var cell = new DataTemplate(typeof(ImageCell));

                cell.SetBinding(TextCell.TextProperty, "Title");
                cell.SetBinding(ImageCell.ImageSourceProperty, "IconSource");

                ItemTemplate = cell;
                SelectedItem = data [0];
            }
示例#14
0
        public MenuListView()
        {
            List <Model.MenuItem> data = new MenuListData();

            ItemsSource     = data;
            VerticalOptions = LayoutOptions.FillAndExpand;
            BackgroundColor = Color.Transparent;
            SeparatorColor  = Color.White;

            var cell = new DataTemplate(typeof(ImageCell));

            cell.SetBinding(TextCell.TextProperty, "Title");
            cell.SetValue(TextCell.TextColorProperty, Color.FromHex("#FFF"));
            cell.SetBinding(ImageCell.ImageSourceProperty, "IconSource");
            ItemTemplate = cell;
        }
示例#15
0
        public MenuListView()
        {
            List <Group> data = new MenuListData();

            ItemsSource         = data;
            HasUnevenRows       = true;
            IsGroupingEnabled   = true;
            GroupDisplayBinding = new Binding("Name");
            Style = Application.Current.Resources["MasterDetailHeaderFullMenu"] as Style;
            SeparatorVisibility = SeparatorVisibility.None;

            var header = new DataTemplate(typeof(HeaderCell));

            GroupHeaderTemplate = header;

            var cell = new DataTemplate(typeof(MenuCell));

            ItemTemplate = cell;
        }
示例#16
0
        //what the menu page will look like
        public MenuPage()
        {
            var data = new MenuListData();

            Title           = "menu"; // The Title property must be set.
            BackgroundColor = Color.Teal;
            Icon            = new FileImageSource {
                File = "robot.png"
            };

            Menu = new ListView()
            {
                SeparatorVisibility = SeparatorVisibility.Default,
                SeparatorColor      = Color.Teal,
                BackgroundColor     = Color.Gray
            };
            Menu.ItemsSource = data;
            //aspect of each of the menus cells that will contain the page title
            var cell = new DataTemplate(typeof(TextCell));

            cell.SetBinding(TextCell.TextProperty, "Title");
            Menu.ItemTemplate = cell;

            var menuLabel = new ContentView
            {
                Padding = new Thickness(10, 30, 0, 5),
                Content = new Label
                {
                    Text = "MENU",
                }
            };

            var layout = new StackLayout
            {
                Spacing         = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            layout.Children.Add(menuLabel);
            layout.Children.Add(Menu);
        }
示例#17
0
        public MenuListView()
        {
            List<MenuItemModel> data = new MenuListData ();

            ItemsSource = data;
            VerticalOptions = LayoutOptions.FillAndExpand;

            BackgroundColor = Color.FromRgb(119,129,137);
            RowHeight = 70;

            SelectedItem = null;

            //SeparatorVisibility = SeparatorVisibility.None;

            var cell = new DataTemplate (typeof(MenuCell));

            //cell.SetBinding (MenuCell.TextProperty, "Title");
            //cell.SetBinding (MenuCell.ImageSourceProperty, "IconSource");

            ItemTemplate = cell;
        }
示例#18
0
        /// <summary>
        /// Dashboard
        /// </summary>
        public void DashboardLayout()
        {
            try
            {
                Grid grid = new Grid {
                };

                List <SchoolManagement.Core.Models.MenuItem> lstPage = new MenuListData();

                WrapLayout layout = new WrapLayout
                {
                    Spacing = 5,
                    Padding = new Thickness(5, Device.OnPlatform(20, 0, 0), 5, 0),
                    //HorizontalOptions = LayoutOptions.Center,
                    //VerticalOptions = LayoutOptions.Center,
                };


                //for (int i = 0; i < lstPage.Count; i++)
                //{
                //    var cell = new StackLayout
                //    {
                //        //WidthRequest = 50,
                //        //HeightRequest = 50,
                //        Children = {
                //        new Image {Source = lstPage[i].imagePath,
                //            VerticalOptions = LayoutOptions.Start,
                //            //BackgroundColor = Color.Blue,
                //            WidthRequest=30,
                //            HeightRequest=30},
                //        new Label {Text = lstPage[i].item,
                //            //FontSize = 9,
                //            LineBreakMode = LineBreakMode.TailTruncation,

                //        }
                //    }
                //    };

                //    layout.Children.Add(cell);
                //}

                //for (int i = 0; i < lstPage.Count; i++)
                //{

                //    if (i == 0)
                //    {
                //        grid.Children.Add(new Label
                //        {
                //            Text = lstPage[i].MobileName,
                //            TextColor = Color.Blue,
                //            BackgroundColor = Color.Yellow,
                //            XAlign = TextAlignment.Center,
                //            YAlign = TextAlignment.Center,
                //        }, 0, 0);
                //    }

                //    else if (i % 2 == 0)
                //    {
                //        grid.Children.Add(new Label
                //        {
                //            Text = lstPage[i].MobileName,
                //            TextColor = Color.Blue,
                //            BackgroundColor = Color.Yellow,
                //            XAlign = TextAlignment.Center,
                //            YAlign = TextAlignment.Center,
                //        }, i, 1);
                //    }
                //    else
                //    {
                //        grid.Children.Add(new Label
                //        {
                //            Text = lstPage[i].MobileName,
                //            TextColor = Color.Blue,
                //            BackgroundColor = Color.Yellow,
                //            XAlign = TextAlignment.Center,
                //            YAlign = TextAlignment.Center,
                //        }, i, 0);
                //    }
                //}

                List <Menu> data = new List <Menu>();
                for (int i = 1; i <= 10; i++)
                {
                    data.Add(new Menu()
                    {
                        Name = string.Format("data 1 {0}", i)
                    });
                }

                int         noOfCol  = 5;
                StackLayout slLAble  = new StackLayout();
                int         totaLoop = (int)Math.Ceiling((double)data.Count / noOfCol);
                for (int i = 0; i < totaLoop; i++)
                {
                    string d1 = string.Empty;
                    for (int j = 0; j < noOfCol; j++)
                    {
                        int index = (i * noOfCol) + j;
                        if (data.Count <= index)
                        {
                            break;
                        }
                        d1 += data[index].Name + ",";

                        grid.Children.Add(new Label {
                            Text = i + " " + j, TextColor = Color.White
                        }, i, j);
                    }
                }


                ////grid.Children.Add(new Label
                ////{
                ////    Text = "Span 1",
                ////    TextColor = Color.Blue,
                ////    BackgroundColor = Color.Yellow,
                ////    XAlign = TextAlignment.Center,
                ////    YAlign = TextAlignment.Center,
                ////}, 0, 0);


                ////grid.Children.Add(new Label
                ////{
                ////    Text = "Span 1",
                ////    TextColor = Color.Silver,
                ////    BackgroundColor = Color.Yellow,
                ////    XAlign = TextAlignment.Center,
                ////    YAlign = TextAlignment.Center,
                ////}, 0, 1);

                ////grid.Children.Add(new Label
                ////{
                ////    Text = "Span 2",
                ////    TextColor = Color.Blue,
                ////    BackgroundColor = Color.Yellow,
                ////    XAlign = TextAlignment.Center,
                ////    YAlign = TextAlignment.Center,
                ////}, 1, 0);


                ////grid.Children.Add(new Label
                ////{
                ////    Text = "Span 2",
                ////    TextColor = Color.Silver,
                ////    BackgroundColor = Color.Yellow,
                ////    XAlign = TextAlignment.Center,
                ////    YAlign = TextAlignment.Center,
                ////}, 1, 1);

                ////grid.Children.Add(new Label
                ////{
                ////    Text = "Span 3",
                ////    TextColor = Color.Blue,
                ////    BackgroundColor = Color.Yellow,
                ////    XAlign = TextAlignment.Center,
                ////    YAlign = TextAlignment.Center,
                ////}, 2, 0);


                ////grid.Children.Add(new Label
                ////{
                ////    Text = "Span 3",
                ////    TextColor = Color.Silver,
                ////    BackgroundColor = Color.Yellow,
                ////    XAlign = TextAlignment.Center,
                ////    YAlign = TextAlignment.Center,
                ////}, 2, 1);

                //grid.Children.Add(new Label
                //{
                //    Text = "Span 2 columns",
                //    TextColor = Color.Blue,
                //    BackgroundColor = Color.Yellow,
                //    XAlign = TextAlignment.Center,
                //    YAlign = TextAlignment.Center,
                //}, 0, 2);


                //grid.Children.Add(new Label
                //{
                //    Text = "Span 2 columns",
                //    TextColor = Color.Silver,
                //    BackgroundColor = Color.Yellow,
                //    XAlign = TextAlignment.Center,
                //    YAlign = TextAlignment.Center,
                //    //HorizontalTextAlignment = TextAlignment.Center,
                //    //VerticalTextAlignment = TextAlignment.Center
                //}, 1, 2);


                //grid.Children.Add(new Label
                //{
                //    Text = "Span 3 columns",
                //    TextColor = Color.Blue,
                //    BackgroundColor = Color.Yellow,
                //    XAlign = TextAlignment.Center,
                //    YAlign = TextAlignment.Center,
                //}, 0, 3);


                //grid.Children.Add(new Label
                //{
                //    Text = "Span 3 columns",
                //    TextColor = Color.Silver,
                //    BackgroundColor = Color.Yellow,
                //    XAlign = TextAlignment.Center,
                //    YAlign = TextAlignment.Center,
                //}, 1, 3);

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

                // Build the page.
                Content = new ScrollView
                {
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    Content           = grid
                };
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        private async void OnRegisterTapped(object sender, EventArgs e)
        {
            if (!CheckInfos())
            {
                return;
            }

            ApiService service = new ApiService();

            try
            {
                Acr.UserDialogs.UserDialogs.Instance.ShowLoading(AppResource.alertLoading);


                string deviceType = "";

                switch (Device.OS)
                {
                case TargetPlatform.Other:
                    deviceType = "Other";
                    break;

                case TargetPlatform.iOS:
                    deviceType = "ios";
                    break;

                case TargetPlatform.Android:
                    deviceType = "android";
                    break;

                case TargetPlatform.WinPhone:
                    deviceType = "WindowsPhone";
                    break;

                case TargetPlatform.Windows:
                    deviceType = "Windows";
                    break;

                default:
                    deviceType = "None";
                    break;
                }


                _updateUser.Name              = txtName.Text;
                _updateUser.CityName          = txtCity.Text;
                _updateUser.Cellphone         = txtPhone.Text;
                _updateUser.DesirableLanguage = (pckIdioma.SelectedIndex + 1).ToString();
                _updateUser.Id = Helpers.Settings.DisplayUserId;
                if (imageStream != null)
                {
                    _updateUser.Photo = await service.UploadImage(imageStream);

                    Helpers.Settings.DisplayUserPhoto = _updateUser.Photo;
                }



                var json   = JsonConvert.SerializeObject(_updateUser);
                var result = await service.PutAsync(json, "user/updateMe");

                App.AppCurrent.UpdateLanguage(_updateUser.DesirableLanguage);
                MenuListData.Reload();

                await App.AppCurrent.ConfigureAppPhase();

                var userRetorno = JsonConvert.DeserializeObject <Employee>(result);


                Helpers.Settings.DisplayUserPhoto = _updateUser.Photo;
                Helpers.Settings.DisplayUserName  = txtName.Text;
                Acr.UserDialogs.UserDialogs.Instance.Toast(AppResource.lblItemUpdatedSucess);
            }
            catch (Exception ex)
            {
                this.DisplayAlert(MocoApp.Resources.AppResource.alertAlert, ex.Message, AppResource.textOk);
            }
            finally
            {
                Acr.UserDialogs.UserDialogs.Instance.HideLoading();
            }
        }
示例#20
0
        private void LocalisableData()
        {
            List<MenuItem> data = new MenuListData();

            ItemsSource = data;
        }
示例#21
0
 public MenuViewModel()
 {
     MenuItems = new MenuListData();
     Email     = "*****@*****.**";
 }
示例#22
0
 public MainViewModel()
 {
     menuList = new MenuListData();
 }