Click here to Skip to main content
15,888,968 members
Articles / Web Development / IIS

Creating a Domain Service Factory to Host POCO Entities

Rate me:
Please Sign up or sign in to vote.
4.00/5 (2 votes)
10 Dec 2010CPOL4 min read 39.1K   615   11  
This article demonstrates how to write a domain service factory to host plain old class object (POCO) entities and use them through RIA Services in Silverlight version 4.
<StackPanel
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns:local="clr-namespace:BusinessApp.Controls"
    xmlns:web="clr-namespace:BusinessApp.Web"
    x:Class="BusinessApp.LoginUI.RegistrationForm"
    KeyDown="RegistrationForm_KeyDown"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d"
    d:DataContext="{d:DesignInstance Type=web:RegistrationData}">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <local:BusyIndicator x:Name="busyIndicator" BusyContent="{Binding Path=Strings.BusyIndicatorRegisteringUser, Source={StaticResource ApplicationResources}}"
                             IsBusy="{Binding IsRegistering}">
            <toolkit:DataForm x:Name="registerForm" 
                              CurrentItem="{Binding}"
                              IsEnabled="{Binding IsRegistering, Converter={StaticResource NotOperatorValueConverter}}"
                              AutoEdit="True" CommandButtonsVisibility="None" 
                              Header="{Binding Path=Strings.RegistrationFormHeader, Source={StaticResource ApplicationResources}}" 
                              AutoGeneratingField="RegisterForm_AutoGeneratingField"
                              Style="{StaticResource DataFormStyle}" />
        </local:BusyIndicator>

        <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
            <Button x:Name="registerButton" Content="{Binding Path=Strings.OKButton, Source={StaticResource ApplicationResources}}" Click="RegisterButton_Click" Style="{StaticResource RegisterLoginButtonStyle}" IsEnabled="{Binding IsRegistering, Converter={StaticResource NotOperatorValueConverter}}" />
            <Button x:Name="registerCancel" Content="{Binding Path=Strings.CancelButton, Source={StaticResource ApplicationResources}}" Click="CancelButton_Click" Style="{StaticResource RegisterLoginButtonStyle}" />
        </StackPanel>

        <StackPanel Style="{StaticResource RegisterLoginLinkPanelStyle}" Grid.Row="1">
            <TextBlock Text="{Binding Path=Strings.AlreadyRegisteredLabel, Source={StaticResource ApplicationResources}}" Style="{StaticResource CommentStyle}" />
            <HyperlinkButton x:Name="backToLogin" Content="{Binding Path=Strings.BackToLoginButton, Source={StaticResource ApplicationResources}}" Click="BackToLogin_Click" IsEnabled="{Binding IsRegistering, Converter={StaticResource NotOperatorValueConverter}}" />
        </StackPanel>
    </Grid>

</StackPanel>

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
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions