Vincent Leung .NET Tech Clips

The latest tech clips from the .NET community

Step by Step guide on Switching between Silverlight 3 Tools and Silverlight 2 Tools

March 31, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet

Silverlight Toolkit DomainUpDown, Accordion – Ruurd Boeke

image

image

  • DomainUpDown – A DomainUpDown is a very simple control that comes in handy when screen real-estate is at a premium, or when items are presented that can not easily be matched by a string representation or when you just want a page through data.

image

A DUD is templateable, and in order to do so, exposes a DP called ItemTemplate.

The ItemTemplate can be used to define the way an item should look in displaymode (see next paragraph).

<inputToolkit:DomainUpDown
      ItemsSource="{Binding}"
      HorizontalAlignment="Left"
      Height="Auto"
      FontSize="34">
      <inputToolkit:DomainUpDown.ItemTemplate>
        <DataTemplate>
          <Grid MinWidth="370">
            <Grid.Background>
              <SolidColorBrush Color="#aa000000" />
            </Grid.Background>
            <TextBlock
              Foreground="#22ffffff"
              Margin="4+0,2+0"
              FontSize="34"
              Text="{Binding CodeFaa}" />
            <StackPanel
              HorizontalAlignment="Right"
              Margin="0, 0, 8, 0">
              <TextBlock
                HorizontalAlignment="Right"
                Foreground="White"
                FontSize="12"
                Text="{Binding LimitedName}"
                Padding="2" />
              <TextBlock
                HorizontalAlignment="Right"
                Foreground="White"
                FontSize="14"
                Text="{Binding City}"
                Padding="2" />
              <TextBlock
                HorizontalAlignment="Right"
                Foreground="White"
                FontSize="14"
                Text="{Binding State}"
                Padding="2" />
            </StackPanel>
          </Grid>
        </DataTemplate>
      </inputToolkit:DomainUpDown.ItemTemplate>
    </inputToolkit:DomainUpDown>

March 26, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet

Getting Started with Behaviors in Expression Blend 3

 

Step by  step walkthrough using Behaviors

image image

Pete Blois’s MIX Session Video 

image

& his MIX Behavior Pack

Triggers:

  • KeyTrigger
  • TimerTrigger
  • MouseGestureTrigger
  • StateChanged

Actions:

  • ShowMessageBox
  • GoToState action
  • GoToNextState
  • GoToPreviousState
  • ListBoxAddOne
  • ListBoxRemoveOne
  • ListBoxRemoveThisItem

March 25, 2009 Posted by Vincent Leung | Expression Blend, Silverlight | | No Comments Yet

Silverlight 3 URI Routing using UriMapper

 

The navigation routes are read top down so you can still have explicit (or additional) routes in addition to the default.  So given:

   1: ...
   2: <navcore:UriMapper x:Key="uriMapper">
   3:     <navcore:UriMapping Uri="About-Us" MappedUri="/Views/AboutPage.xaml" />
   4:     <navcore:UriMapping Uri="History" MappedUri="/Views/AboutPage.xaml" />
   5:     <navcore:UriMapping Uri="{}{page}" MappedUri="/Views/{page}.xaml" />
   6: </navcore:UriMapper>
   7: ...

A request to About-Us, History or About would navigate to /Views/AboutPage.xaml regardless.  This provides you some flexibility and granularity in your implementation and also provides additional SEO points for your content.

Via Silverlight 3: Navigation URI Routing

March 25, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet

Using Merged Resource Dictionaries in Silverlight 3 to split resources into separate files

Merged Resource Dictionaries provide a way to define and split resources into separate files. By locating application resources in external file we can then reuse them between applications. This feature can be helpful in custom control development, but not only.

In Silverlight 2 resources cannot be factored into separate files and that leads to large App.xaml file holding application-wide shared resources.

Merged Resources Dictionaries are a great solution for these problems – you are free to split style definitions and other resources into manageable pieces, making it easy to localize and revise.

You can include your resource .xaml file in the project as Resource or as Content or as an external assembly.

image

You can refer it like the external xaml like this:

image

And use it like this: {StaticResource TitleBrush}

 

Merged Resource Dictionaries in Silverlight 3

March 25, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet

Disable UI or part of it while Silverlight is loading data from server

March 25, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet

Cascading Styles in Silverlight 3

Style cascading is accomplished by using the new BasedOn attribute of the Style class.

image 

March 25, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet

My Favorite Silverlight 3 Screencasts

LocalConnection API
(11 minutes, 47 seconds)

DataForm Control
(25 minutes, 54 seconds)

Out-of-browser Experiences
(24 minutes, 25 seconds)

Using 3D Transforms, Part 1
(15 minutes, 54 seconds)

Pixel Effects
(24 minutes, 28 seconds)

March 23, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet

Create a Glass Orb Button in Silverlight using Expression Blend

March 21, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet

A guide to Silverlight 3 new features by Tim Heuer

 

ALL you need to know of Silverlight 3

Via A guide to Silverlight 3 new features

Also in more details: Out of Browser Model Explained

image

March 19, 2009 Posted by Vincent Leung | Silverlight | | No Comments Yet