Help! Update UI

proflo

New member
Feb 24, 2014
18
0
0
Visit site
Hi,

is there anyway to update the UI more often than normal?
I want to get the position from different Rectangles in a Canvas.
But the values i get can't be right.

Best Regards Proflo
 

peterdroid

New member
Jan 27, 2014
16
0
0
Visit site
can u show some code ? what u already do ?
Canvas have always updated if u set it in code.
For specific update ui need use thread.
 

proflo

New member
Feb 24, 2014
18
0
0
Visit site
can u show some code ? what u already do ?
Canvas have always updated if u set it in code.
For specific update ui need use thread.

Here is my code which doesn't do what i want:

List<Rectangle> rects = new List<Rectangle>();

private void ThisManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
{
moveTiles(0, e.DeltaManipulation.Translation.Y);
}

private void moveTiles(double x, double y)
{
double newTop, newLeft;
foreach (Rectangle t in rects)
{
newTop = Canvas.GetTop(t) + y;
newLeft = Canvas.GetLeft(t) + x;
if (newTop < 0)
{
newTop = 500;
}
Canvas.SetTop(t, newTop);
Canvas.SetLeft(t, newLeft);
}
}
 
Last edited:

Members online

Forum statistics

Threads
323,315
Messages
2,243,623
Members
428,056
Latest member
Carnes