Is there a way to use WPF without XAML

You can write WPF apps w/o XAML. Everything you can achieve in xaml, you can achieve in C# code is really true but not the opposite.  But xaml is very handy to define styles and templates, or initialize tons of objects. It is much easier to read than c# code. And it is easy to maintain.

XAML is also mustly used in WPF UI bacause it makes it possible to have a dedicated designer (not programmer) to design the UI.

How to get this code going:

  • Create a Windows Presentation Foundation project named HelloWorldManual
  • Remove the App.xaml and Window1.xaml from the project
  • Add a new class file named MyWindow.cs and paste this into it:

Continue reading

By Sriramjithendra Posted in WPF, WPF