Ejemplo n.º 1
0
        public void OnCompleted(object sender, EventArgs e)
        {
            var mi = ((MenuItem)sender);

            GoalsDB.CompletedGoal(mi.CommandParameter.ToString());
            DisplayGoals(periodIndex);
        }
Ejemplo n.º 2
0
        public void OnRemove(object sender, EventArgs e)
        {
            var mi = ((MenuItem)sender);

            GoalsDB.RemoveGoal(mi.CommandParameter.ToString());
            //BindingContext = _goalsPreviewList;
            DisplayGoals(periodIndex);
        }
Ejemplo n.º 3
0
 public FutureTodoPage()
 {
     InitializeComponent();
     BindingContext = new FutureTodoVM {
         Todos = GoalsDB.GetFuture()
     };
     futureList.ItemsSource  = GoalsDB.GetFuture();
     futureList.ItemTemplate = new DataTemplate(typeof(TextCell)); // has context actions defined
     futureList.ItemTemplate.SetBinding(TextCell.TextProperty, "Title");
     futureList.ItemTemplate.SetBinding(TextCell.DetailProperty, "Text");
 }
Ejemplo n.º 4
0
 public ArchivedTodoPage()
 {
     InitializeComponent();
     BindingContext = new CompletedTodoVM {
         Todos = GoalsDB.GetCompleted()
     };
     completedList.ItemsSource  = GoalsDB.GetCompleted();
     completedList.ItemTemplate = new DataTemplate(typeof(TextCell)); // has context actions defined
     completedList.ItemTemplate.SetBinding(TextCell.TextProperty, "Title");
     completedList.ItemTemplate.SetBinding(TextCell.DetailProperty, "Text");
 }
Ejemplo n.º 5
0
        public MainPage()
        {
            _listGoals = GoalsDB.GetInstance();

            // Start reviewing weekly goal's.
            _goalsPreviewList = new GoalsPreviewVM();
            //DisplayGoals(periodIndex);
            InitializeComponent();

            //goalsListView.ItemSelected += OnSelection;
            //goalsListView.ItemTapped += OnTap;
        }
Ejemplo n.º 6
0
        async void AddNewTodo(object sender, EventArgs e)
        {
            //TODO.Views.
            //string title = titleEntry.Text();
            Goal item = new Goal
            {
                Title       = titleEntry.Text,
                Text        = textEntry.Text,
                DatePlanned = datePlannedPicker.Date
            };

            //Todo: Make new TodoItem Object and save it to db.
            GoalsDB.AddTodo(item);
            await Navigation.PopAsync();
        }
Ejemplo n.º 7
0
        // 0 = Weekly, 1 = Quarter, 2 = ...
        void DisplayGoals(int index)
        {
            // Parses index between avalible marginal.
            if (index < 0)
            {
                periodIndex = 3;
            }
            else if (index >= 4)
            {
                periodIndex = 0;
            }

            switch (periodIndex)
            {
            case 0:
                _goalsPreviewList.Todos   = GoalsDB.GetWeekList();
                _goalsPreviewList.Intro   = "Weekly Goals";
                _goalsPreviewList.Summary = "There is " + _goalsPreviewList.Todos.Count + " Goals this week";
                break;

            case 1:
                _goalsPreviewList.Todos   = GoalsDB.GetQuarterList();
                _goalsPreviewList.Intro   = "Month Goals";
                _goalsPreviewList.Summary = "There is " + _goalsPreviewList.Todos.Count + " Goals this month";
                break;

            case 2:
                _goalsPreviewList.Todos   = GoalsDB.GetQuarterList();
                _goalsPreviewList.Intro   = "Quarter Goals";
                _goalsPreviewList.Summary = "There is " + _goalsPreviewList.Todos.Count + " Goals this quarter";
                break;

            case 3:
                _goalsPreviewList.Todos   = GoalsDB.GetYearList();
                _goalsPreviewList.Intro   = "Year Goals";
                _goalsPreviewList.Summary = "There is " + _goalsPreviewList.Todos.Count + " Goals this year";
                break;
            }
            goalsListView.ItemsSource = _goalsPreviewList.Todos;
            periodTitle.Text          = _goalsPreviewList.Intro;
            BindingContext            = _goalsPreviewList;
        }