Hi,
I’m using ResponsiveProfileChanged event in Wisej 2.0.47.0
there is same problems…
boolean e.CurrentProfile.Landscape return often null value and do not alway respond to rotation
regards
Cristian
The CurrentProfile object refers to the current profile that matched the device out of the ClientProfiles.json – it’s to the description of the device. To read the properties of the device use Application.Browser.
If the matched profile doesn’t specify the landscape property it’s left undefined (null, it’s a int?). When set to true (or false) it adds a matching condition to the profile meaning that that the height > width or viceversa, otherwise it’s ignored.
Client profiles are matched from to bottom and the first that matches is used (it’s not a best match selection). You can define a custom set of rules, add a new ClientProfiles.json to your app (Add -> New Items -> templates) to override the built-in one:
{ "profiles": [ { "name": "Phone", "maxWidth": 450 }, { "name": "Phone (Landscape)", "landscape": true, "maxWidth": 600 }, { "name": "Tablet", "maxWidth": 800 }, { "name": "Tablet (Landscape)", "landscape": true, "maxWidth": 1024 } ] }
HTH
Hi Luca,
I think there is a little bug
if I have the smarthone (Samsung Note 9) potrait,
1) I open the page, then e.CurrentProfile.MaxWidth is right
2) I rotate to landscape and the e.CurrentProfile.MaxWidth return 0
3) if I refresh the page return the right width
this problem in the pc browser do not happen, only on Firefox android browser (I have not test IPhone)
Android Chrome do no have this problem