I've been playing around with Silverlight and I think it has the
potential to be really big, especially if MS keep their promises and
help the Moonlight project, which will bring it fully to Linux. We might
finally get away from the stupid, annoying complexity of web development
as it stands now and be able to have web-deployed applications with
decent interfaces, and cross-platform too.
It has similarities to Flash for sure, but (to me) seems much more
business oriented, with powerful data-binding and so on.
The page markup is done in .xaml files, which are XML. The full release
of Silverlight 2 will have full drag-and-drop support for UI design in
Visual Studio 2008, but even at the minute you can edit the XAML files
manually and watch changes reflected in the designer view straight away.
And the hierarchical nature of the layout XML means it's actually fairly
simple to do this.
The ultimate idea is that developers do the code-behind (in C#, Ruby,
Iron Python, whatever) and the UI, then design people can just open the
UI in Expression Blend and purty it up, because there are few people
with both skill sets.
So here's a canvas with a layout grid of two rows, and two 'labels'
bound to fields Title and Author in a business object.
<UserControl x:Class="BindingTut1.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<TextBlock x:Name="TitleTextblock" Text="{Binding Title}"
Grid.Row="0"/>
<TextBlock x:Name="AuthorTextblock" Text="{Binding Author}"
Grid.Row="1"/>
</Grid>
</UserControl>
And here's how you bind an instance of the Book class to it in the code
behind:
Book b = new Book();
b.Title = "My Big Colouring Book";
b.Author = "Alan Bourke";
TitleTextblock.DataContext = b;
AuthorTextblock.DataContext = b;
--
Alan Bourke
[EMAIL PROTECTED]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.