Posts

Showing posts with the label RIA

Silverlight 4.0 Tutorial (7 of N): Visual States

Image
Read Previous Posts: Part1 , Part2 , Part3 , Part4 , Part5 , Part6 Continuing our registration booth application, i did some changes to the application UI, here’s how the application look like right now - As you can see i removed the navigation features in the application, we will keep it as a one simple xaml page, i also changed some colors (excuse my poor color picking skills). - After looking at the UI i think that the agenda is not taking enough space, the lower DataForm is taking more space while this DataForm is needed only when someone wants to register, the focus of the default UI should be the agenda and the registered attendees, so we need to make the DataForm invisible and show it on demand, this is pretty easy to do, first i will add a button to view/hide the DataForm. - I will add a new column to the LayoutRoot grid and put the button inside this column, i will also add a simple rotate transform for this button - The button should look like this - Fi...

Silverlight 4.0 Tutorial (6 of N): Working with the ItemsControl

Image
Read Previous Posts: Part1 , Part2 , Part3 , Part4 , Part5 In this part of the series we will build the event agenda - First let’s try to make some room on the UI for the agenda, add a new row to the LayoutRoot grid, make sure that the attendees ListBox has RowSpan=2, then move the DataForm to the lower right cell, we will display the agenda in the upper right cell, Now our home page should look like the following - To build the agenda let’s recall our data model, we have a table TimeSlot that contains the different time slots in the event, each session is assigned to one time slot and each time slot can have one or more session. - We will need to retrieve all the time slots along with the sessions in each time slot, to do this go to the RegistrationDomainService.cs file in the RegistrationBooth.Web project, change the GetTimeSlots method as follows public IQueryable < TimeSlot > GetTimeSlots()       ...

Silverlight 4.0 Tutorial (5 of N): More Blend!

Image
Read Previous Posts: Part1 , Part2 , Part3 , Part4 Continuing our series for building a registration booth application using Silverlight 4.0, in this post we will continue working with Expression Blend - Open Home.xaml, select the LayoutRoot grid in the Objects and Timeline window, set the Width and Height properties to Auto so that the grid takes all the screen size. - Now we will change the background color of the page, select the LayoutRoot grid, go to the Background property and select the Gradient Brush option. - The Gradient brush we will use will have three gradient stops, you can click on the gradient bar (below the color mixer) to add a gradient stop at the specified offset, to remove a gradient stop click, hold, and drag your mouse off the gradient bar. for each gradient stop you can specify the color (RGB, Alpha). - The xaml for the grid background will be as follows. < Grid.Background >         < LinearGradientBrush EndPoint =...

Silverlight 4.0 Tutorial (4 of N): ListBox ItemTemplate

Image
Read Part 1 Read Part 2 Read Part 3 Continuing our RegistrationBooth Application, if you take a look at what we ended with you will find that the attendees data grid that we have is not user friendly, our application should be more attractive to the users, so we will get rid of the data grid and we will use a List box that has a custom template for displaying attendees, in this post we will start using Blend to assist in designing the application UI - Right click the xaml file in Visual Studio and choose Open in Expression Blend , this will open your solution in Blend. - Delete the attendeeDataGrid from the Home.xaml file. - We will change the layout of the form we will use a grid with two columns the width of the first one is about third of the screen width and we will put the list box in this column, and the second column take the remaining screen width and this is where we will put the attendees data form. - To do this, go to the Objects and Timeline window (if not...

Silverlight 4.0 Tutorial (3 of N): Working with the DataForm Control

Image
Read Part 1 Read Part 2 Continuing our RegistrationBooth Application, in the previous post we ended having a data grid that displays all the attendees, and a user control to add a new attendee. The user control for adding a new attendee didn’t contain any validation logic, of course this is a bad practice, in this post we will add the necessary validation when creating adding new attendees. - First we will need to define our validation logic for the Attendee entity, if you remember our first post when we created the Domain Service class we choose to create metadata classes for our entities, you can read more about metadata classes in the RIA services documentation ( How To Add Metadata Classes ). - In the RegistrationBooth.Web project the file RegistrationDomainService.metadata.cs contains the metadata classes, we will change the AttendeeMetadata class to add some validation attributes to the different Attendee properties, you can read more about validation attributes at How To Valida...