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

  <!-- Image -->
  <Image Name="BG_arrow"                        Image="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/BG_arrow.png"/>
  
  <Image Name="NofocusedNaviButton"             Image="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/COMMON.BUTTON.FIRSTRUN.DORMANT.FULL.decoded.png"/>
  <Image Name="FocusedNaviButton"               Image="PBDA://2734dc82-774d-4daa-a5ad-2838b5a58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/COMMON.BUTTON.LEFT.FOCUS.decoded.png"/>
  <Image Name="PressedNaviButton"               Image="PBDA://2734dc82-774d-4daa-a5ad-2838b5a58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/COMMON.BUTTON.LEFT.FOCUSOVERLAY.decoded.png"/>
  <Image Name="Background"                      Image="PBDA://2734dc82-774d-4daa-a5ad-2838b5a58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/COMMON.BACKGROUND.decoded.png"/>
  <Image Name="Background1"                     Image="PBDA://2734dc82-774d-4daa-a5ad-2838b5a58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/bg2.decoded.png"/>
  <Image Name="Background2"                     Image="PBDA://2734dc82-774d-4daa-a5ad-2838b5a58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/bg2.decoded.png"/>

  <Color Name="TitleColor" Color="160, 209, 252"/>

  <Animation Name="ButtonFocusOverlayIdle" Loop="-1" Type="Idle">
    <Keyframes>
      <AlphaKeyframe Time="0.0" Value="0.0" Interpolation="SCurve" RelativeTo="Absolute"/>
      <AlphaKeyframe Time="1.55" Value="0.60" Interpolation="SCurve" RelativeTo="Absolute"/>
      <AlphaKeyframe Time="2.0" Value="0.0" RelativeTo="Absolute"/>
    </Keyframes>
  </Animation>
  
  <!-- FirstRun page. Settings is same, except for text. -->
  <UI Name="FirstRunPage">

    <Properties>
      <Image Name="ImgComposite"  Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/auxiliary_Composite.png"/>
      <Image Name="ImgSVideo"     Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/auxiliary_S-Video.png"/>
      <Image Name="ImgComponent"  Source="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/Microsoft.com/NV/Variable/MCE/Assets/Base64Binary/auxiliary_Component.png"/>

      <addin:PageSession Name="Session" PageSession="$Required"/>

    </Properties>

    <Locals>
      <addin:AddInHost Name="AddInHost"/>
      <Command Name="Back" Description="global://myresources:str_2_12_5"/>
      <Command Name="Next" Description="global://myresources:str_2_12_6"/>
      <Command Name="Cancel" Description="global://myresources:str_2_12_7"/>
      <Command Name="RadioCmd"/>

      <cor:Int32 Name="SessionResult" Int32="0"/>
      <cor:String Name="SetSourceCmd" String="PBDA://2734DC82-774D-4daa-A5AD-2838B5A58127/GPNVSCMD.do?cmd=SetSignalSource;source="/>
      <cor:String Name="strTemp" String=""/>
      <cor:Boolean Name="IsInitialized" Boolean="false"/>

      <Choice Name="Model">
        <Options>
          <cor:String String="global://myresources:str_2_13_3" />
          <cor:String String="global://myresources:str_2_13_4" />
          <cor:String String="global://myresources:str_2_13_5" />
        </Options>
      </Choice>

    </Locals>

    <Rules>
     
      <Changed Source="[Back.Invoked]">
        <Actions>
          <Invoke Target="[Session!addin:HistoryOrientedPageSession.BackPage]" />
        </Actions>
      </Changed>
      
      <Changed Source="[Next.Invoked]">
        <Actions>
          <Invoke Target="[SetSourceCmd.Concat]"
                  str0="[SetSourceCmd]" str1="[Model.ChosenIndex!cor:String]"
                  ResultTarget="[SetSourceCmd]"
                  ExclusiveApply="false"
                  InvokePolicy="Synchronous" />
          <DebugTrace Message="AVer MCML: 'SetSourceCmd'={0}">
            <Params>
              <ObjectPath ObjectPath="[SetSourceCmd]"/>
            </Params>
          </DebugTrace>
          <Set Target="[DataHost.Source]" Value="[SetSourceCmd]"/>
          <Set Target="[SessionResult]" Value="2"/>
          <Invoke Target="[AddInHost.ApplicationContext.CloseApplication]"/>
          <!-- Value is 2 for cancel. What else should it do?-->
        </Actions>
      </Changed>
      
      <Changed Source="[Cancel.Invoked]">
        <Actions>
          <Set Target="[SessionResult]" Value="2"/>
          <Invoke Target="[AddInHost.ApplicationContext.CloseApplication]"/>
          <!-- Value is 2 for cancel. What else should it do?-->
        </Actions>
      </Changed>

      <Changed Source="[RadioCmd.Invoked]">
        <Actions>
          <Invoke Target="[NextBtn.NavigateInto]"/>
        </Actions>
      </Changed>

      <Rule>
        <Conditions>
          <Equality Source="[Model.ChosenIndex]" ConditionOp="Equals" Value="0"/>
        </Conditions>
        <Actions>
          <DebugTrace Message="AVer MCML: Choose composite"/>
          <Set Target="[DeviceImage.Content]" Value="[ImgComposite]"/>
        </Actions>
      </Rule>
      <Rule>
        <Conditions>
          <Equality Source="[Model.ChosenIndex]" ConditionOp="Equals" Value="1"/>
        </Conditions>
        <Actions>
          <DebugTrace Message="AVer MCML: Choose SVideo"/>
          <Set Target="[DeviceImage.Content]" Value="[ImgSVideo]"/>
        </Actions>
      </Rule>
      <Rule>
        <Conditions>
          <Equality Source="[Model.ChosenIndex]" ConditionOp="Equals" Value="2"/>
        </Conditions>
        <Actions>
          <DebugTrace Message="AVer MCML: Choose Component"/>
          <Set Target="[DeviceImage.Content]" Value="[ImgComponent]"/>
        </Actions>
      </Rule>
      
    </Rules>

    <Content>
      <Panel Name="BGPanel" Layout="Form" Margins="0, 0, 0, 0">
        <LayoutInput>
          <FormLayoutInput Horizontal="Center" Vertical="Center"/>
        </LayoutInput>
        <Children>
          <Panel Name="MainPage" MaximumSize="1024,768" MinimumSize="1024,768" Layout="Form" >
            <Children>
             
              <!-- 主標題 -->
              <Text Name ="Title" Content="global://myresources:str_2_12_1" Color="color://me:TitleColor" Font="font://myresources:TitleFontF">
                <LayoutInput>
                  <FormLayoutInput Left="Parent, 0, 73" Top="Parent, 0, 48"/>
                </LayoutInput>
              </Text>
              <!-- 副標題 -->
              <Text Name ="SubTitle" Content="global://myresources:str_2_13_1" Color="255, 255, 255" Font="font://myresources:SubTitleFontF">
                <LayoutInput>
                  <FormLayoutInput Left="Parent, 0, 73" Top="Parent, 0, 146"/>
                </LayoutInput>
              </Text>
              <!-- 內文 -->
              <Panel Name="MainText" MaximumSize="872,460" MinimumSize="872,460" Layout="Form" >
                <LayoutInput>
                  <FormLayoutInput Left="Parent, 0, 73" Top="Parent, 0, 215"/>
                </LayoutInput>
                <Children>
                  <Text Name="Text1" Content="global://myresources:str_2_13_2" Color="color://me:TitleColor" Font="font://myresources:ContentTextF" MaximumSize="872,0" MinimumSize="872,0" WordWrap="true">
                    <LayoutInput>
                      <FormLayoutInput Left="Parent, 0, 0" Top="Parent, 0, 0"/>
                    </LayoutInput>
                  </Text>

                  <radiogroup:SimpleRadioButtonGroup Model="[Model]" EntrySize="872, 76" RadioSpace="0,0" Command="[RadioCmd]">
                    <LayoutInput>
                      <FormLayoutInput Left="Parent, 0, 0" Top="Text1, 1, 38"/>
                    </LayoutInput>
                  </radiogroup:SimpleRadioButtonGroup>
                  
                </Children>
              </Panel>

              <Graphic Name="DeviceImage" Content="[ImgComposite]">
                <LayoutInput>
                  <FormLayoutInput Left="Parent, 0, 658" Top="Parent, 0, 543"/>
                </LayoutInput>
              </Graphic>
              
              <!--Navigation Buttons-->
              <mybutton:SimpleButton  Command="[Back]"
                                      ImageFocus="image://me:FocusedNaviButton"
                                      ImageNoFocus="image://me:NofocusedNaviButton"
                                      ImageDormant="image://me:NofocusedNaviButton"
                                      ImagePressed="image://me:PressedNaviButton"
                                      Font="font://myresources:SetupButtonTextF"
                                      Size="166,32">
                <LayoutInput>
                  <FormLayoutInput Left="Parent, 0, 412" Top="Parent, 0, 713"/>
                </LayoutInput>
              </mybutton:SimpleButton>
              <mybutton:SimpleButton  Command="[Next]"
                                      Name="NextBtn"
                                      ImageFocus="image://me:FocusedNaviButton"
                                      ImageNoFocus="image://me:NofocusedNaviButton"
                                      ImageDormant="image://me:NofocusedNaviButton"
                                      ImagePressed="image://me:PressedNaviButton"
                                      Font="font://myresources:SetupButtonTextF"
                                      Size="166,32">
                <LayoutInput>
                  <FormLayoutInput Left="Parent, 0, 598" Top="Parent, 0, 713"/>
                </LayoutInput>
              </mybutton:SimpleButton>
              
              <!--An arrow on the background-->
              <Graphic Alpha="0.3" Content="image://me:BG_arrow">
                <LayoutInput>
                  <FormLayoutInput Left="Parent, 0, 644" Top="Parent, 0, 186"/>
                </LayoutInput>
              </Graphic>
            
          </Children>
          </Panel>

          <me:Background Name="Background"/>
          <me:DataHostFromDriver Name="DataHost" ThrowOnLoadError="false" />
          
        </Children>
      </Panel>

    </Content>

  </UI>

  <UI Name="Background">
    <Content>
      <Panel Layout="Anchor">
        <Children>
          <Graphic Content="image://me:Background1" Alpha="1" MaximumSize="0,110" MinimumSize="0,110" >
            <LayoutInput>
              <AnchorLayoutInput Top="Parent,0"/>
            </LayoutInput>
          </Graphic>
          <Graphic Content="image://me:Background2" Alpha="1" MaximumSize="0,110" MinimumSize="0,110" >
            <LayoutInput>
              <AnchorLayoutInput Bottom="Parent,1"/>
            </LayoutInput>
          </Graphic>
          <Graphic Content="image://me:Background" Layout="Fill" Alpha="1"/>

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

  <UI Name="DataHostFromDriver"/>

   
</Mcml>
