开发者

What features of WPF that are available through XAML are not available through C# (or VB, ...)

Is it possible to use all WPF functionality in C# (VB, ...)? O开发者_高级运维r is there any maybe advanced functionality that is not directly accessible from C#? (Maybe because it might not be accessible by public methods but rather internal.)


Nothing. In fact, the actual parsing and processing (assignment of values to properties, binding to events, ...) of XAML files are eventually done by imperative C# code.

It can, however, be more tedious to set object properties using C#/VB directly; UI designers may know XAML but not C#/VB; and XML is perhaps more toolable than C# source. These factors make XAML a useful technology.


I think some design-time-only features like d:DataContext, d:DesignWidth and d:DesignHeight are only available in XAML, but that's about it. You can do everything else in C#/VB.NET

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜