<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:mybutton="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/Resource/SimpleButton.mcml"
    xmlns:me="Me">

  
  <UI Name="SimpleSpinner">

    <Properties>
      <Image Name="SpinnerArrowBackDisabled"          Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowBackDisabled.png"/>
      <Image Name="SpinnerArrowBackDormant"           Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowBackDormant.png"/>
      <Image Name="SpinnerArrowBackFocus"             Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowBackFocus.png"/>
      <Image Name="SpinnerArrowBackFocusoverlay"      Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowBackFocusoverlay.png"/>
      <Image Name="SpinnerArrowBackNoFocus"           Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowBackNoFocus.png"/>
      <Image Name="SpinnerArrowForwardDisabled"       Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowForwardDisabled.png"/>
      <Image Name="SpinnerArrowForwardDormant"        Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowForwardDormant.png"/>
      <Image Name="SpinnerArrowForwardFocus"          Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowForwardFocus.png"/>
      <Image Name="SpinnerArrowForwardFocusOverlay"   Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowForwardFocusOverlay.png"/>
      <Image Name="SpinnerArrowForwardNoFocus"        Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerArrowForwardNoFocus.png"/>
      <Image Name="SpinnerBluebarLargeDormant"        Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerBluebarLargeDormant.png"/>
      <Image Name="SpinnerBluebarLargeFocus"          Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerBluebarLargeFocus.png"/>
      <Image Name="SpinnerBluebarLargeNoFocus"        Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/SpinnerBluebarLargeNoFocus.png"/>

      <IValueRange Name="Model" IValueRange="$Required" />
      <Color Name="BackgroundColor" Color="Transparent" />
      <FormatTransformer Name="LabelTransformer" Format="{0}" />
    </Properties>

    <Locals>
      <Command Name="Previous" Description="" />
      <Command Name="Next" Description="" />
      <cor:Boolean Name="HasFocus" />
      
      <Choice Name="Direction"
              Wrap="false">
        <Options>
          <cor:String String="Down" />
          <cor:String String="Up" />
        </Options>
      </Choice>

    </Locals>

    <Rules>
      <Binding Source="[Model.Value]" Target="[Value.Content]" Transformer="[LabelTransformer]" />
      <Binding Source="[Model.HasNextValue]" Target="[Next.Available]"/>
      <Binding Source="[Model.HasPreviousValue]" Target="[Previous.Available]"/>

      <Condition Source="[Model.HasPreviousValue]" ConditionOp="Equals" SourceValue="false">
        <Actions>
          <Invoke Target="[btnNext.NavigateInto]" />
        </Actions>
      </Condition>

      <Condition Source="[Model.HasNextValue]" ConditionOp="Equals" SourceValue="false">
        <Actions>
          <Invoke Target="[btnPrevious.NavigateInto]" />
        </Actions>
      </Condition>

      <Changed Source="[Previous.Invoked]">
        <Conditions>
          <Equality Source="[Model.HasPreviousValue]" ConditionOp="Equals" Value="true"/>
        </Conditions>
        <Actions>
          <Invoke Target="[Direction.PreviousValue]" />
          <Invoke Target="[Model.PreviousValue]" />
          <Invoke Target="[Background.ForceContentChange]" />
        </Actions>
      </Changed>

      <Changed Source="[Next.Invoked]">
        <Conditions>
          <Equality Source="[Model.HasNextValue]" ConditionOp="Equals" Value="true"/>
        </Conditions>
        <Actions>
          <Invoke Target="[Direction.NextValue]" />
          <Invoke Target="[Model.NextValue]" />
          <Invoke Target="[Background.ForceContentChange]" />
        </Actions>
      </Changed>

      <Condition Source="[Input.DeepKeyFocus]" SourceValue="true" Target="[HasFocus]" Value="[Input.DeepKeyFocus]" />
      <Condition Source="[Input.DeepMouseFocus]" SourceValue="true" Target="[HasFocus]" Value="[Input.DeepMouseFocus]" />

    </Rules>

    <Content>
      <Panel AnimationsEnabled="true">
        <Layout>
          <FlowLayout Orientation="Horizontal" />
        </Layout>
        <Children>

          <!-- Current value -->
          <Graphic Name="Background" Content="[SpinnerBluebarLargeNoFocus]" MinimumSize="425,51" MaximumSize="425,51" Padding="5,10,0,5" AnimationsEnabled="true">
            <Children>
              <Text Name="Value" Font="font://myresources:SpinnerTextF" Color="White" />
            </Children>
            <Animations>

              <SwitchAnimation Expression="[Direction]"
                           Type="ContentChangeShow">
                <Options>
                  <Animation Name="Down">
                    <Keyframes>
                      <!-- Fly down -->
                      <PositionKeyframe Time="0.0"
                                        Value="0,-51,0"
                                        Interpolation="Log"/>
                      <PositionKeyframe Time="0.2"
                                        Value="0,10,0"/>
                      <PositionKeyframe Time="0.3"
                                        Value="0,0,0"/>
                      <!-- And fade in -->
                      <AlphaKeyframe Time="0.0"
                                     Value="0.0"
                                     Interpolation="Log"/>
                      <AlphaKeyframe Time="0.3"
                                     Value="1.0"/>
                    </Keyframes>
                  </Animation>
                  <Animation Name="Up">
                    <Keyframes>
                      <!-- Fly up -->
                      <PositionKeyframe Time="0.0"
                                        Value="0,51,0"
                                        Interpolation="Log"/>
                      <PositionKeyframe Time="0.2"
                                        Value="0,-10,0"/>
                      <PositionKeyframe Time="0.3"
                                        Value="0,0,0"/>
                      <!-- And fade in -->
                      <AlphaKeyframe Time="0.0"
                                     Value="0.0"
                                     Interpolation="Log"/>
                      <AlphaKeyframe Time="0.3"
                                     Value="1.0"/>
                    </Keyframes>
                  </Animation>
                </Options>
              </SwitchAnimation>

              <SwitchAnimation Expression="[Direction]"
                           Type="ContentChangeHide">
                <Options>
                  <Animation Name="Down">
                    <Keyframes>
                      <!-- Fly off to the right -->
                      <PositionKeyframe Time="0.0"
                                        Value="0,0,0"
                                        RelativeTo="Current"
                                        Interpolation="Log"/>
                      <PositionKeyframe Time="0.3"
                                        Value="0,51,0"/>
                      <!-- And fade out -->
                      <AlphaKeyframe Time="0.0"
                                     Value="1.0"
                                     RelativeTo="Current"
                                     Interpolation="Log"/>
                      <AlphaKeyframe Time="0.3"
                                     Value="0.0"/>
                    </Keyframes>
                  </Animation>
                  <Animation Name="Up">
                    <Keyframes>
                      <!-- Fly off to the right -->
                      <PositionKeyframe Time="0.0"
                                        Value="0,0,0"
                                        RelativeTo="Current"
                                        Interpolation="Log"/>
                      <PositionKeyframe Time="0.3"
                                        Value="0,-51,0"/>
                      <!-- And fade out -->
                      <AlphaKeyframe Time="0.0"
                                     Value="1.0"
                                     RelativeTo="Current"
                                     Interpolation="Log"/>
                      <AlphaKeyframe Time="0.3"
                                     Value="0.0"/>
                    </Keyframes>
                  </Animation>
                </Options>
              </SwitchAnimation>

            </Animations>

          </Graphic>

          <!-- Previous button -->
          <mybutton:SimpleButton  Command="[Previous]"
                            ImageFocus="[SpinnerArrowBackFocus]"
                            ImageNoFocus="[SpinnerArrowBackNoFocus]"
                            ImageDormant="[SpinnerArrowBackDormant]"
                            ImagePressed="[SpinnerArrowBackFocus]"
                            Name="btnPrevious"
                            Size="50,51"
                            />

          <!-- Next button -->
          <mybutton:SimpleButton  Command="[Next]"
                            ImageFocus="[SpinnerArrowForwardFocus]"
                            ImageNoFocus="[SpinnerArrowForwardNoFocus]"
                            ImageDormant="[SpinnerArrowForwardDormant]"
                            ImagePressed="[SpinnerArrowForwardFocus]"
                            Name="btnNext"
                            Size="50,51"
                            />

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

</Mcml>
