Javascript Intellisense
Hey gang.
I am new to the WPF/E area but I have been looking at WPF CTP's for awhile so I understand the concept.
Abandoning the C# code-behind and using Javascript is fine but I am finding this is a step backwards in developer environment. I am constantly going back and forth to documentation. I really do miss the intellisense environment.
Is there any way to get intellisense for javascript and the include files? Also for components such as the viewer for WPF/E?
I would guess this answer is no as I am sure there is huge challenges for such things like that. But I thought I would ask anyways :)
I am liking AJAX and all but I find it quite a step back in environment. Kind of like I lost all that was good about Visual Studio.
Is this maybe in the plans?
Thanks and take care,
Simon
[843 byte] By [
Synced23] at [2007-12-31]
It is important to remember the reason that WPF/E uses javascript is because it all runs on the client in the browser. You don't need to abandon the code-behind, just shift your thinking. In fact, you can generate WPF/E using a code-behind. Take a simple example where you write the current date-time on an ASP.Net page.
<body><%=DateTime.Now.ToString()%></body>
You can write an ASP.Net page that outputs Xaml and then load that with the WPF/E aghost file. So instead of the above you would have:
<TextBlock Foreground="Black" Text="<%=DateTime.Now.ToString()%>" />
This makes WPF/E very similar to ASP.Net in terms of programability in that you can program it on the server side (C# or VB.Net) as well as on the client side (Javascript).
As for intellisense, that is kind of outside the scope of WPF/E. Here is a good article on Javascript intellisense in VS.Net: http://blogs.crsw.com/mark/articles/648.aspx.
Thanks for the reply!
Yes I understand the difference between server-side and client-side. However when writting client-side javascript what I meant was you abandon the nice development environment that you get with C#, etc. Yes you are writting a scripting language but other IDE's I have used do provide javascript intellisense for basic java syntax as well as include files so I wasn't sure if this was possible in VS.NET or not, and if it wasn't is this a feature coming in the future because I believe it should be. Especially if ASP.NET AJAX and WPF/E are on the horizon.
One thing I credit Microsoft greatly is giving us developers the top notch developer tools so I don't want to see this stop now that Javascript is going to be a huge point forward from now on :)
I will take a look at that link, thanks!
Thanks and take care,
Simon
Well I found a quite interesting project called Script#. Basically provides an API for you to write script code in C# and it compiles it into javascript. The potential of this type of thing I think is huge. It sounds great.
http://www.nikhilk.net/ScriptSharpIntro.aspx
Now there are a few design issues I have with the way some of it is implemented but the basics behind it I love. This gives a type-safe and full intellisense environment which ends up being client side code and also eliminates typos and errors such like that, which scripting languages allow you to do.
I am really loving the potential of this type of thing. Unfortunately it looks like its 1 person developing it, and theres no source available. If MS would do an API like this, it would rock.
One big issue with this Script# framework is you must write all the object wrappers which kinda sucks. There is SO many javascript frameworks now such as Dojo etc. If the framework could read any included .js files you have and wrap them automatically then dealing with javascript would be smooth as silk.
Wish there was more weight behind a project like this :)
Thanks and take care.
To add to that, the WPF/E SDK contains an XML schema file for the subset of XAML that WPF/E supports. This can be very helpful when writing WPF/E XAML by hand, as long as you use a tool that understands XSD files.