Archive | January, 2010

Silverlight 4 workshop is sold out

29 Jan

The Silverlight 4 workshop in January was a big success and the tickets for the workshop in February is now sold out. I have opened up for the waitlist for the February workshop and opened the sale for the Marts workshop.

You can read more about the Marts workshop here – it’s only a week after the Mix10 conference in Las Vegas.

by xamlgeek

Surface Developers in Denmark

26 Jan

The Surface technology from Microsoft is pretty new and is still running on its first version. Even though the hardware has been available for a few years now, it wasn’t available in Denmark until about 6 months ago. But now we got it!

Because the technology is still new and fresh, not many developers have looked at it yet – specially not in Denmark. There is a group at LinkedIn called “Surface Developers in Denmark” (http://bit.ly/8WSSgc) for all Danish Surface developers. I encourage all surface developers to join it and be part of the Danish Surface community.

by xamlgeek

DescriptionViewer in Silverlight 3

25 Jan

One of the new data controls in Silverlight 3 is called DescriptionViewer.

A DescriptionViewer control displays an information icon and shows a text description in a tooltip when the mouse pointer is over the icon. It also tracks validation error states so that you can implement a custom error display. It can be used to display a description by itself or be associated with another control.

To use the DescriptViewer you must add a reference to the System.Windows.Controls.Data.Input.dll assembly.

image

Used at it’s most simple form by setting the Description property this is what you will get.

image

image

As mentioned at the beginning, the DescriptionViewer control is a data control. To gain full advantage of its functionality, you need to bind data to it.

Start by looking at your data class. It’s possible to add a Display attribute to your data class. The Display attribute takes several parameters and among them a Description. Before you can use the Display attribute you need to make a reference to the System.ComponentModel.DataAnnotations.dll assembly.

image

The description parameter can be used as content to our DescriptionViewer. To accomplish that you need to point the DescriptionViewer to the control that the DescriptionViewer is related to – in this case it is the TextBox control.

image

To fill the controls with data you should add some data to the DataContext of the page.

image 

The content of the DescriptionViewer is now bound to the Description parameter of the Display attribute in your Person class.

image

All-in-all you don’t save any keystrokes by using the Description parameter on the Display attribute but it’s highly maintainable – if you decide to make changes in the data class, you don’t need to make changes to the markup.

You can download the samplecode from my DropBox.

by xamlgeek

Silverlight Facebook client

25 Jan

Microsoft have released the Silverlight Facebook client:

http://www.silverlight.net/content/samples/apps/facebookclient/sfcquickinstall.aspx

(requires Silverlight 4 developer beta runtime)

by xamlgeek

CNUG: Hacking your website

25 Jan

Kom og hør Thor Larholm fortælle og demonstrere, hvordan hackere finder huller i din asp.net application, hvordan sikkerhedsfejlene kan udnyttes og hvordan du kan beskytte sig mod dem.

Tilmelding via EventBrite: http://cnug-hacking-your-website.eventbrite.com/

by xamlgeek

CNUG: Windows Azure den 11. februar 2010

20 Jan

Windows Azure er Microsofts bud på cloud computing.

Kom og hør René Løhde, arkitekt evangelist hos Microsft, om hvordan og hvorfor man skal vælge Windows Azure til sine cloud applikationer.

René vil vise og forklare hvordan man hoste sin applikation i skyen, hvordan man kan tage bestik af den underliggende platform og om hvordan man bruger de omkring liggende services og APIer.

Læs mere og tilmeld jer via Eventbrite:
http://cnugazure.eventbrite.com/

by xamlgeek

Slides and demos from Silverlight 4 presentation at Microsoft Web Partner event

20 Jan

Earlier today I did a short talk about Silverlight 4 at a Microsoft Web Partner event in Hellerup, Denmark. The talk had focus on the new line-of-business possibilities that comes with Silverlight 4.

Due to the very short time there wasn’t time to questions – if you have any don’t hesitate to contact me.

You can download the slides here and the demos here.

by xamlgeek

Cloud Light app (10K)

19 Jan

One of the events at Mix10 is a 10K challenge – create a Silverlight application that does not exceed 10 kilobytes.

Cloud Light is one of the applications that is part of 10K challenge – it’s a really impressive application; it’s simple, it’s easy to understand and the UI is really sweet. Take a look at http://mix10k.visitmix.com/Entry/Details/191 or see an overview of the applications at http://mix10k.visitmix.com/Gallery.

“Cloud Light is small application runtime that hosts, manages and runs cloud-based applications. The runtime environment also features an online application store from where you can download and install applications. For more information please see my blog at http://www.orktane.com

by xamlgeek

Track events in Webtrends from Expression Blend

19 Jan

Last week I taught a handful of webmasters the basics about Silverlight. One of the issues that they faced was the integration between Silverlight and tracking engines like Webtrends. Most tracking engines uses JavaScript to communicate between tracking engine and website. None of the webmasters are actually programmers and don’t know how to communicate with the HTML DOM from Silverlight. Furthermore the webmasters primary tool is Expression Blend and not Visual Studio.

To solve their problem I have created a Behavior that can be integrated into the project. The Behavior takes care of calling the JavaScript method with a Category specified by the webmaster – and it is all done from the Expression Blend UI.

How it is done

I have made a Silverlight class library called Quebec.Silverlight.Behaviors containing one class called AnalyticsAction. The class derives from TargetedTriggerAction making it possible to set a Trigger and a Target to the Behavior.

I needed two properties to be able to call the tracking methods: 1) name of the JavaScript method and 2) the Category to track. Both properties are implemented as Dependency properties with the Category attribute set to “Target Properties”:

[Category("Target Properties")]
public string JavaScriptMethod
{
  get { return (string)GetValue(JavaScriptMethodProperty); }
  set { SetValue(JavaScriptMethodProperty, value); }
}
public static readonly DependencyProperty JavaScriptMethodProperty =
   DependencyProperty.Register("JavaScriptMethod", typeof(string), typeof(AnalyticsAction), new PropertyMetadata("dcsMultiTrack"));

[Category("Target Properties")]
public string Category
{
  get { return (string)GetValue(CategoryProperty); }
  set { SetValue(CategoryProperty, value); }
}
public static readonly DependencyProperty CategoryProperty =
   DependencyProperty.Register("Category", typeof(string), typeof(AnalyticsAction), null);

The Category attribute allows the webmaster to set the two properties as part of the Target. The JavaScript method has a default value of “dcsMultiTrack” being the JavaScript method used by Webtrends.

Finally I implemented the Invoke method. This methods is called when the target is triggered (e.g. Click on Button, MouseEnter on Rectangle). The Invoke method is overridden from the base class.

protected override void Invoke(object parameter)
{
  if (Target == null)
    return;

  HtmlPage.Window.Invoke(JavaScriptMethod, new object[] { Category });
}

The Invoke method calls the JavaScript method specified by the webmaster through the HTML DOM and parses the Category as parameter to the method. Note! If the JavaScript method doesn’t exists an Exception will occur.

This Behavior can easily be extended with several properties and integrate into other tracking engines.

How to use the AnalyticsAction in Expression Blend

To use the AnalyticsAction behavior open your project in Expression Blend and add a reference to the assembly Quebec.Silverlight.Behaviors.dll.

clip_image002

Locate the control that you wish to add tracking to – select the control from the object browser. Remember that you can select both the LayoutRoot and controls added to the LayoutRoot.

Go to the Assets Library and select the Behavior tab. DoubleClick the AnalyticsAction to add it to your selected control.

clip_image004

Go to the properties tab – here it is possible to specify the Trigger (the SourceName and related EventName that triggers). Leave the the TargetName under Common Properties to [Parent]. At the Target Properties it is possible to specify the Category (eg. trackid, eventid) that is sent to Webtrends and to set the JavaScript method that works as a brigde between Webtrends and the Silverlight application.

clip_image006

You are now ready to track events directly to Webtrends using Expression Blend.

How to use AnalyticsAction in Visual Studio (XAML)

To use the AnalyticsAction behavior open your project in Visual Studio and add a reference to the assembly Quebec.Silverlight.Behaviors.dll.

Locate the XAML page/control that you wish to add tracking to. Add a namespace reference to the System.Windows.Interactivity assembly and the Quebec.Silverlight.Behaviors assembly.

xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:qsb="clr-namespace:Quebec.Silverlight.Behaviors;assembly=Quebec.Silverlight.Behaviors"

Locate the control that you wish to add tracking to in your XAML page. Add a Trigger using the attached properties Interaction.Triggers and add an EventTrigger to the Trigger. At the EventTrigger it is possible to specify the EventName that triggers the tracking.

Add the call to the AnalyticsAction – here it is possible to specify the Category and JavaScriptMethod.

<Button HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Content="Button">
  <i:Interaction.Triggers>
    <i:EventTrigger EventName="Click">
      <qsb:AnalyticsAction Category="Q714" JavaScriptMethod="dcsMultiTrack"/>
    </i:EventTrigger>
  </i:Interaction.Triggers>
</Button>

You are now ready to track events directly to Webtrends using Visual Studio.

by xamlgeek

Slides and demos from Silverlight presentation at ONUG

13 Jan

Today I did a talk about Silverlight at ONUG. The talk had focus on the new possibilities that comes with Silverlight 4.

Besides my introduction to Silverlight 4 and my demos we discussed some different subjects related to Silverlight; why Silverlight instead of WPF; where is the focus on future Silverlight releases; distribution of the plugin. It was great to discus the subjects and I’m sorry that I got carried away and forgot the coffeebreak :)

You can download the slides here and the demos here.

by xamlgeek

Follow

Get every new post delivered to your Inbox.

Join 1,356 other followers