0

How is the image of the Page's XAML gets generated? Is it running a virtual machine and it's grabbing a snapshot? Does it send the XAML? Any details of that would be welcome.

Don Box
  • 3,166
  • 3
  • 26
  • 55

1 Answers1

0

How is the image of the Page's XAML gets generated?

Visual studio renders the XAML using platform's reference DLLs + compiled binaries of your app.

Is it running a virtual machine and it's grabbing a snapshot?

Nope, it all works in the same visual studio process.

Soonts
  • 20,079
  • 9
  • 57
  • 130
  • Thanks, but my app binaries are for a different platform. How is it able to run them? Also, are you sure it's not a screenshot which is generated? Because the rendered content does not contain native Win32 controls (Spy++ doesn't find them) nor WPF ones (Snoop doesn't find any) – Don Box May 21 '15 at 06:33
  • "my app binaries are for a different platform" - .NET byte code is platform agnostic. "are you sure it's not a screenshot which is generated?" - 99% sure. Windows phone GUI is neither Win32 nor WPF, it's Silverlight or on WP81 could be XAML/WinRT. – Soonts May 21 '15 at 07:35
  • Take a look at Microsoft.Expression.DesignSurface.dll and Microsoft.Expression.WindowsPhonePlatform.dll assemblies in Reflector, you'll see yourself. – Soonts May 21 '15 at 07:39
  • thanks again. OK, so I understand they are using the project platform to parse the XAML but I still don't understand how is it generating the actual designer preview in the Visual Studio (a desktop app). What are those controls in the preview? Of what type? They don't seem WPF nor Win32. – Don Box May 22 '15 at 08:36
  • I think they're of the same type they're on the phone. Either Silverlight or WinRT/XAML. Both frameworks are here on the PC, neither is WPF or Win32. But this is just a guess, I'm not sure. – Soonts May 22 '15 at 15:10
  • The controls must be from some desktop technology, Win32, WPF or Silverlight. Unless they have a bridge which renders the WinPhone to desktop. – Don Box May 27 '15 at 08:51
  • Silverlight and WinRT/XAML technologies are here on both phones and desktops (starting from Win8). No bridge is required for them. – Soonts May 27 '15 at 09:06
  • Not really. The XAML from Windows Phone is not the same with the one from desktop. Different set of controls. I marked your comment as answer but I still don't know how they do it. – Don Box May 27 '15 at 14:52