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

Pivot - dynamic data for Options and content

Last post 08-11-2010, 11:25 PM by AndyC. 22 replies.
Page 1 of 2 (23 items)   1 2 Next >
Sort Posts: Previous Next
  •  07-19-2010, 11:26 AM 9720

    Pivot - dynamic data for Options and content

    Hello,

    I'm trying to make a pivot menu and I'm kind of stuck. I learned from McmlSamples, there is a nice PivotExample but it uses static data. I need to have both (choice data and of course the content of a page that should change accordingly to user's choice) defined dynamically, from code. And I simply don't how to do that :) Can you help me, please?
  •  07-19-2010, 11:09 PM 9721 in reply to 9720

    Re: Pivot - dynamic data for Options and content

    As long as your data is in an ArrayListDataSet, changes to the data are reflected automatically in the repeater on screen, so you can sort the dataset, remove items, add items, etc. and the on-screen representation will update to reflect the changes without you doing anything.

    Just make sure to bind your data source to your repeater to enable this to happen.

    Cheers,
    Andrew
  •  07-20-2010, 1:24 AM 9722 in reply to 9721

    Re: Pivot - dynamic data for Options and content

    Do you have by any chance an example? ;)
  •  07-20-2010, 5:52 AM 9723 in reply to 9722

    Re: Pivot - dynamic data for Options and content

    The "ListDataSet and ArrayListDataSet" example in the SDK shows how this dynamic updating works.

    Cheers,
    Andrew
  •  07-26-2010, 1:12 AM 9730 in reply to 9723

    Re: Pivot - dynamic data for Options and content

    Thanks for your advice, I sort of made it working. I have some new questions :)
    1) The Pivot menu always appears with first item selected. I need it, especially when going back from next page, to appear like it was before. I even tried to force it to start with ChosenIndex=5, it blinks for a split second to this index and then it moves back to first index (0). I use almost unchanged the pivot menu from McmlSamples if you ask for code. (but it's not problem to post here all my code).
    2) When a video is played in fullscreen mode and I stop it and press back, it stays in Now playing "state" so if I back out of my application, the thumbnail of that stopped video appears in Now playing area. Is there a way how to make it not doing this?
    3) I use in my C# code HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url); and
    HttpWebResponse responce = (HttpWebResponce) request.GetResponse();. On one machine (where the SDK is installed) it takes about 20sec. before the GetResponse actually return something for the first time. Any other consecutive webrequest is instant until I end the application. However on the other machine (HTPC, same system, windows updates off, no SDK) it's instant right from the beginning. Any idea why is that?

    I'm sorry for such long question(s) but you seem like a really pro so I hope you don't mind. Thanks!

    Regards,
    Shrap
  •  07-26-2010, 1:40 AM 9731 in reply to 9730

    Re: Pivot - dynamic data for Options and content

    1) Try setting the DefaultIndex value to the same as ChosenIndex and see what happens. Not saying it will work, but it's worth a try - pivots are one of the areas that is really painful for third party development.

    2) There's no way to remove the video from the Now Playing window. The best workaround I've found is to play something else, such as a 0 second long blank video file.

    3) Are you saying a WebRequest within your add-in takes 20 seconds but in Windows Forms app it is instant, or that the same add-in running on two machines have this difference?

    Cheers,
    Andrew
  •  07-26-2010, 4:43 AM 9732 in reply to 9731

    Re: Pivot - dynamic data for Options and content

    3) I am saying that the same add-in (or windows console application, it doesn't matter) has this difference on two machines. I can test it on third machine, it's fresh instalation of win7 (same as both machines) with only WMC SDK, Visual studio 2008 and ... that's it. I'm thinking of some DNS settings or so, but it should be the same on these 2 machines. If you think of anything, please, let me know. I will test it meanwhile.

    regards
    shrap
  •  07-27-2010, 1:59 AM 9733 in reply to 9732

    Re: Pivot - dynamic data for Options and content

    So, I tried it on my laptop and it's quite fast (like 500ms). If you want, you can try what your result will be here: http://shrap.net/wmc/Pocasi.exe (it parses some weblinks from this site http://www.ceskatelevize.cz/ivysilani/a/ - Czech TV). Any idea is appreciated :)

    regards,
    Shrap
  •  07-27-2010, 9:20 AM 9735 in reply to 9733

    Re: Pivot - dynamic data for Options and content

    I've just run it on a machine with Win7 + SDK on and it runs in about 1 second.

    Cheers,
    Andrew
  •  07-28-2010, 12:45 AM 9738 in reply to 9735

    Re: Pivot - dynamic data for Options and content

    Thanks for your testing. So I need to check my network settings, I won't bother you with that anymore :)
    Anyway, I played with the Pivot. It's really really hard to understand how everything works there. But I found out where is the  problem. I have this pivot where in the upper row there are letters A-Z and in the bottom (content) area there is the list of programmes starting with this letter (same list you could see in the example I posted). The list is centered horizontaly, so if I move up from the list, it tries to focus the letter in the middle of pivot row. This works fine while the pivot row is locked at its defined position. So the focused letter is right above the list. But when I go forward onto next page and then back, the pivot row is always displayed with the A letter at the left edge of screen, so if the last selected letter was e.g. F, this F is too on the left from the bottom list so moving up from list to pivot row selects the M letter. So for a few letters (like G-P) it works correctly, but for the letters on both edges it always selects M. Any idea how to force the pivot row (the Scroller actually) to be displayed correctly also when going back from next page?

    Regards,
    Shrap

    Edit: The locking is done after the scroller gets focus, but I need it to lock right after the page is shown. If it's possible.
  •  07-28-2010, 9:03 AM 9739 in reply to 9738

    Re: Pivot - dynamic data for Options and content

    This is one of those areas that is tricky with MCML development...

    Check that you have a ScrollingData element bound to your scroller, and that it's in rather than in

    Cheers,
    Andrew
  •  07-31-2010, 1:26 PM 9745 in reply to 9739

    Re: Pivot - dynamic data for Options and content

    Hello,
    up-to-date information ;)
    1) I gave up the thing with pivot, I set the Navigation on repeater to "PreferFocusOrder" and it's sort of usable (Always focus letter A)
    2) I solve the delay in HTTP request, it was my OpenVPN and its TAP virtual adapter. I removed it and its fast as on other machines. Now I need to figure out what to change in settings ...
    3) Finally a question :) I have a panel with minimumSize defined. Inside this panel there is a text. Is there an other way how to make the text centered within the panel other than to set it a minimumSize too? I've played with it whole day and haven't find other way (and this causes other problems when scaling ...)

    Regards,
    Shrap
  •  07-31-2010, 11:36 PM 9746 in reply to 9745

    Re: Pivot - dynamic data for Options and content

    On 3) try setting the layout of the panel to Center.

    Cheers,
    Andrew
  •  08-01-2010, 12:46 AM 9747 in reply to 9746

    Re: Pivot - dynamic data for Options and content

    Tried. Not working. Maybe I have something other wrong ... I have to admit I'm confused with the Layout and InputLayout tags and I'm not completely sure I know what exactly they do :) I mean, I can use tham and mostly get the layout I want but I don't really master them ;)
  •  08-01-2010, 10:58 PM 9748 in reply to 9747

    Re: Pivot - dynamic data for Options and content

    Don't worry - I've been doing this since before Vista launched and layouts area the one area that still kills me every time.

    If you can post the panel MCML you are using I'll have a look and see what is going wrong.

    Cheers,
    Andrew
Page 1 of 2 (23 items)   1 2 Next >
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems