private void Update_Item(object sender, RoutedEventArgs e)
        {
            TodoItemViewModels ViewModels = ((App)App.Current).ViewModels;

            ViewModels.SelectedItem = ViewModels.GetItemByItemId(Id.Text);
            ViewModels.UpdatingItem();
        }
Esempio n. 2
0
        public MainPage()
        {
            this.InitializeComponent();
            ViewModels = TodoItemViewModels.Instance;
            //ViewModels = ((App)App.Current).ViewModels;
            latestInstance = this;
            var titleBar = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar;

            titleBar.BackgroundColor            = Colors.ForestGreen;
            titleBar.ForegroundColor            = Colors.White;
            titleBar.ButtonBackgroundColor      = Colors.ForestGreen;
            titleBar.ButtonForegroundColor      = Colors.White;
            titleBar.ButtonHoverBackgroundColor = Colors.White;
            titleBar.ButtonHoverForegroundColor = Colors.ForestGreen;

            left.Navigate(typeof(ListItem));
            right.Navigate(typeof(EditItem));

            if (Window.Current.Bounds.Width < 800)
            {
                VisualStateManager.GoToState(this, stateList, false);
            }

            if (right.Visibility == Visibility.Collapsed)
            {
                state = stateList;
            }
            else if (left.Visibility == Visibility.Collapsed)
            {
                state = stateEdit;
            }

            this.SizeChanged += new SizeChangedEventHandler(Resize);
        }
Esempio n. 3
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter.Equals(""))
     {
         return;
     }
     ViewModels = (TodoItemViewModels)e.Parameter;
 }
        private void Share_Item(object sender, RoutedEventArgs e)
        {
            TodoItemViewModels ViewModels = ((App)App.Current).ViewModels;
            var item = ViewModels.GetItemByItemId(Id.Text);

            ViewModels.SharingItem = item;
            DataTransferManager.ShowShareUI();
        }
Esempio n. 5
0
 public DetailsEditUserControl()
 {
     this.InitializeComponent();
     if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
     {
         return;
     }
     ViewModels       = ((App)App.Current).ViewModels;
     this.DataContext = this.ViewModels;
 }
Esempio n. 6
0
        public MainPage()
        {
            this.InitializeComponent();
            ViewModels = new TodoItemViewModels();
            //Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = false;
            var titleBar = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar;

            titleBar.BackgroundColor            = Colors.ForestGreen;
            titleBar.ForegroundColor            = Colors.White;
            titleBar.ButtonBackgroundColor      = Colors.ForestGreen;
            titleBar.ButtonForegroundColor      = Colors.White;
            titleBar.ButtonHoverBackgroundColor = Colors.White;
            titleBar.ButtonHoverForegroundColor = Colors.ForestGreen;

            //listView.ItemTemplate = new DataTemplate();
        }
 public void ReadData()
 {
     using (var statement = conn.Prepare("SELECT Id,Title,Description,Date,Image, Completed FROM ListItem"))
     {
         while (SQLiteResult.ROW == statement.Step())
         {
             TodoItemViewModels ViewModels = ((App)App.Current).ViewModels;
             bool completed = false;
             if (statement[5] != null && (string)statement[5] == "True")
             {
                 completed = true;
             }
             TodoItem item = new TodoItem((string)statement[0], (string)statement[1], (string)statement[2], StringToDateTime((string)statement[3]), new Uri((string)statement[4]), completed);
             ViewModels.AddTodoItem(item);
         }
     }
 }
Esempio n. 8
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     ViewModels = (TodoItemViewModels)e.Parameter;
     if (ViewModels.selectedItem != null)
     {
         var item = ViewModels.selectedItem;
         id.Text                 = item.Id;
         title.Text              = item.Title;
         description.Text        = item.Description;
         datePicker.Date         = item.Date;
         submit.Content          = "Update";
         ViewModels.selectedItem = null;
     }
     else
     {
         delete.Visibility = Visibility.Collapsed;
     }
 }
        private void CheckBox_Click(object sender, RoutedEventArgs e)
        {
            TodoItemViewModels ViewModels = ((App)App.Current).ViewModels;

            ((App)App.Current).DataBaseForTodoList.Update(ViewModels.GetItemByItemId(Id.Text));
        }
        private void Delete_Item(object sender, RoutedEventArgs e)
        {
            TodoItemViewModels ViewModels = ((App)App.Current).ViewModels;

            ViewModels.RemoveTodoItem(Id.Text);
        }
Esempio n. 11
0
 public EditItem()
 {
     this.InitializeComponent();
     ViewModels     = TodoItemViewModels.Instance;
     latestInstance = this;
 }