CheckBox Walkthrough
CheckBoxWalkthrough.cs
// Copyright 2011 ESRI
// 
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
// 
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
// 
// See the use restrictions.
// 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;

using ESRI.ArcGISExplorer;
using ESRI.ArcGISExplorer.Application;
using ESRI.ArcGISExplorer.Mapping;
using ESRI.ArcGISExplorer.Geometry;
using ESRI.ArcGISExplorer.Data;
using ESRI.ArcGISExplorer.Threading;

namespace CheckBoxWalkthroughCS
{
  public class CheckBoxWalkthrough : ESRI.ArcGISExplorer.Application.CheckBox
  {
    public override void OnUpdate()
    {
      // grab the selected Image Overlay & change the state of the checkbox to match 
      ImageOverlay selected = ESRI.ArcGISExplorer.Application.Application.SelectedItems.GetFirst() as ImageOverlay;
      if (selected != null)
      {
        this.Enabled = true;
        this.Checked = selected.Visible;
      }
      else
        this.Enabled = false;
    }
    public override void OnClick()
    {
      // grab the selected Image Overlay & change the state of the ImageOverlay
      ImageOverlay selected = ESRI.ArcGISExplorer.Application.Application.SelectedItems.GetFirst() as ImageOverlay;
      if (selected != null)
        selected.Visible = this.Checked;
    }
  }
}