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
Post a Comment