0

I have come across with something on one of my colleague's code who is recently coding for a Win 8 Metro Style App(C# XAML) as me. The point that made me curious is that he did not use any XAML code(other than the declaration statements in .xaml file) while he wrote the application and it seems the app works. So can anyone tell me that why/where should I use XAML or why/where should I not?

Thanks in advance

4

1 回答 1

0

这是一个偏好问题。有些人喜欢做最少的 XAML 并用 C#(代码隐藏)创建所有东西,有些人喜欢相反。我个人更喜欢在 XAML 中做尽可能多的工作。它是声明性的,您可以在其中表达相当复杂的结构,同时它仍然非常具有表达性和可读性。我认为您可以比等效的 C# 构造更容易理解 XAML 构造。

于 2012-10-31T10:10:02.073 回答