<Mcml
    xmlns="http://schemas.microsoft.com/2008/mcml"
    xmlns:cor="assembly://MSCorlib/System"
    xmlns:addin="assembly://Microsoft.MediaCenter/Microsoft.MediaCenter.Hosting"
    <PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/GPNVSCMD.do?cmd=AddResourceFile;name=xmlns:myresources;content=PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/Resource/Resources_%cc.mcml/>
    xmlns:me="Me">

  <UI Name="SimpleButton">

    <Properties>

      <ICommand Name="Command" ICommand="$Required" />
      <cor:Boolean Name="IsNavigatingCommand" Boolean="false" />
      <Size Name="Size" Size="251,51" />
      <Font Name="Font" Font="font://myresources:SpinnerTextF" />
      <Image Name="ImageFocus" Image="$Required" />
      <Image Name="ImageNoFocus" Image="$Required" />
      <Image Name="ImageDormant" Image="$Required" />
      <Image Name="ImagePressed" Image="$Required" />

    </Properties>

    <Locals>

      <ClickHandler Name="Clicker" />

    </Locals>

    <Rules>

      <Binding Source="[Command]" Target="[Clicker.Command]" />
      <Binding Source="[Command.Available]" Target="[Input.KeyInteractive]" />
      <Binding Source="[Font]" Target="[Label.Font]" />
      <Binding Source="[Command.Description]" Target="[Label.Content]"/>
      <Default Target="[Input.KeyInteractive]" Value="true" />

      <Condition Source="[Clicker.Clicking]" SourceValue="true">
        <Conditions>
          <Equality Source="[Command.Available]" ConditionOp="Equals" Value="true" />
        </Conditions>
        <Actions>
          <Set Target="[imgButton.Content]" Value="[ImagePressed]"/>
        </Actions>
      </Condition>

      <Condition Source="[Input.KeyFocus]" SourceValue="true">
        <Conditions>
          <Equality Source="[Command.Available]" ConditionOp="Equals" Value="true" />
        </Conditions>
        <Actions>
          <Set Target="[imgButton.Content]" Value="[ImageFocus]"/>
        </Actions>
      </Condition>

      <Condition Source="[Input.MouseFocus]" SourceValue="true">
        <Conditions>
          <Equality Source="[Command.Available]" ConditionOp="Equals" Value="true" />
        </Conditions>
        <Actions>
          <Set Target="[imgButton.Content]" Value="[ImageFocus]"/>
        </Actions>
      </Condition>

      <Condition Source="[Command.Available]" ConditionOp="Equals" SourceValue="false">
        <Actions>
          <Set Target="[imgButton.Content]" Value="[ImageDormant]" />
        </Actions>
      </Condition>

      <!-- Various other state is hooked up as well (all of which are    -->
      <!-- important for accessiblity aides.                             -->
      <Binding Target="[Accessible.IsPressed]"            Source="[Clicker.Clicking]"/>
      <Binding Target="[Accessible.IsFocusable]"          Source="[Input.KeyInteractive]"/>
      <Binding Target="[Accessible.IsFocused]"            Source="[Input.KeyFocus]"/>
      <Binding Target="[Accessible.Name]"                 Source="[Command.Description]"/>
      <Default Target="[Accessible.DefaultActionCommand]" Value="[Command]"/>
      <Default Target="[Accessible.DefaultAction]"        Value="Press"/>
      <Default Target="[Accessible.Role]"                 Value="PushButton"/>

    </Rules>

    <Content>

      <Panel>
        <Children>

          <Graphic Name="imgButton"
                   Content="[ImageNoFocus]"
                   Padding="0,0,0,0"
                   MouseInteractive="true"
                   MinimumSize="[Size]"
                   MaximumSize="[Size]"
                   SizingPolicy="SizeToContent"
                   HorizontalAlignment="Fill"
                   VerticalAlignment="Fill"
                   Layout="Form"
                   >
            <Children>
              <Text Name="Label" Color="White" Margins="0,0,0,0" Font="[Font]" />
            </Children>
          </Graphic>

        </Children>
      </Panel>
    </Content>
  </UI>

</Mcml>
