Vectorlight News

  • Chat App Converted to HTML and JQuery
    Sep 08, 2011

    Converted from Silverlight to HTML and Javascript/JQuery is the Vectorlight Chat App. Login using your Vectorlight password to chat using your username and avatar.

  • HTML5 iPhone,Android Big Guns Tower Defense
    Jul 02, 2011

    Big Guns has made the leap from Windows Phone 7 (XNA) to HTML5 so you can now play it on your iPhone, Android and other HTML5 compatible devices.

  • HTML5 Games - Word Poppers and Batty
    Jun 04, 2011

    As the take-up of HTML5 quickens (74% of users currently have a browser capable of HTML5 Canvas) we present two more games for both your browser and mobile.

  • Big Guns Tower Defense on Windows Phone 7
    May 06, 2011

    Coming soon to Windows Phone 7 is an XNA port of the popular Vectorlight tower defense game Super Tower Defense. Whilst retaining many of the graphical and gameplay features of the original Silverlight game.

  • Wakacube WP7 Update
    Apr 26, 2011

    Released to the Windows Phone 7 marketplace today is Version 1.1 of Wakacube the 3D physics game of skill. Included in the update are more levels (30 in total) and new mode Wakatime which generates random crate structures to keep players entertained long after the levels have been completed.

  • Home Page News
kenlarsson
kenlarsson
ScrollIntoPosition() doesn't work Posted: Sep 17, 2009
 

Hi!


First of all thanks for a great set of controls.


I was trying out the TreeView control but couldn't get the ScrollIntoPosition() function to work. I tried a workaround with treeView.SetSelected(treeView.Selected, true), where true is supposed to scroll into position, but this didn't work either.


The control works gret but when I move a node up and down I would really like the scroll to follow the selected node. If I display a node at the bottom and use a button to move it down the scroll needs to follow the node.


Is this function implemented yet? Am I perhaps using it incorrectly?

 
 
dan
dan
RE: ScrollIntoPosition() doesn't work Posted: Sep 17, 2009
 

Hi,


This is a strange one.  I did I test of the ScrollIntoPosition() method and it works as expected.  How are you moving the nodes up and down?  Could you post your code or maybe email your project I I'll take a closer look?


Thanks!

 
 
kenlarsson
kenlarsson
RE: ScrollIntoPosition() doesn't work Posted: Sep 17, 2009
 

I was trying to achive something like your demo of the TreeView with a separate Up and Down button that moves the selected node. Here is the code for move down:


private void MoveDownButton_Click(object sender, RoutedEventArgs e)

{

if(uxTreeView.Selected != null)

{

Node node = uxTreeView.Selected;

node.SwapNext();

uxTreeView.ScrollIntoPosition();

}

}


Say I selected a node right at the bottom part of the viewable area of my treeview and want to move this down one step (provided there are more nodes below). The node is then still selected but I can't see it. My assumption of ScrollIntoPosition() was that this would automatically scroll me down so that my selected node always is visible.

 
 
dan
dan
RE: ScrollIntoPosition() doesn't work Posted: Sep 18, 2009
 

Hi,


Having tested it in your scenario there is a delay in Silverlight calculating a nodes new position when using the SwapNext/SwapPrevious methods which results in the ScrollIntoPosition() method failing.


The solution is to force Silverlight to recalculate the position by calling node.UpdateLayout() after the call to SwapNext() like this:


Node node = uxTreeView.Selected;

node.SwapNext();

node.UpdateLayout();

uxTreeView.ScrollIntoPosition();


Hope this helps!

 
 
kenlarsson
kenlarsson
RE: ScrollIntoPosition() doesn't work Posted: Sep 20, 2009
 

That worked for me. Thanks!

 
 
kmadhubabu
kmadhubabu
RE: ScrollIntoPosition() doesn't work Posted: Aug 13, 2010
 

Hi Dan,


I tried this but not working may be i worte in wrong event.


My requirement is when i expand last node which has more child nodes, need to auto scroll up and should be in visible area.

can you please help on this....

 
 
dan
dan
RE: ScrollIntoPosition() doesn't work Posted: Aug 14, 2010
 

Hi,


The problem here is that when the node expand method is called the size of the child node collection is unknown until the layout of thie children has completed.  Have you tried to update the scroll position using the NodeExpanded event?


Thanks!