I am wanting to learn C# and it seems everyone is switching from using WinForms to using WPF. WPF applications seems so much more complicated to me because of the use of the .XAML files that are used to building the Forms.
I am just asking before I get really involved, is the XAML files the only way to build WPF applications? Is there an easier method? I know I could just learn to use the WinForms which seems a lot easier since you basically have a Form object that you work with code but like I mentioned I think it would be best to build WPF apps
XAML does make things a lot easier if you know how to use it because it is more readable and declarative, but you can do (pretty much) anything in C# code as well if you like.
e.g.
vs.
Though this can be written more concisely and hierarchically:
Generally i would always recommend using XAML, reasons include:
DataTemplatesin code is not supported. The construction usingFrameworkElementFactorieshas been deprecated in favour of using theXamlParser(and i definitely do not recommend juggling XAML strings in code).