コード例 #1
0
		public TodoListXaml ()
		{
			InitializeComponent ();

			var tbi = new ToolbarItem ("+", null, () => {
				var todoItem = new TodoItem();
				var todoPage = new TodoItemXaml();
				todoPage.BindingContext = todoItem;
				Navigation.PushAsync(todoPage);
			}, 0, 0);
			if (Device.OS == TargetPlatform.Android) { // BUG: Android doesn't support the icon being null
				tbi = new ToolbarItem ("+", "plus", () => {
					var todoItem = new TodoItem();
					var todoPage = new TodoItemXaml();
					todoPage.BindingContext = todoItem;
					Navigation.PushAsync(todoPage);
				}, 0, 0);
			}

			ToolbarItems.Add (tbi);

//			if (Device.OS == TargetPlatform.iOS) {
//				var tbi2 = new ToolbarItem ("?", null, () => {
//					var todos = App.Database.GetItemsNotDone();
//					var tospeak = "";
//					foreach (var t in todos)
//						tospeak += t.Name + " ";
//					if (tospeak == "") tospeak = "there are no tasks to do";
//					App.Speech.Speak(tospeak);
//				}, 0, 0);
//				ToolbarItems.Add (tbi2);
//			}
		}
コード例 #2
0
        public TodoListXaml()
        {
            InitializeComponent();

            var tbi = new ToolbarItem("+", null, () => {
                var todoItem            = new TodoItem();
                var todoPage            = new TodoItemXaml();
                todoPage.BindingContext = todoItem;
                Navigation.PushAsync(todoPage);
            }, 0, 0);

            if (Device.OS == TargetPlatform.Android)               // BUG: Android doesn't support the icon being null
            {
                tbi = new ToolbarItem("+", "plus", () => {
                    var todoItem            = new TodoItem();
                    var todoPage            = new TodoItemXaml();
                    todoPage.BindingContext = todoItem;
                    Navigation.PushAsync(todoPage);
                }, 0, 0);
            }

            ToolbarItems.Add(tbi);

//			if (Device.OS == TargetPlatform.iOS) {
//				var tbi2 = new ToolbarItem ("?", null, () => {
//					var todos = App.Database.GetItemsNotDone();
//					var tospeak = "";
//					foreach (var t in todos)
//						tospeak += t.Name + " ";
//					if (tospeak == "") tospeak = "there are no tasks to do";
//					App.Speech.Speak(tospeak);
//				}, 0, 0);
//				ToolbarItems.Add (tbi2);
//			}
        }
コード例 #3
0
        public void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var todoItem = e.SelectedItem as TodoItem;
            var todoPage = new TodoItemXaml();

            todoPage.BindingContext = todoItem;
            Navigation.PushAsync(todoPage);
        }
コード例 #4
0
        public TodoListXaml()
        {
            InitializeComponent();

            // HACK: workaround issue #894 for now
            if (Device.OS == TargetPlatform.iOS)
            {
                listView.ItemsSource = new string [1] {
                    ""
                }
            }
            ;

            var tbi = new ToolbarItem("+", null, () => {
                var todoItem            = new TodoItem();
                var todoPage            = new TodoItemXaml();
                todoPage.BindingContext = todoItem;
                Navigation.PushAsync(todoPage);
            }, 0, 0);

            if (Device.OS == TargetPlatform.Android)               // BUG: Android doesn't support the icon being null
            {
                tbi = new ToolbarItem("+", "plus", () => {
                    var todoItem            = new TodoItem();
                    var todoPage            = new TodoItemXaml();
                    todoPage.BindingContext = todoItem;
                    Navigation.PushAsync(todoPage);
                }, 0, 0);
            }

            ToolbarItems.Add(tbi);

            if (Device.OS == TargetPlatform.iOS)
            {
                var tbi2 = new ToolbarItem("?", null, () => {
                    var todos   = App.Database.GetItemsNotDone();
                    var tospeak = "";
                    foreach (var t in todos)
                    {
                        tospeak += t.Name + " ";
                    }
                    if (tospeak == "")
                    {
                        tospeak = "there are no tasks to do";
                    }
                    App.Speech.Speak(tospeak);
                }, 0, 0);
                ToolbarItems.Add(tbi2);
            }
        }
コード例 #5
0
		public TodoListXaml ()
		{
			InitializeComponent ();

			// HACK: workaround issue #894 for now
			if (Device.OS == TargetPlatform.iOS)
				listView.ItemsSource = new string [1] {""};

			var tbi = new ToolbarItem ("+", null, () => {
				var todoItem = new TodoItem();
				var todoPage = new TodoItemXaml();
				todoPage.BindingContext = todoItem;
				Navigation.PushAsync(todoPage);
			}, 0, 0);
			if (Device.OS == TargetPlatform.Android) { // BUG: Android doesn't support the icon being null
				tbi = new ToolbarItem ("+", "plus", () => {
					var todoItem = new TodoItem();
					var todoPage = new TodoItemXaml();
					todoPage.BindingContext = todoItem;
					Navigation.PushAsync(todoPage);
				}, 0, 0);
			}

			ToolbarItems.Add (tbi);

			if (Device.OS == TargetPlatform.iOS) {
				var tbi2 = new ToolbarItem ("?", null, () => {
					var todos = App.Database.GetItemsNotDone();
					var tospeak = "";
					foreach (var t in todos)
						tospeak += t.Name + " ";
					if (tospeak == "") tospeak = "there are no tasks to do";
					App.Speech.Speak(tospeak);
				}, 0, 0);
				ToolbarItems.Add (tbi2);
			}
		}
コード例 #6
0
		public void OnItemSelected (object sender, SelectedItemChangedEventArgs e) {
			var todoItem = e.SelectedItem as TodoItem;
			var todoPage = new TodoItemXaml();
			todoPage.BindingContext = todoItem;
			Navigation.PushAsync(todoPage);
		}