Exemple #1
0
        public MenuPage()
        {
            InitializeComponent();
            var viewmodel = new MenuPageViewModel();

            this.BindingContext = viewmodel;
        }
Exemple #2
0
 public Default()
 {
     BindingContext = new MenuPageViewModel();
     Title          = "Menu";
     Icon           = Device.OS == TargetPlatform.iOS ? "menu.png" : null;
     InitializeComponent();
 }
        public MenuPage()
        {
            InitializeComponent();

            BindingContext = new MenuPageViewModel();
            ListView       = MenuItemsListView;
        }
Exemple #4
0
 public MenuPage()
 {
     InitializeComponent();
     BindingContext = new MenuPageViewModel(this);
     Detail         = new NavigationPage(new ProductsListPage());
     menuPages      = this;
 }
        public MenuPage()
        {
            InitializeComponent();

            MenuPageViewModel menuPageViewModel = new MenuPageViewModel();

            BindingContext = menuPageViewModel;

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

            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children        = { lstOptions }
            };
        }
        public MenuPage()
        {
            BindingContext = new MenuPageViewModel();
            InitializeComponent();
            NavigationPage.SetHasBackButton(this, false);

            SettingsIos = new ToolbarItem();
            if (Device.OS == TargetPlatform.Android)
            {
                ToolbarItems.Add(new ToolbarItem("hamburger", "Resources/drawable/settings.png", async() =>
                {
                    await Navigation.PushAsync(new HamburgerMenu());
                }));
            }
            else if (Device.OS == TargetPlatform.iOS)
            {
                SettingsIos.Text    = "+";
                SettingsIos.Command = new Command(() => { NavigateToSettings(); });
                ToolbarItems.Add(SettingsIos);
            }
            else
            {
                Debug.WriteLine("There is no device found");
            }

            Debug.WriteLine(UserLoggedIn.Token);
            Debug.WriteLine(UserLoggedIn.User);
        }
Exemple #7
0
 //public const string HttpResourceBase = "http://www.doitech.com/liufen/lesson/" + ResourceBase + "/";
 protected BaobaoGameController()
 {
     DataModel = new MenuPageViewModel(BookListName);
     DownloadController.Instance.OnFileAvailable += DataModel.Download_OnFileAvailable;
     var hanziList = HanziStrokeController.Instance.HanZi;
     //DownloadController.Instance.DownloadResource(DownloadController.BookListName);
 }
    public MenuPage()
    {
        this.InitializeComponent();
        var vm = new MenuPageViewModel();

        vm.MenuItems = new[]
        {
            new MenuItemViewModel
            {
                Header = "_File",
                Items  = new[]
                {
                    new MenuItemViewModel {
                        Header = "_Open...", Command = vm.OpenCommand
                    },
                    new MenuItemViewModel {
                        Header = "Save", Command = vm.SaveCommand
                    },
                    new MenuItemViewModel {
                        Header = "-"
                    },
                    new MenuItemViewModel
                    {
                        Header = "Recent",
                        Items  = new[]
                        {
                            new MenuItemViewModel
                            {
                                Header           = "File1.txt",
                                Command          = vm.OpenRecentCommand,
                                CommandParameter = @"c:\foo\File1.txt"
                            },
                            new MenuItemViewModel
                            {
                                Header           = "File2.txt",
                                Command          = vm.OpenRecentCommand,
                                CommandParameter = @"c:\foo\File2.txt"
                            },
                        }
                    },
                }
            },
            new MenuItemViewModel
            {
                Header = "_Edit",
                Items  = new[]
                {
                    new MenuItemViewModel {
                        Header = "_Copy"
                    },
                    new MenuItemViewModel {
                        Header = "_Paste"
                    },
                }
            }
        };

        DataContext = vm;
    }
Exemple #9
0
        public MenuPage()
        {
            Title = "Menu";
            InitializeComponent();
            var nav = ServiceLocator.Current.GetInstance <INavigationService>();

            BindingContext = new MenuPageViewModel(nav);
        }
Exemple #10
0
        //==================================================

        /*--------------------------------------
         *
         *  Constructor
         *
         * -----------------------------------*/

        public MenuPage()
        {
            InitializeComponent();

            vms                   = new MenuPageViewModel();
            BindingContext        = vms;
            BackgroundImageSource = vms.GetImageSource();
        }
 public MenuPage()
 {
     BindingContext = new MenuPageViewModel();
     Title          = "Menu";
     Icon           = Device.OS == TargetPlatform.iOS ? "menu.png" : null;
     InitializeComponent();
     Label.Text = Appl.Current.Properties["userName"].ToString();
 }
        public MenuPage()
        {
            InitializeComponent();

            ListView = MenuItemsListView;

            var vm = new MenuPageViewModel();

            this.BindingContext = vm;
        }
Exemple #13
0
        public MenuPage()
        {
            InitializeComponent();

            //ListView = MenuItemsListView;

            BindingContext = viewModel = new MenuPageViewModel();

            MenuItemsListView.SelectedItem = viewModel.MenuItems[0];
        }
        protected override void OnDataContextChanged(EventArgs e)
        {
            if (_model != null)
            {
                _model.View = null;
            }
            _model = DataContext as MenuPageViewModel;
            if (_model != null)
            {
                _model.View = this;
            }

            base.OnDataContextChanged(e);
        }
        public MenuPage()
        {
            this.InitializeComponent();
            try
            {
                this.BindingContext = this.viewModel = new MenuPageViewModel();
            }
            catch (Exception e)
            {
                Log.Warning("PROBLEM", $"{e.Message}: {e.StackTrace}");
            }

            // this.ListViewMenu.SelectedItem = this.viewModel.MenuItems[0];
            this.ListViewMenu.ItemSelected += this.ViewMenu_ItemSelected;
        }
Exemple #16
0
        public MenuPage(HOPage root)
        {
            Root = root;
            InitializeComponent();
            if (!App.IsWindows10)
            {
                //BackgroundColor = Color.FromHex("#03A9F4");
                //ListViewMenu.BackgroundColor = Color.FromHex("#36B0BB");
            }

            vm = new MenuPageViewModel(Root, Navigation)
            {
                Title    = "m.i.l.k. Digital ID",
                Subtitle = "m.i.l.k. Digital ID",
                Icon     = "slideout.png"
            };

            BindingContext = vm;
        }
Exemple #17
0
        public sealed override async void Init(object obj)
        {
            _model = new MenuPageViewModel(Navigation)
            {
                Title            = TextResources.x4ever,
                Subtitle         = TextResources.x4ever,
                Icon             = TextResources.icon_menu,
                Root             = (RootPage)obj,
                MenuBindCallback = MenuBind
            };
            BindingContext = _model;
            _helper        = DependencyService.Get <IHelper>();
            await _model.GetMenuData();

            await _model.GetProfilePhoto();

            _metaPivotService = DependencyService.Get <IMetaPivotService>();
            _media            = DependencyService.Get <Globals.IMedia>();
        }
        private async void Init(object obj)
        {
            _devicePermissionServices = DependencyService.Get <IDevicePermissionServices>();
            _model = new MenuPageViewModel(Navigation)
            {
                Title            = TextResources.XChallenge,
                Subtitle         = TextResources.XChallenge,
                Icon             = TextResources.icon_menu,
                Root             = (RootPage)obj,
                MenuBindCallback = MenuBind
            };
            BindingContext = this._model;
            _helper        = DependencyService.Get <IHelper>();
            await _model.GetMenuData();

            await _model.GetProfilePhoto();

            _metaPivotService = DependencyService.Get <IMetaPivotService>();
            _media            = DependencyService.Get <Globals.IMedia>();
        }
Exemple #19
0
        public MenuPage(RootPage root)
        {
            this.root = root;
            InitializeComponent();

            BackgroundColor = Color.FromHex("#03A9F4");
            ListViewMenu.BackgroundColor = Color.FromHex("#F5F5F5");

            BindingContext = new MenuPageViewModel();

            ListViewMenu.ItemsSource = menuItems = new List <HomeMenuItem>
            {
                new HomeMenuItem {
                    Title = "Timeline", MenuType = MenuType.Timeline, Icon = "about.png"
                },
                new HomeMenuItem {
                    Title = "Employees", MenuType = MenuType.Employees, Icon = "blog.png"
                },
                new HomeMenuItem {
                    Title = "Profile", MenuType = MenuType.Profile, Icon = "twitternav.png"
                }
            };

            ListViewMenu.SelectedItem = menuItems[0];

            ListViewMenu.ItemSelected += async(sender, e) =>
            {
                if (ListViewMenu.SelectedItem == null)
                {
                    return;
                }

                await this.root.NavigateAsync(((HomeMenuItem)e.SelectedItem).MenuType);

                ListViewMenu.SelectedItem = null;
            };
        }
 public MenuPage()
 {
     BindingContext = new MenuPageViewModel();
     Title          = "Menu";
     InitializeComponent();
 }
Exemple #21
0
 public MenuPage()
 {
     InitializeComponent();
     _vm            = new MenuPageViewModel();
     BindingContext = _vm;
 }
 public MenuPage()
 {
     InitializeComponent();
     BindingContext = new MenuPageViewModel(Navigation);
 }
Exemple #23
0
 public MenuPage()
 {
     InitializeComponent();
     BindingContext = vm = new MenuPageViewModel(null);
 }
 public void TearDown()
 {
     this.navigationService = null;
     this.subscribeManager  = null;
     this.menuPageViewModel = null;
 }
 public void Setup()
 {
     this.navigationService = new Mock <INavigationService>();
     this.subscribeManager  = new Mock <ISubscribeManager>();
     this.menuPageViewModel = new MenuPageViewModel(this.navigationService.Object, this.subscribeManager.Object);
 }
Exemple #26
0
        public MenuPage()
        {
            InitializeComponent();

            BindingContext = new MenuPageViewModel(new PageService());
        }
Exemple #27
0
 public MenuPage(MenuHandle display)
 {
     InitializeComponent();
     BindingContext = vm = new MenuPageViewModel(display);
 }
        public MenuPage(MenuPageViewModel vm)
        {
            InitializeComponent();

            BindingContext = vm;
        }
Exemple #29
0
 public MenuPage()
 {
     InitializeComponent();
     DataContext = new MenuPageViewModel();
 }
Exemple #30
0
        public MenuPage(MenuPageViewModel viewModel)
        {
            BindingContext = viewModel;

            InitializeComponent();
        }