In a recent post I have covered several approaches to store data in a Windows
Phone application. Another important problem is presenting data in an easy and controllable way that would not interfere with other
layers of your app. To some extent XAML handles this task well, but from time
to time just markup is not enough and one needs to introduce a portion of
imperative code to present data nicely. To make this possible each binding in
a XAML-based app may specify a converter, which will be responsible for
transforming data between internal and external representations.
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.
Показаны сообщения с ярлыком xaml. Показать все сообщения
Показаны сообщения с ярлыком xaml. Показать все сообщения
пятница, 11 апреля 2014 г.
Use Converters in your Windows Phone Apps
Labels:
applications,
binding,
code,
converters,
data,
data presentation,
examples,
ivalueconverter,
mvvm,
programming,
separation of concerns,
srp,
windows phone,
wp,
wp8,
wpdev,
xaml
среда, 27 ноября 2013 г.
XAML: Event Handlers for Templated Items of Collection Controls
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.
Labels:
c#,
code,
collectioncontrol,
controltemplate,
datatemplate,
event,
event handler,
longlistselector,
programming,
software development,
windows phone,
wp,
wp8,
wpf,
xaml
Подписаться на:
Сообщения (Atom)