XAML or C# code-behind

后端 未结 20 1903
盖世英雄少女心
盖世英雄少女心 2020-12-13 02:03

I don\'t like to use XAML. I prefer to code everything in C#, but I think that I am doing things wrong.

In which cases it is better to use XAML and when do you use C

20条回答
  •  时光取名叫无心
    2020-12-13 02:39

    The most important thing to bear in mind is that XAML is for presentation. All your presentation should be in the XAML. If you have logic, you keep that out of your XAML - in your C#.

    Imagine swapping out your XAML file with one that LOOKS completely different - but still uses the same data - that's where the division should be.

提交回复
热议问题