title: default text in textbox wpf
body: <p>I have a <code>TextBox</code>, its <code>Text</code> property is bound to a property of type <code>double</code> named <code>Grade</code>. I also have a <code>CheckBox</code>, when the <code>CheckBox</code> is checked I want the <code>Grade</code> to take an auto calculated value (i.e. automatically set to MaxScore/Count of questions). If the <code>CheckBox</code> is not checked then I want to set and change the <code>Grade</code> Manually. My question is <strong>how can I implement this?</strong></p>
  
  <pre><code>&lt;TextBox Height="23"
     Visibility="{Binding Path=Visible2, Converter={StaticResource boolToVis}, UpdateSourceTrigger=PropertyChanged}"
     Text="{Binding Path=Grade,UpdateSourceTrigger =PropertyChanged,Mode=TwoWay}"
     HorizontalAlignment="Left" Margin="376,453,0,0"
     Name="textBox3" VerticalAlignment="Top" Width="120" /&gt;
  </code></pre>
  
  <p>and i bind this to:</p>
  
  <pre><code> public double Grade
          {
              get
              {
  
                  return grade;
              }
              set
              {
                  grade = value;
                  OnPropertyChanged("Grade");
  
                  foreach (ExaminationQuestion exaq in
                           this.Examination.ExaminationQuestions)
                  {
                      if (exaq.Question.Guid == SelectedQuestionDropList.Guid)
                      {
                          exaq.Grade = value;
                      }
                  }
              }
          }
  </code></pre>
  
  <p>Thanks</p>