Inheritance: MvvmHelpers.BaseViewModel
コード例 #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
                });
            }
        }
コード例 #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
                });
            }
        }