/** UI Updating Functionality **/

        //Reloads UI elements whenever the page becomes visible again in case something changed
        private void OnPageVisible(Object sender, DependencyPropertyChangedEventArgs e)
        {
            if (this.IsVisible) //update the UI source
            {
                //set title
                ProjectTitle.SetCurrentValue(TextBlock.TextProperty, project.title);
                //set subtitle
                ProjectSubtitle.SetCurrentValue(TextBlock.TextProperty, project.subtitle);
                if (HelpFunctions.StringIsBlank(ProjectSubtitle.Text))
                {
                    ProjectSubtitle.Visibility = Visibility.Collapsed;
                }
                else
                {
                    ProjectSubtitle.Visibility = Visibility.Visible;
                }
                //update topic list
                UpdateTopicList();
                //update tag list
                UpdateTagList();
                //set default filter mode and clear tag selection
                SetDefaultFiltering();
                //update future elements...
            }
        }
Ejemplo n.º 2
0
 private void CreateProject_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (HelpFunctions.StringIsBlank(TitleInput.Text))
     {
         e.CanExecute = false;
     }
     else
     {
         e.CanExecute = true;
     }
 }
 private void SaveTopic_CanExecute(Object sender, CanExecuteRoutedEventArgs e)
 {
     if (!HelpFunctions.StringIsBlank(GivenTitle.Text))
     {
         e.CanExecute = true;
     }
     else
     {
         e.CanExecute = false;
     }
 }
 private void NewTag_Clicked(Object sender, RoutedEventArgs e)
 {
     if (!NewTagInputBox.Visibility.Equals(Visibility.Visible))
     {
         NewTagInputBox.Visibility = Visibility.Visible;
         Keyboard.Focus(NewTagInputBox);
     }
     else
     {
         if (!HelpFunctions.StringIsBlank(NewTagInputBox.Text))
         {
             this.project.AddTag(NewTagInputBox.Text);
             UpdateTagList();
             NewTagInputBox.Visibility = Visibility.Collapsed;
             NewTagInputBox.Text       = "";
         }
     }
 }