Rabu, 04 Februari 2009

WPF Basics: Expression Blend and Visual Studio - a Good Partnership


I've been experimenting with the interaction between Visual Studio 2008 and Expression Blend (Version 1 with SP1). One thing I realised early on (right from the Orcas Beta days) is that Blend is a great help when you want to fine tune color gradients, create lines, shapes and paths or create animations. Having carried out both of these tasks by typing in the Xaml code in Visual Studio and checking the result, it's not something I'd want to do the hard way long term.

That said, I'm surprised at just how comfortable I am now with manually entering xaml in Visual Studio for the mainstream tasks - probably because this is the way I started. In fact, because the early Beta designer had poor toolbox functionality I still often prefer to type xaml, rather than drag an instance from the toolbox. (I'm sure I'll get lazier as time goes on, though!).


I didn't find Blend very intuitive at first (and positively hated the default "Expression Dark" setting). But I'm beginning to find that I'm using the Properties and Interaction Panels much more now, so I suppose it's just another learning curve to navigate.

Anyway, back to the interaction between the two products. If you open up the same project in both Blend and Visual Studio at the same time you can flip back and forth between the two. Whenever you save file(s) in either application, you'll be invited to update the modified project as soon as you switch to the other app. Note that the files have to be saved, not just amended, for this to happen.

I made a couple of wrong assumptions at first. One thing I did wrong was to open up individual xaml files from an existing project in Blend to work on them (i.e I opened a new Blend project and added an existing file to that). Of course, the only sensible way is to open the containing Project, even if you aren't currently interested in working with it in Visual Studio.


You can make changes (if you want to) to any of the xaml files inside Blend, save the file(s) and exit. The next time you do open up this project in Visual Studio, the changes will be incorporated (naturally, because it's the same files!) but you won't get any notification that changes have been made. The same applies in reverse.

It's possible that you might be tempted to select a .vb or .cs file, right click and select "Edit Externally" from the Context Menu, or double click the file name. And if you did this, you might expect to be taken to the Visual Studio instance that's currently running this project. Actually what does happen is that a new instance of Visual Studio will open with just that single code-behind file in the IDE. So of course most times you'll just Alt-TAB between applications or use the Windows Taskbar.

On the subject of editing externally, you'll absolutely want to stick with Visual Studio for most of your xaml editing. Blend offers you no Intellisense help at all in the current version; VS Intellisense is very smart and helpful. If you choose the 'Edit Externally' option in Blend, you'll be taken to Notepad by default, which isn't a whole lot better than the xaml window in Blend itself. It may be possible to tweak this setting to some other xaml code editor such as XamlPad, but it's hard to see any reason not to use Visual Studio if you have it.

So essentially my experience so far is that the best way is to open the same project side by side (literally in my case as I now use two monitors), use Visual Studio for most of the hand-built xaml (plus the code-behind of course) and use Blend for the purely visual touches that are difficult to visualize and/or verbose to write. If V2 of Blend includes Intellisense that might change but for now that's the approach that works best for me.








source :http://blogs.vbcity.com

-------------------------------------------------------

Trik Gambar Bergerak

Trik Gambar-dimouse

Trik hapus pwd mysql

Trik insertin to db

Trik jadi root dilinux

Trik jam-distatus-bar

Trik Koneksi-ke database

Trik Koneksi-msql-php

Trik lihat-database-mysql

Trik membahas-fungsi-else

Trik member-area