The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

Scroller/Repeater Image Scaling

Last post 08-21-2008, 5:43 AM by mjp14. 8 replies.
Sort Posts: Previous Next
  •  08-18-2008, 11:16 AM 8129

    Scroller/Repeater Image Scaling

    I have a scroller/repeater that displays images.  Works fine.  On the GainFocus event of my image that comprises the Repeater I scale the size to enlarge it. This also works fine.  My issue is that the focused image goes behind the images adjacent to it.  My desired effect is that the focused image is 'on top' of the other images.  Like the Recorded TV in this image:

    Other than using the ScaleKeyFrame and PositionKeyFrame how do I accomplish this? 

    thanks in advance.

  •  08-18-2008, 4:32 PM 8130 in reply to 8129

    Re: Scroller/Repeater Image Scaling

    You can add a <Rule/> to the focus container UI:

                <Default Target="[Input.MakeTopmostOnFocus]" Value="true"/>

  •  08-19-2008, 5:12 AM 8136 in reply to 8130

    Re: Scroller/Repeater Image Scaling

    nice.  thanks a lot.  I was going a little mad trying to figure out what I was doing wrong.
  •  08-19-2008, 12:05 PM 8140 in reply to 8136

    Re: Scroller/Repeater Image Scaling

    A related question, is there a way to modify the transition animation of a scroller?  Basically, I want to smooth out the somewhat abrupt transition from one Repeated element to the next. 

  •  08-19-2008, 3:19 PM 8143 in reply to 8140

    Re: Scroller/Repeater Image Scaling

    mjp14:

    A related question, is there a way to modify the transition animation of a scroller?  Basically, I want to smooth out the somewhat abrupt transition from one Repeated element to the next. 


    There sure is, however targeting the animation can be a little cryptic.

    Your initial thought would probably be to add a <Animation Type="Move"/> to the <Scroller/> (I know mine was), however this won't work since the <Scroller/> never moves itself - it moves it's children. So you need to add the animation to the children of the <Scroller/>.

    Generally this is pretty straight forward, since most <Scroller/>s out there just have a single <Repeater/> child, so you add the animation to it. In cases where the <Scroller/> has multiple children, each child will need the associated <Animation Type="Move"/>.

    An example:

    <Scroller
        ...
        >
        <Content>
            <Repeater
                ...
                >
                <Animations>
                    <Animation Type="Move">
                        <Keyframes>
                            <PositionKeyframe Time="0.00" RelativeTo="Current" Interpolation="SCurve"/>
                            <PositionKeyframe Time="0.25" RelativeTo="Final" Interpolation="SCurve"/>
                        </Keyframes>
                    </Animation>
                </Animations>
                <Content>
                    ....
                </Content>
            </Repeater>
        </Content>
    </Scroller>

  •  08-20-2008, 5:35 AM 8154 in reply to 8143

    Re: Scroller/Repeater Image Scaling

    thanks again.  it worked perfectly.  seems that you know your mcml... i am on week 2 so there may be more questions. I appreciate your help.
  •  08-20-2008, 8:09 AM 8156 in reply to 8154

    Re: Scroller/Repeater Image Scaling

    Is it possible to create a Changed rule that will fire only when an item is shown for the first time? 

    Something like this....

     

    <Changed Source="[???? (value to test showing)]">

    <Conditions>

    <Equality Source="[???? is showing]" Value="[True]"/>

    ... any number of equality checks

    </Conditions>

    <Actions>

    <PlayAnimation Target="[Background]" Animation="[AnimationEnlarge]"/>

    </Actions>

    </Changed>

     

  •  08-20-2008, 11:11 PM 8168 in reply to 8156

    Re: Scroller/Repeater Image Scaling

    You may want to create a new topic for this one - it's a different question. But anyway...

     

    The question actually has a couple of answers. The first thing to ask is 'why first time only'? Are you trying to just play an animation? Making a splash-screen? Running a function?

    Also, are you just doing this when a new MCML page is shown, or when a particular ITEM on the page is shown?

     

    If it's just part of the whole page appearing, you could always make a Timer with a very small interval setting. When the timer goes off, you do whatever you needed to do.

    If you are simply playing an animation when your page or object loads, you simply create an animation with a 'Type' of 'Show' and it will play when the page is loaded).

    If you wanted the timer even to run for the first time only and not subsequent re-loads of the page (eg. when you press the 'back' button), you would need to store some kind of property on your main class (the class that is shared between MCML pages) that you have been to this page before. If it was added to your conditions, and you put a <set> command in the rule, you would be able to make it happen the first time only.

     

    It it's an item on the screen, but not a whole page that is made visible, you may just be able to use the actual "<object>.Visible" property to decide when to perform your actions. Again, if you wanted to make sure this was the 'first time', you'd need to create a <local> that can store if it is the first time the visible property has changed.

    So if you explain a little more about exactly what you are doing, we may be able to give you accurate advice.


    100 downloads a day for Yougle Vista - goin' allright!

    Check out http://www.thedigitallifestyle.com/cs/Blogs/developer/default.aspx and http://www.push-a-button.com.au/products/mce
  •  08-21-2008, 5:43 AM 8178 in reply to 8168

    Re: Scroller/Repeater Image Scaling

    basically what im trying to do (related to another response of yours in a different thread) is animate repeated items in a scroller differently depending on the proximity to the focused item.  I would like to use the Type=Show animation but there are conditions that need to be checked ie. the index relative the focused index.  Because of these conditions I dont the Type=Show animation will work; however the timer animation will i think.  Didnt think of that... thanks for the suggestion.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems