//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
//  THIS FILE IS GENERATED BY EASY BINDINGS, DO NOT MODIFY IT
//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

import Cocoa

//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
//   EBGraphicView
//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

extension  EBGraphicView {

  //····················································································································

  final func bind_gridCrossColor (_ model: EBReadOnlyProperty_NSColor) {
    self.mGridCrossColorController = EBObservablePropertyController (
      observedObjects: [model],
      callBack: { [weak self] in self?.updateGridColor (from: model) }
    )
  }

  //····················································································································

  final func unbind_gridCrossColor () {
    self.mGridCrossColorController?.unregister ()
    self.mGridCrossColorController = nil
  }

  //····················································································································

  final private func updateGridColor (from model : EBReadOnlyProperty_NSColor) {
    switch model.selection {
    case .empty, .multiple  :
      self.mGridCrossColor = .black
    case .single (let v) :
      self.mGridCrossColor = v
    }
  }

  //····················································································································  //····················································································································

}

//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
