Jump to: navigation, search

Changes


XAML Debugging

1,763 bytes added, 09:18, 17 August 2017
Created page with "XAML debugging can be quite challenging, especially when it comes to layouting of nested dynamic controls in combination with data binding. Fortunately Microsoft provides a se..."
XAML debugging can be quite challenging, especially when it comes to layouting of nested dynamic controls in combination with data binding. Fortunately Microsoft provides a set of tools that can be used in combination with {{UBIK}}.


== Prerequisites ==
* Installed {{UBIK}} WinX or {{UBIK}} UWP App
* Microsoft Visual Studio 2015 or higher

== Introduction ==
Microsoft introduced some [https://blogs.msdn.microsoft.com/visualstudio/2015/02/24/introducing-the-ui-debugging-tools-for-xaml/ new UI debugging tools with Visual Studio 2015] that allow live exploring of rendered XAML content and even modifying values at runtime. The good thing about this technology is that it is actually independent of the Apps source code, so it can be used in conjunction with any XAML-based App that is installed on the machine. The tools provided are
* In-App Selection
* Live Visual Tree
* Live Property Explorer

== Setting it up ==
Since XAML content is rendered at runtime, there's no need to have the original code available in order to use those tools. Just follow the guidelines below for set up:

# Open Visual Studio 2015 and create a new, blank project
## For debugging UBIK WinX (Versions < 3) create a blank Windows 8.1 App project
## For debugging UBIK UWP (Version 3 and above) create a blank Windows Universal project
# Go to the menu Debug -> Attach to process...
# Scroll the list and find the process named ''UBIK.UWP.exe'' or ''UBIK.WinX.exe''
# Double-click the process or select it and click ''Attach''

Visual Studio now launches your blank App and attaches the debugger to the {{UBIK App}}. As a side effect, it will enable the UI debugging tools in the running {{UBIK}} App and you can instantly use them to debug the UBIK UI and your XAML templates.