Exemplo n.º 1
0
        private void TasksList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TaskModel task = TasksList.SelectedItem as TaskModel;

            if (task != null)
            {
                TitleTxt.Text = task.TaskName;
                bool IsAlreadyFav = UserDB.IsFavouriteTask(task.TaskId, App.CurrentUser);
                if (!IsAlreadyFav)
                {
                    UserDB.AddFavouriteTaskIds(task.TaskId, App.CurrentUser);
                }
                fav = UserDB.GetFavorite(task.TaskId, App.CurrentUser);
                StarBtnDetails.DataContext = fav;
                comments = CommentDB.GetComments(task.TaskId);
                CommentsList.ItemsSource = comments;
                AddButton.Tag            = task.TaskId;
                DetailsFrame.Navigate(typeof(DetailView), task, new SuppressNavigationTransitionInfo());
            }
            double Acutalwidth = this.ActualWidth;

            if (ActualWidth < 700)
            {
                TasksList.Visibility           = Visibility.Collapsed;
                ComboboxPanel.Visibility       = Visibility.Collapsed;
                DetailAndDiscussion.Visibility = Visibility.Visible;
                BackBtn.Visibility             = Visibility.Visible;
            }
            if (ActualWidth >= 700)
            {
                TasksList.Visibility           = Visibility.Visible;
                DetailAndDiscussion.Visibility = Visibility.Visible;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves a collection of comments associated with the photo.
        /// </summary>
        /// <returns>A collection of Comment objects.</returns>
        public Comments GetComments()
        {
            if (comments == null)
            {
                CommentDB db = new CommentDB(token.DBConnection);
                comments = db.GetComments(token, this);
            }

            return(comments);
        }