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

Annoying poor scrolling performance on my mac mini fixed

Last post 01-02-2008, 3:49 PM by Charlie. 4 replies.
Sort Posts: Previous Next
  •  12-25-2007, 10:28 PM 6011

    Annoying poor scrolling performance on my mac mini fixed

    Read the following hack and cry...


    in your mcml

          <Changed Source="[Application]" InitialEvaluate="true">
            <Actions>
              <Invoke Target="[Application.FixRepeatRate]" scroller="[Scroller]" val ="70" />
            </Actions>
          </Changed>

    in your application

      public void FixRepeatRate(object scroller, uint val)
            {

                PropertyInfo pi = scroller.GetType().GetProperty("View", BindingFlags.Public | BindingFlags.Instance);
                object view = pi.GetValue(scroller, null);
                pi = view.GetType().GetProperty("Control", BindingFlags.Public | BindingFlags.Instance);
                object control = pi.GetValue(view, null);

                pi = control.GetType().GetProperty("KeyRepeatThreshold", BindingFlags.NonPublic | BindingFlags.Instance);
                pi.SetValue(control, val, null);

            }
     

    That's it, I'm going to need a break from MCML development for a few weeks now... too painful

    - Sam
    samsaffron.com
  •  12-30-2007, 8:20 PM 6038 in reply to 6011

    Re: Annoying poor scrolling performance on my mac mini fixed

    Works perfectly even with 1000's of items in the scroller

    Thanks sambo!!!

  •  01-02-2008, 2:07 PM 6047 in reply to 6011

    Re: Annoying poor scrolling performance on my mac mini fixed

    Just a quick note that reflecting into internal properties in this manner isn't supported. There are several reasons:

    1) There are good reasons why we may choose to not make something part of the public platform.

    2) Because of #1 this workaround might not work in future versions, and we don't make any sort of application compatibility guarantees on things which aren't part of the public platform.

    3) This *may* come with some unintended consequences and ramifications -- you should exercise extreme caution when using this approach.


    Charlie Owen (Microsoft)
  •  01-02-2008, 2:19 PM 6048 in reply to 6047

    Re: Annoying poor scrolling performance on my mac mini fixed

     Hi Charlie,

    I completely understand, but have no idea how to fix this bug without reflecting

    Cheers
    Sam

    - Sam
    samsaffron.com
  •  01-02-2008, 3:49 PM 6051 in reply to 6048

    Re: Annoying poor scrolling performance on my mac mini fixed

    I agree you are stuck between a rock and a hard place -- just wanted to make sure the community understands the hazards of this workaround.
    Charlie Owen (Microsoft)
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems