Exemple #1
0
 public static ListItemViewModels GetInstance()
 {
     if (myInstance == null)
     {
         myInstance = new ListItemViewModels();
     }
     return(myInstance);
 }
Exemple #2
0
        public MainPage()
        {
            this.InitializeComponent();
            var viewTitleBar = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar;

            viewTitleBar.BackgroundColor       = Windows.UI.Colors.White;
            viewTitleBar.ButtonBackgroundColor = Windows.UI.Colors.White;
            ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size {
                Width = 420, Height = 480
            });
            ViewModel = ViewModels.ListItemViewModels.GetInstance();
            UpdateTile();
        }
Exemple #3
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     ViewModel = ((ViewModels.ListItemViewModels)e.Parameter);
     if (ViewModel.SelectedItem == null)
     {
         createButton.Content = "Create";
         title.Text           = "";
         details.Text         = "";
         DueDate.Date         = DateTime.Now;
     }
     else
     {
         createButton.Content = "Update";
         itemImage.Source     = ViewModel.SelectedItem.imagerUrl;
         title.Text           = ViewModel.SelectedItem.title;
         details.Text         = ViewModel.SelectedItem.description;
         DueDate.Date         = ViewModel.SelectedItem.date;
     }
 }
Exemple #4
0
        public static ListItemViewModels getInstance()
        {
            if (viewModel == null)
            {
                viewModel = new ListItemViewModels();
                var db = App.conn;
                using (var statement = db.Prepare(App.SELECT))
                {
                    while (SQLiteResult.ROW == statement.Step())
                    {
                        DateTime    date       = Convert.ToDateTime(statement[3].ToString());
                        ImageSource defaultUrl = new BitmapImage(new Uri(statement[5].ToString()));
                        viewModel.allItems.Add(new Models.TodoItem(statement[0].ToString(), statement[1].ToString(), statement[2].ToString(), date, statement[4].ToString(), defaultUrl));
                    }
                }

                return(viewModel);
            }
            else
            {
                return(viewModel);
            }
        }
Exemple #5
0
 public NewPage()
 {
     this.InitializeComponent();
     ViewModel = ViewModels.ListItemViewModels.GetInstance();
 }
Exemple #6
0
 public MainPage()
 {
     this.InitializeComponent();
     this.ViewModel = new ViewModels.ListItemViewModels();
 }
Exemple #7
0
 public UserControl()
 {
     this.InitializeComponent();
     this.DataContextChanged += (s, e) => Bindings.Update();
     ViewModel = ViewModels.ListItemViewModels.getInstance();
 }
Exemple #8
0
 public MainPage()
 {
     this.InitializeComponent();
     NavigationCacheMode = NavigationCacheMode.Enabled;
     ViewModel           = ViewModels.ListItemViewModels.getInstance();
 }