Wednesday, 15 February 2012

c# - Setting The Window Position -


some background

I am writing an application that transfers a lot of windows to the screen The real time constraint that I demand I normally set window terms by using the following formats:

  this.Left = position.x; this. Top = position. Y;   

question

I would like to know that this is the fastest or most effective way to do this. Is there an event closed to refresh the left parties, or does he wait for an overdue event?

Second, why there is no function to completely set the position? Or is it also necessary? I know that in the Windows API, there is SetWindowPos , but I prefer to stay away from unmanaged code. Can this function be used fast?

I'm not sure that this is the most efficient but it may have several calls to perform bar performance issues. The reason for this is because the left and top dependency properties are set to the PropertyChangedCallback example OnPositioningChanged method. From this call call link:

There are frequent calls for invalidation, or significant display results for particular update layouts.

I know this is a clear answer, but the best way to benchmark both methods and see what works for you. Even if you go on an unmanaged route or stick to your current method, I think that the same rendering call must be done at some point (happy to be corrected on it).

No comments:

Post a Comment