![]() In fact, looking at Listing 1, you will notice that almost half the required code (13 lines in this example) went towards row and column definitions. What is not so convenient is that the syntax for the definition of Grid rows and columns tends to be rather verbose. It is very convenient to arrange UIs using Grid elements. “Many CODE Framework features can be used individually and in combination with completely different frameworks.”įirst, let’s talk about the definition of the Grid. There are quite a few things that bug me about this setup, however, ranging from little annoyances to the fact that with the proper techniques, this same UI can probably be defined in just a handful of lines of code. Figure 1: A simple hand-coded login UI in WPF.įor those of you familiar with any of the XAML dialects, this type of UI definition is probably well-known to you. Something like the XAML shown in Listing 1 perhaps, which creates the UI shown in Figure 1. Perhaps for that purpose, you arranged your user control into logical rows and columns using a Grid layout element. Let’s say you have a very simple UI, such as one based on a user control, perhaps one that creates a login UI with the option to enter a user name and password. ![]() Let’s start out with a few very simple examples (and for those of you who are looking for the mind-blowing features… bear with me… we are getting there!). (NOTE: You can also create entire custom themes, which is not nearly as hard as it sounds, but that shall perhaps be the topic of a future article.) “Most WPF/XAML MVVM Frameworks provide great structure for the mechanics of the UI but not for the things you actually see. Or you can mix and match any and all of those approaches. Or, you can simply use some of the convenient little features that might make general WPF development more straightforward and ease into the subject that way. Or, you can go all out and use the CODE Framework “View” UI element and go cold turkey without even a code-behind file (which has great advantages as I will discuss as this article goes on). Just like in any other framework, you can create your view as a user control (or similar UI element) in a XAML file with a C# or VB code-behind file. ![]() When you create CODE Framework WPF applications, you can use as little or as much as the UI-specific features as you like. You can simply bring these components into other setups as needed. In fact, many of these features can be used even if your overall development framework is something else. Not so in CODE Framework! Developers and designers alike can use many of the great (yet optional) features of the framework to quickly create great looking and completely stylable UIs. ![]() “And here is where you create a user control that acts as the view…” is how the story usually goes and the developer is completely on her own in doing so. Most MVVM frameworks create great structure in setting up the overall infrastructure, but provide little in the way of actual UI development. In this article, I will dive deeper into the subject and discuss the unique benefits of the CODE Framework WPF components which enable developers to create the part of the UI that is actually visible in a highly productive and reusable manner. In a prior installment of this series of articles about CODE Framework (“CODE Framework: Writing MVVM/MVC WPF Applications”, Jan/Feb 2012), I discussed how to use the WPF features of CODE Framework to create rich client applications in a highly productive and structured fashion reminiscent of creating ASP.NET MVC applications, although with WPF MVVM concepts applied.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |