title: Change border color depending on boolean value
body: <p>I have a border wihch I want to change its color depending on a boolean variable. I used the <a href="https://stackoverflow.com/questions/8533546/use-of-boolean-to-color-converter-in-xaml">link here</a> to implement a <code>Boolean</code> to <code>Color</code> converter.</p>
  
  <p>The code looks like this:</p>
  
  <p><strong>The xaml:</strong></p>
  
  <pre><code>&lt;Border Width="45" 
       Height="45" CornerRadius="5" 
       Background="{Binding Path=LivenessActive, Converter={StaticResource BrushColorConverter}}" /&gt;
  </code></pre>
  
  <p><strong>The LivenessActive variable in background:</strong></p>
  
  <pre><code>public bool LivenessActive
  {
    get { return _livenessActive; }
    set
    {
        _livenessActive = value;
        OnPropertyChanged("LivenessActive");
    }
  }
  </code></pre>
  
  <p>Where the class has an inheritance to the <code>INotifyPropertyChanged</code> and has implemented the <code>OnPropertyChanged</code> event.</p>
  
  <p><strong>The BrushColorConverter.cs:</strong></p>
  
  <pre><code>public class BrushColorConverter : IValueConverter
  {
      public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
      {
          if ((bool)value)
          {
              {
                  return new SolidColorBrush(Colors.GreenYellow);
              }
          }
          return new SolidColorBrush(Colors.DarkGray);
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
      {
          throw new NotImplementedException();
      }
  
  }
  </code></pre>
  
  <p>But I can't fire even the <code>BrushColorConverter</code>. What I'm doing wrong?</p>
  
  <p><strong>2nd: What about if I want to use it from an another Window?</strong></p>
  
  <pre><code>&lt;Border Width="45" Height="45" CornerRadius="5" 
       Background="{Binding Path=LivenessActive, Converter={StaticResource BrushColorConverter}, 
                  RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type view:MyWindowName}}}" /&gt;
  </code></pre>
  
  <p>I used this same code and it's not finding it.</p>