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 -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -