Applying MVVM to ASP.NET
Posted
by
Moussa
on Stack Overflow
See other posts from Stack Overflow
or by Moussa
Published on 2010-12-27T10:33:43Z
Indexed on
2010/12/27
10:54 UTC
Read the original article
Hit count: 215
Hi everyone,
I am learning MVVM and i want to use it with ASP.NET.
Some of the examples that i found on the internet uses XAML for the view.
Is there a way to use a regular ASP.NET page instead of XAML for the view?
Here is a XAML example:
<UserControl x:Class="MVVMExample.DetailView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid x:Name="LayoutRoot" Background="White"
DataContext="{Binding CurrentContact}">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="Name:" HorizontalAlignment="Right" Margin="5"/>
<TextBlock Text="{Binding FullName}"
HorizontalAlignment="Left" Margin="5" Grid.Column="1"/>
<TextBlock Text="Phone:" HorizontalAlignment="Right"
Margin="5" Grid.Row="1"/>
<TextBlock Text="{Binding PhoneNumber}"
HorizontalAlignment="Left" Margin="5"
Grid.Row="1" Grid.Column="1"/>
</Grid> </UserControl>
Thank you for your time.
© Stack Overflow or respective owner