How to view your run time effect of xaml in WPF without starting the program

How to view your run time effect of xaml in WPF without starting the program

ilovejingle
Enthusiast Enthusiast
1,167 Views
1 Reply
Message 1 of 2

How to view your run time effect of xaml in WPF without starting the program

ilovejingle
Enthusiast
Enthusiast

I realize the WPF designer sometimes not showing the WPF window as the same dimension as run time. 

So far, I need to start the program to see the actual effect in AutoCAD and go back to Visual Studio for further tuning. is there anyway I can start the xaml window in Visual Studio so that I dont need to run the program and open AutoCAD to see the window effect in real time?

Thanks and really appreciated.

 

0 Likes
Accepted solutions (1)
1,168 Views
1 Reply
Reply (1)
Message 2 of 2

Norman_Yuan
Mentor
Mentor
Accepted solution

WPF's XAML can be "live" updated during debug (be the debugged process an AutoCAD instance or stand-alone EXE). That is, when your WPF form is showing in AutoCAD, and you want to make some change to the xmal code, you can go ahead to make the change and switch back to AutoCAD, close the form and re-show it again without having to quit and re-run AutoCAD, unless the change is too significant.

 

The decisive factor is to use MVVM pattern when working with WPF UI, so that the Xmal is purely a UI presentation to take advantage of "hot fix" debugging feature. When developing a rather complicated WPF UI for AutoCAD, I often also ccreate a simple EXE app for testing/debugging with ViewModel filled by mocking data (similar to doing unit test), so that start EXE to testing/modifying xmal is a lot faster than running AutoCAD instance.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes