Recently, while
fighting my way through XAML required to create a relatively simple UI for a
Windows Phone 8 application I have come across some unexpected difficulties. When
it comes to hacking markup I prefer to modularize it as much as possible –
many of us do. Here we follow the same ideas that govern us when we write
imperative code and break it into relatively small and simple functions and
classes to assemble them into something bigger on higher levels. The benefits
of this approach are well known: better isolation, finer specification of
responsibilities and less code duplication. With markup we usually behave worse
– the code for pages frequently feels quite monolithic and it is difficult to explicitly
split it into parts each of which pursues its own goals. Here XAML gives us
ControlTemplate and DataTemplate allowing to improve the state of affairs to
some extent. The DataTemplate is primarily used with collection controls so that
we can specify the way each element should be displayed. In my specific case
the parent control was LongListSelector, which should have displayed a list of
more or less complex items.
a collection of lengthy notes on how I am usually coward to do what is wrong and how I am sometimes brave to do what is right. Bits of management and self management, .NET programming, Clojure parenthesis and lots of design mistakes are the things one will find here.
Показаны сообщения с ярлыком event. Показать все сообщения
Показаны сообщения с ярлыком event. Показать все сообщения
среда, 27 ноября 2013 г.
Подписаться на:
Сообщения (Atom)