DCSIMG
Silverlight 1.0 Javascript Intellisense - minor updates (V1.1) - Justin myJustin = new Justin( Expriences.Current );

Silverlight 1.0 Javascript Intellisense - minor updates (V1.1)

Based on your feature requests I'm releasing an updated version of the Silverlight Javascript Intellisense.
https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=intellisense&ReleaseId=6504

image

 

Changes from V1.0 to V1.1:

1. Smaller Javascript files. (roughly 50% in actual file size)

2. Strongly typed Attached properties

3. Enum support.

4. getHost() support

5. exposed the inner Xaml element.

 

 

Smaller Javascript files. (roughly 50% in actual file size)

You've asked for it - you got it.

file sizes for V1.0:
Intellisense.js - 1,275KB
Intellisense.compressed.js - 425KB

image 

file sizes for V1.1:
Intellisense.js - 613KB
Intellisense.compressed.js - 279KB
image

 

Strongly typed Attached properties

In V1.0 you had to have local copies of the DependencyProperty you want to change.

Let's say we want to move "someElement" 100 pixels to the top of the screen by decreasing it's Canvas.Top by 100.

image 

image

image

image

    var CanvasTop = new DependencyProperty("Canvas.Top");

    someElement.setValue(CanvasTop, someElement.getValue(CanvasTop) - 100);

This required you to remember and spell correctly the name of the Attached Properties.
In V1.1 There's static field like constructs you can use.

image

image 

someElement.setValue(Canvas.get_TopProperty(), someElement.getValue(Canvas.get_TopProperty()) - 100);

 

Enum support

In V1.0 you had to initialize all your Enum values and remember them.

Let's say we want to check if a TextBlock has an underline as TextDecorations and if so set it's decorations to none.

image

image

 

    var TextDecorationsUnderline = new TextDecorations("Underline");

    var TextDecorationsNone = new TextDecorations("None");

 

    if (myTextBlock.get_textDecorations().element == TextDecorationsUnderline.element)

        myTextBlock.set_textDecorations(TextDecorationsNone);

 

In V1.1 you can use Enus almost the same way you do in C#.

image

image

image

    if (TextDecorations.is_Underline(myTextBlock.get_textDecorations()))

        myTextBlock.set_textDecorations(TextDecorations.get_None()); 

 

getHost() Support

In V1.0 we had no getHost(), In V1.1 we have getHost with full Intellisense.

image

image

image

image

    someElement.getHost().get_content().set_fullScreen(true);

 

And we can even use createFromXaml with full intellisense.

image

image

    someElement.getHost().get_content().createFromXaml("<TextBlock xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" x:Name=\"tbx2\" />", false);

 

exposed the inner Xaml element

You might want, on occasion to use the actual XAML element that works behind the scenes. In V1.0 you had to use the ".element" extension which you didn't get Intellisense for.

In V1.1 you get Intellisense for this property on every class.

image

 

If you've got any more feature request - I'm open to suggestions.

 

Published Thursday, October 18, 2007 12:25 PM by Justin-Josef Angel [MVP]

Comments

No Comments