Inspecting XAML properties using Live Property Explorer
In the previous recipe, we learnt about Live Visual Tree, which is used to get a real-time view of your running XAML code by inspecting the visual elements. Visual Studio 2015 and above also provide a Live Property Explorer window, which allows you to temporarily modify the XAML properties at runtime to see the visual effect.
In this recipe, we will learn about Live Property Explorer. We will use Visual Studio 2017 to demonstrate it.
Getting ready
Let's begin with a demo project creation. Open your Visual Studio 2017 instance and create a new project named CH10.LivePropertyExplorerDemo
. Make sure to select the WPF application template during project creation.
How to do it...
Follow these steps to design our application UI with a simple button and then utilize Live Property Explorer to view and modify the XAML properties at runtime:
- From
Solution Explorer
, open theMainWindow.xaml
file. - Replace the content of the XAML with the following code...