Data Validation And Templating in Silverlight 4

MiniTutorial

This is the fifth in a series on Templates and DataValidation.
[ First In Series Previous In Series ]

In this and the next posting I will create an application that will demonstrate how to modify the Visual State for invalid data. Along the way we will review:

  • Binding form elements to data
  • The binding engine and MVVM
  • Using the binding engine for data validation
  • Data validation and the Visual State Manager
  • Using the MVVM Light Toolkit
  • Best practices in application development
  • Creating Child Windows

Continue reading →

Posted in Mini-Tutorial, Patterns & Skills, Styles and Templates | Tagged , , | 12 Comments

Events and Delegates Under The Hood – Q&A

MiniTutorial

In the comments from this morning’s post, Andrew raised two questions important enough that I wanted to answer them in a post, rather than in comments….

[In the original version of the posting] you had some code showing that you could use “=” with delegates but that you’d get a compile time error with the event keyword.

Answer: The easiest way to see this is to try it.  Change the assignment of the event handler from += to = in MainPageLoaded()

Continue reading →

Posted in Languages, Mini-Tutorial, Tools and Utilities | Tagged , | 7 Comments

Events and Delegates Under The Hood – Reposted

MiniTutorial

Many programmers come to Silverlight with little prior experience with C#, and thus conceptualize events as a response to an action that is “hooked up” using somewhat arbitrary syntax.  All of that is fine, until it isn’t, and so this post will dive a bit deeper into Delegates and Events as core aspects of .Net languages.

Delegates

Birthday 2010 When a head of state dies, the president of the United States typically doesn’t have time to attend the funeral personally. Instead, he dispatches a delegate. Often this delegate is the vice president, but sometimes the VP is unavailable and the president must send someone else, such as the secretary of state or even the “first lady.” He doesn’t want to “hardwire” his delegated authority to a single person; he might delegate this responsibility to anyone who is able to execute the correct funeral-protocol. The president defines in advance what responsibility will be delegated (attend the funeral), what parameters will be passed (condolences, kind words, warnings to potential usurpers), and what value he hopes to get back (good will, oil). He then assigns a particular person to that delegated responsibility at “runtime” as the course of his presidency progresses. Continue reading →

Posted in Languages, Mini-Tutorial, Patterns & Skills, Tools and Utilities | Tagged , | 8 Comments

Teaching An Old Control New Tricks With Templates

MiniTutorial

This is the fourth in a short series on Templates and DataValidation.
[ First In Series    Previous In Series ]

You will remember that in the previous post in this small series, we created a new button template with a new appearance and new behavior for the “standard” view states. 

This button will be used with our form, and the form in turn will (eventually) be prepopulated from a database. It would be very convenient if the button reflected the need for the data to be saved when the user updates any of the fields.  The design calls for the button’s border to turn red when the user makes any changes, and to return to normal once the changes are saved. To jazz it up a bit, let’s have the button flash green on its way back to normal.

Continue reading →

Posted in Blend, Mini-Tutorial, Styles and Templates | Tagged , , | 3 Comments

Templates, Visual State and Fun With Controls

This is the third (if you count Sunday’s update!) in my short series on Templates and Data Validation. [ First In Series.  Previous In Series ] ClickButton Today we’re going to create a templated  Button that changes the appearance and visual state behavior of the button. Changing the visual state behavior in this case means responding to:

  • MouseOver, by swelling
  • MouseDown, by twisting and shrinking
  • Disable, by fading
  • Lost Focus and Get Focus (no change for this demo)

Continue reading →

Posted in Blend, Mini-Tutorial, Styles and Templates | Tagged , | 2 Comments

Awarded Silverlight Cream’s Best Blog Post of 2010

I’m incredibly proud that Silverlight Cream (required reading for anyone interested in Silverlight) rated one of my blog posts #1 for 2010.    The pride results only from the fact  that Dave does such an incredible job every day culling the very best posts in the Silverlight eco-system.

Posted in Community, News | Tagged | 3 Comments

New Video: Introduction to Xaml

In my new video An Introduction To Xaml, I recreate the form used in Adding Controls To An Application, but this time using Xaml rather than drag and drop. Part of the ongoing video series: Getting Started With Silverlight.   [30]

Posted in News | Comments Off on New Video: Introduction to Xaml

Eulogy

The following is from the eulogy I gave for my mother in law. Posted here in the hope you might find some of it valuable.

Continue reading →

4 Comments

Styles (followup)

Yesterday’s post did not include source, and left fleshing out the styles as an exercise… this quick follow-up will provide a link to the full code and a quick walkthrough of the styles I ended up creating.

Continue reading →

Posted in Blend, Mini-Tutorial, Tools and Utilities, z Silverlight Archives | Tagged , | 1 Comment

Visual State Manager A-Z

Mini-tutorial

This is the first of a multipart series on the Visual State Manager which will cover

  • Styles
  • Resources
  • Templates
  • Custom Controls
  • Customizing data validation

Continue reading →

Posted in Blend, Mini-Tutorial, Tools and Utilities, z Silverlight Archives | Tagged , | 3 Comments

PivotViewer Released!

LinkedCollectionRun, do not walk to Pete Brown’s blog and read about the new PivotViewer control. This is a very cool control just released by LiveLabs and that is fully supported in the new PivotViewer learning section on Silverlight.net. The home page provides links to the code you need, three overview videos and, at the bottom of the page is a very nice writeup of what the PivotViewer is all about.

Pete provides links to the documentation, white papers, the samples and the new Silverlight PivotViewer Forum so I won’t reproduce all that here, I’ll just point you to his posting.

 

Stand by for mini-tutorials and videos on PivotViewer, coming to a blog near you. 

Posted in Tools and Utilities | Tagged | 1 Comment

Creating A Silverlight Blog That Doesn’t Suck

stopwatchMuch has been written about writing blogs that don’t suck, and about writing software that  doesn’t suck.  (When did suck become a word used in public?) This post focuses on what I find useful in Silverlight Blogs targeted at working programmers, and gleans (that is a nice word for steals) from many sources.

I very much invite your comments and rants…

Continue reading →

Posted in Opinion, z Silverlight Archives | Tagged | 6 Comments