Silverlight, WPF, ASP.NET

Atlanta Silverlight Firestarter Day of Silverlight 3 Training Recap

Thursday, August 27, 2009 5:06:39 AM (Eastern Daylight Time, UTC-04:00)

Last weekend I attended and spoke at the Atlanta Silverlight Firestarter. This free, day long event featured a wide range of content presented by a number of presenters. The organizers did an awesome job and deserver a big pat on their back for their efforts.

During the afternoon I presented a Design Tools talk, focusing on Blend 3’s new SkechFlow prototyping tools and sample data. I’ll be posting my slides and samples here shortly, along with further details.

Posted in  | Comments [0] 


Silverlight 3 DataForm Part 1

Friday, August 14, 2009 7:22:09 AM (Eastern Daylight Time, UTC-04:00)

Along with the launch of Silverlight 3, a number of new controls were introduced in the Silverlight Toolkit. One control worth taking a look at if you deal with any sort of data entry forms in your applications is the DataForm.

The quick and dirty demo is to take an object, in this case Photo.cs

    public class Photo
    {
        public int PhotoId { get; set; }
        public string Title { get; set; }
        public string Url { get; set; }
        public string Description { get; set; }
        public int Rating { get; set; }
public DateTime DateTaken { get; set; } public bool Printed { get; set; } }
Add a DataForm control, set it’s CurrentItem property to a person obect
 <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <local:Photo x:Key="MyPhoto"/>
        </Grid.Resources>
            <dataFormToolkit:DataForm CurrentItem="{StaticResource MyPhoto}" Width="300">
            </dataFormToolkit:DataForm>
  </Grid>

And there we go, a DataForm!

image

Just like that, the control auto-generated the fields for us and wired them up to the object. In the case of the bool it selected a checkbox and uses a calendar control for the date taken field. Labels are also created based on the property names.

This is all well and good, but what if that’s not exactly what I want. For example, what if I don’t want to see the PhotoID and should not be able to change the url?

What if there was a way that we could somehow tell the system how we want it to handle the display of our photo class? System.ComponentModel.DataAnnotations to the rescue! Data Annotations give us the ability to add attributes in our class that the data form looks at when generating these fields. Below is the photo class updated to hide the PhotoId field, make the URL read only, and update the label text for the DateTaken property.

 public class Photo
    {
        [Display(AutoGenerateField = false)]
        public int PhotoId { get; set; }
        public string Title { get; set; }
        [Editable(false)]
        public string Url { get; set; }
        public string Description { get; set; }
        public int Rating { get; set; }
        [Display(Name="Date photo was taken")]
        public DateTime DateTaken { get; set; }
        public bool Printed { get; set; }
    }

And the result is

image

One of the additional things that can be done with DataAnnotations is data validation. By adding an attribute of [Required()] to the title, the Dataorm will pickup the validation requirement and automatically display an error message.

image

You will notice the OK button at the bottom of the form. I added AutoCommit=”False” to the DataForm XAML to allow me to notify the dataform that I was committing changes. In addition to required there are Range, StringLength, RegularExpression validators available.

In Part 2 I’ll go over how you can take even more control over the form by specifying content.

 

Posted in  | Comments [1] 


Remember the Silverlight Toolkit!

Friday, August 14, 2009 6:21:46 AM (Eastern Daylight Time, UTC-04:00)

Every time I present on Silverlight I make a point to make sure people check out download and install the Silverlight Toolkit. After installing the developer tools, this should be your next step?

Why you ask? Controls! Controls! Controls!

In order to ship more frequent updates of controls and not be as closely tied to the runtime and SDK releases, Microsoft has selected to use CodePlex as the delivery method for all of these addition controls. (Please check out the list of controls below) The site also acts as a feedback mechanism to allow input from you and I on bugs and requested features. The source code is even available!

There are many great controls to use right out of the box, making that much more productive day 1 with Silverlight.

Now go download! http://www.codeplex.com/Silverlight/

 

[Details from the CodePlex site]

image

What is the Silverlight Toolkit?

The Silverlight Toolkit is a collection of Silverlight controls, components and utilities made available outside the normal Silverlight release cycle. It adds new functionality quickly for designers and developers, and provides the community an efficient way to help shape product development by contributing ideas and bug reports. It includes full source code, unit tests, samples and documentation for 26 new controls covering charting, styling, layout, and user input.
Technorati Tags: ,,,

Posted in  | Comments [0] 


Silverlight 3 Presentation at TRINUG Aug 12th, 2009

Tuesday, August 04, 2009 8:03:47 PM (Eastern Daylight Time, UTC-04:00)

I’ll be celebrating my 9th wedding anniversary by giving a Silverlight 3 presentation to the Triangle .Net User Group in Raleigh NC on Aug 12th 2009.

“Join us for a walk through many of the powerful new features in Silverlight 3  and see how they can help you be productive writing Rich Internet Applications (RIA) with compelling user experiences. There's a lot more to Silverlight than video players and fancy animations, allowing us to create applications that people both want to use and can be productive with while still getting the project out the door on time. ”

 

If you’re in the neighborhood, please try to attend. It may be that last time I can leave the house for a while! ;-)

Posted in  | Comments [0] 


Raleigh Code Camp 2009

Tuesday, August 04, 2009 6:31:24 PM (Eastern Daylight Time, UTC-04:00)

The date has been selected for the 2009 Raleigh Code Camp. It’s going to take place this year on Saturday September 19th in Raleigh, NC. The call for speakers is out, and you can submit your talks at www.codecamp.org for the event. We’re looking forward to another stellar event!

If you have never attended a Code Camp before, they are a free day of developer training put on by other developers. The speakers volunteer their time (and travel) to present on topics they are passionate about. With typically draw a number of MVP’s and other experts in a variety of topics areas. The cool things is that you don’t need to be a conference speaker or have some special title to speak, and in fact some of the best presentations I’ve seen are from people who are just passionate about their area of interest. The event is free, but you must register to attend. Attendee registration will begin in August.

On a side note, WPF MVVM Superstar Karl Shifflett is planning attend and may also be presenting a special version of his MVVM LOB training talk on Friday before. We’re looking at the interest and availability of venue right now. Karl’s an amazing and passionate WPF expert, and his talks have packed rooms across the country and around world. If you are interested in attending please let me know.

Posted in  | Comments [0]