Microsoft Tech Community Live: Surface Edition
February 15, 2022, 08:00 AM - 12:00 PM (PST)

Why my view rendering differs between emulator and an actual device?

Frequent Contributor

Hi team,

I hope you are all doing great! I just got my very first feedback of running my little experimental app on a real Surface Duo device.


It's awesome to see it live in action without having any chance to try it by myself.


Nevertheless, I wittnessed that the rendering (one column vs. two columns) is rendered differently in my emulator app and on the real device.


Real device


Emulator screenshot 




I just use the ScreenHelper function:






I use this value in my master view code behind to set the width of the second column.

// Check if app runs on a Duo.
    SecondColumnWidth = new GridLength(1, GridUnitType.Star);
    SecondColumnWidth = new GridLength(0, GridUnitType.Absolute);




Thanks for any helpful tip!

2 Replies

@tscholze can you clarify your question? In the second (emulator) screenshot, the app isn't spanned onto both screens.

Can you put the app in the same state (spanned across two screens) and add the screenshot so we can see how that looks on the emulator? It might also be helpful to explain what you expect the behavior to be, and to confirm via debugging that 


returns the expected value. 

Hi @Craig_Dunn,

sorry for my really late response. I attached a screenshot on how it looks using the emulator.

You see on the left side two columns aka "RSS Feed", and "YouTube Feed".


I present the YT column only if the isDuo() check returns true. It seems that the check returns on an actual Surface Duo device "false". Due to the fact that I have no Duo available, I cannot attach a debugger on a released version.


It could be also a timing issue. It is just weird why it works as intended on the emulator but not on a real device. *hm*


(The "insert photo" button did not work, that's why it is just an attachment)