c# - Refresh control on orientation change? -


i have custom panel control, built in mainpage.xaml.cs, , want redraw when orientation changes (because needs measure width of display how need it). haven't found way how anywhere online :/

declare in class

private simpleorientationsensor _orientationsensor; 

then use

_orientationsensor = simpleorientationsensor.getdefault();         if (_orientationsensor != null)         {             _orientationsensor.orientationchanged += delegate              {                  // whatever need here             };         } 

_orientationsensor must member of class, otherwise collected gc , event wont fire


Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -