Click here to Skip to main content
15,885,757 members
Articles / Desktop Programming / WPF

An Address Book Application Made in MVVM For Metro Style App in Windows 8 Part 2

Rate me:
Please Sign up or sign in to vote.
4.40/5 (5 votes)
29 May 2012CPOL6 min read 41K   1.3K   14  
This is the Second Part XML file as data source in Windows8
<Page
    x:Class="Mvvm3_Basic.BlankPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Mvvm3_Basic"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="25*"/>
            <RowDefinition Height="231*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="205*"/>
            <ColumnDefinition Width="478*"/>
        </Grid.ColumnDefinitions>

        <ListBox x:Name="ListPerson" Grid.Row="1" Grid.Column="0" ItemsSource="{Binding Contacts}" 
                 SelectedItem="{Binding SelectedContact, Mode=TwoWay}" DisplayMemberPath="Name" FontSize="24" >
        </ListBox>

        <Grid x:Name="ContactLst" DataContext="{Binding SelectedContact}" Grid.Row="1" Grid.Column="1">
            <StackPanel Orientation="Vertical">
                <StackPanel>
                    <TextBlock Text="Name: " FontSize="24"/>
                    <TextBox Text="{Binding Name, Mode=TwoWay}" FontSize="24" Padding="10" Margin="10"/>
                </StackPanel>
                <StackPanel>
                    <TextBlock Text="Email: " FontSize="24"/>
                    <TextBox Text="{Binding Email, Mode=TwoWay}" FontSize="24" Padding="10" Margin="10"/>
                </StackPanel>
            </StackPanel>
        </Grid>

        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Center">
            <Button Content="Refresh" Command="{Binding GetCommand}" FontSize="24"/>
            <Button Content="Add New" Command="{Binding AddCommand}" FontSize="24"/>
            <Button Content="Save" Command="{Binding SaveCommand}" FontSize="24"/>
            <Button Content="Update" Command="{Binding UpdateCommand}" FontSize="24"/>
            <Button Content="Delete" Command="{Binding DeleteCommand}" FontSize="24"/>
        </StackPanel>

    </Grid>
</Page>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO Addya Technologies
India India
"I am the CEO"
An Entrepreneur, Driving an Business Transformation Unit.

Comments and Discussions