Inheritance: MvvmHelpers.BaseViewModel
Esempio n. 1
0
        public CoffeesPage()
        {
            InitializeComponent();
            BindingContext = vm = new CoffeesViewModel();
            ListViewCoffees.ItemTapped += (sender, e) =>
            {
                if(Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android)
                    ListViewCoffees.SelectedItem = null;
            };

            if (Device.OS != TargetPlatform.iOS && Device.OS != TargetPlatform.Android)
            {
                ToolbarItems.Add(new ToolbarItem
                {
                    Text ="Refresh",
                    Command=vm.LoadCoffeesCommand
                });
            }
        }
Esempio n. 2
0
        public CoffeesPage()
        {
            InitializeComponent();
            BindingContext              = vm = new CoffeesViewModel();
            ListViewCoffees.ItemTapped += (sender, e) =>
            {
                if (Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android)
                {
                    ListViewCoffees.SelectedItem = null;
                }
            };

            if (Device.OS != TargetPlatform.iOS && Device.OS != TargetPlatform.Android)
            {
                ToolbarItems.Add(new ToolbarItem
                {
                    Text    = "Refresh",
                    Command = vm.LoadCoffeesCommand
                });
            }
        }