SIGN UP MEMBER LOGIN:    
ARTICLE

Business App using WCF RIA Services: Part 2

Posted by Mahadesh Mahalingappa Articles | Silverlight with C# August 27, 2011
In this article we would be using all the concept we discussed in the 4 parts of the series Silverlight 5 WCF RIA Service and build a complete Business Application .
Reader Level:
Download Files:
 

Part 1

We will continue to design our Business application . Lets continue with the Payroll view .

Creating remaining Views and adding Transition effects .

Lets add another user control in the Views folder as Payroll.

I follow the same steps as I did for the Author.xaml .

The Final xaml code for Payroll.xaml would look like :

<Grid x:Name="LayoutRoot" Background="White">
        <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:Payroll, CreateList=true}" Height="0" LoadedData="payrollDomainDataSource_LoadedData" Name="payrollDomainDataSource" QueryName="GetPayrollsQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my:DataDomainContext />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        <sdk:DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=payrollDomainDataSource, Path=Data}" Margin="0,50,0,0" Name="payrollDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="400" >
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn Binding="{Binding Path=AuthorID}"></sdk:DataGridTextColumn>
                <sdk:DataGridTextColumn Binding="{Binding Path=PayrollID}"></sdk:DataGridTextColumn>
                <sdk:DataGridTextColumn Binding="{Binding Path=Salary}"></sdk:DataGridTextColumn>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
    </Grid>

Comment the Author View placed in the Mainpage.xaml.cs and drag and drop payroll view now.

Build and Run.

WCFRia1.gif

Lets also add the Article View .

I would be using Slide In Transition effects in our example to add the effects . For reference http://www.c-sharpcorner.com/UploadFile/Mahadesh/8886/

Add references to the Blend Dlls as shown in the Diagram below :

WCFRia2.gif

Added the following code to MainPage.xaml.cs .

Do add the namespaces as well .

xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
    xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"

        <!-- Visual State Created -->
        <VisualStateManager.VisualStateGroups>

            <VisualStateGroup x:Name="PageTrans">

                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:1">
                        <ei:ExtendedVisualStateManager.TransitionEffect>
                            <ee:SlideInTransitionEffect/>
                        </ei:ExtendedVisualStateManager.TransitionEffect>
                        <VisualTransition.GeneratedEasingFunction>
                            <CubicEase EasingMode="EaseInOut"/>
                        </VisualTransition.GeneratedEasingFunction>
                    </VisualTransition>
                </VisualStateGroup.Transitions>

                <VisualState x:Name="Start"/>

                <VisualState x:Name="New"/>
            </VisualStateGroup>

        </VisualStateManager.VisualStateGroups>
        <VisualStateManager.CustomVisualStateManager>
            <ei:ExtendedVisualStateManager/>
        </VisualStateManager.CustomVisualStateManager>

        <!-- Visual State End-->


In order to swap between the states add the following code to MainPage constructor . This would create a nice sliding animation when the page loads .

// Swapping Between the states - This code creates a nice Slide In Transition
            if (state = state ^ true)
            {
                VisualStateManager.GoToState(this, "Start", true);
            }
 
            else
            {
                VisualStateManager.GoToState(this, "New", true);
            }



Lets run the code the Page opens with a nice animation .


Now lets try some different transition effects .

Lets open our solution in Blend and see what we can do .

The project opens up as shown below :

WCFRia3.gif

Check out the States Panel - It would look like below :

WCFRia4.gif

WCFRia5.gif

The default would be Slide In . Lets go and modify it .

WCFRia6.gif

Lets change it to say Fade .

WCFRia7.gif

You could also play around with the Easing Function as shown below :

WCFRia8.gif

Run and check out the animation .

In this post we have covered the Payroll View and we checked out few animations . Thanks . Happy Coding

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor