コード例 #1
0
        void Start()
        {
            OnGPSUpdate += MasterDetailPage1Detail_OnGPSUpdate;


            Device.StartTimer(TimeSpan.FromSeconds(5), () => {
                Task.Run(async() => {
                    var t = await GPSLocator.UpdateLocation();

                    OnGPSUpdate.Invoke(GPSLocator.ResultPosition);
                }).ConfigureAwait(false);
                return(true);
            });
            //--for the dashboard
            TaskList = new ObservableCollection <TaskModel>();

            ListViewTask.ItemTemplate = new DataTemplate(typeof(CustomVeggieCell));
            TaskList.Add(new TaskModel {
                Image = "icon.png", Name = "Tomato", Type = "Fruit"
            });
            TaskList.Add(new TaskModel {
                Image = "icon.png", Name = "Romaine Lettuce", Type = "Vegetable",
            });
            TaskList.Add(new TaskModel {
                Image = "icon.png", Name = "Zucchini", Type = "Vegetable"
            });
            ListViewTask.ItemsSource   = TaskList;
            ListViewTask.ItemSelected += ListViewTask_ItemSelected;
            //--
        }
コード例 #2
0
        public MasterDetailPage1()
        {
            InitializeComponent();
            instance = this;

            NavigationPage.SetHasNavigationBar(this, false);
            MasterPage.ListView.ItemSelected += ListView_ItemSelected;


            //-- gps constant update
            Device.StartTimer(TimeSpan.FromSeconds(5), () => {
                Task.Run(async() => {
                    var t = await GPSLocator.UpdateLocation();
                    OnGPSUpdate.Invoke(GPSLocator.ResultPosition);
                }).ConfigureAwait(false);
                return(true);
            });
            //-- gps constant update
        }