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

python - No exponential form of the z-axis in matplotlib-3D-plots -

excel vba - VBA Proxy auto-configuration for http requests -

php - phpWord - Tables with borders in headers/footers -