Saturday, April 16, 2011

NetworkView - A cool WPF control for diagraming network, graphs, flowcharts, etc

CodeProject - NetworkView: A WPF custom control for visualizing and editing networks, graphs and flow-charts

"Introduction

This article examines the use and implementation of a WPF custom controlthat is used to display and edit networks, graphs and flow-charts. NetworkView, as I have called it, was inspired by and has many similarities to standard WPF controls such as ItemsControl and TreeView. The article and the sample code show how to use the control from XAML and from C# code.

This article is arranged in two main parts.

Part 1 examines NetworkView usage with walkthroughs of the two sample projects. This part and the reference section are enough if you just want to use NetworkView.

Part 2 goes into detail on the implementation. This will be useful if you want to make your own modifications to NetworkView or if you want to understand my approach to developing a complex WPF custom control.

At the end of the article is a reference section that describes the public properties, methods and commands exposed by NetworkView.

In previous articles I have covered a number of WPF techniques: use of adorners, zooming and panning,binding to UI element positions and most recently drag-selection of multiple items. NetworkView and the sample applications make use of all these techniques. I won't be covering these techniques in detail here. Instead, where appropriate, I'll refer back to previous articles.

NetworkView is intended to be backed with an application-specific view-model. It is possible, though I don't recommend it, to use NetworkView programmatically or in XAML without a view-model. This is similar to other WPF controls such as TreeView where you can also get by without a view-model. Using a view-model is the way it is intended to be used, so this is what we will be looking at. The simple sample uses a simple view-model while the advanced sample extends the view-model and adds new features. Josh Smith has a great article that shows how a view-model can improve your experience with the WPF TreeView.

Screenshot

This screenshot shows a simple graph created in the advanced sample. The main window shows a viewport onto the graph and beneath it the overview window shows the entire canvas.

networkview1

..."

This is officially a cool article and project. The article is novella length (32 printed pages), well written, formatted and diagrammed. And the project is covers is cool too. This is one of those kinds of controls you don't see source available very often, let alone one polished like this.

For example, check out a shot of the "advanced sample"

image

Yeah, that's a help like window next to the main, that explains how to use the control.

Here's a sample of the snap of the Solution

image

Friday, April 15, 2011

Cool Windows Live Writer Tip of the [whatever] - Changing the location where your drafts and recent posts are stored with one click...

LEHSYS - How to change the Drafts and Recent Posts folder in Windows Live Writer 2011

"Windows Live Writer is a fantastic offline blogging tool with a WYSIWYG editor. It interfaces with just about any blog service [Blogger, LiveJournal, TypePad, WordPress, etc.] If you're a blogger you'll find this tool incredibly helpful- and it's refreshingly free from Microsoft.

One of the things that’s a hindrance to the application; it doesn’t let you choose where you want to put your drafts and recent posts.

But ah-ha! Seems after years of asking, there’s a registry hack for Windows Live Writer that’ll allow you to save your Drafts and Recent posts anywhere you’d like you…

...

But WAIT, if you act now… you can get— this!

Microsoft is lazy. They know how to fix it and they could code it really quick, but they like watching people squirm throughout registry, hoping they’ll muck something up. That’s just wrong…

So, I wrote this; it performs the same functions you’ve seen there, to add the alternate location to the registry. You can do the previous steps manually, or do them with this… it’s up to you.

akwzqpnz[3]

..."

Nice! I love developers... Whereas some would be happy with the a reghack, we instead take the extra time and effort to make something that's hidden or hard, easy and simple.

This can be used to make your Windows Live Writer usage easier and consistant. Think mapping WLW on multiple machines to a single network share for these files (which Scott (@scottisafool) and the Larry Henry, the author (@lehsys), have recently tweeted about doing), or sync'ing/mesh'ing/cloud'ing the files, etc.

Hat tip to Scott (@scottisafool) for the tip about this.

Embed Excel spreadsheets and charts into your web pages/posts, not as static tables but as "live" data via Excel Web App

Microsoft Office - Embed an Excel spreadsheet on a web page

"With the Microsoft Excel Web App, you can embed spreadsheets on websites and blogs and make them interactive. Check out the examples on this page to get great ideas for how you can use the Excel Web App

...

SNAGHTMLdb4dca0

..."

Here's detailed steps on doing it, Embed an Excel workbook on a web page, as well as how you can tweak it, Customize how your Excel workbook is embedded.

What I thought cool is that the embedded sheet is not just a static table, not just html pasted in, but a "live" view. Whereas you can select cells, use filtering, sorting, etc, etc without any plugins!

SNAGHTMLdb870b4

And what's also cool is that you can do this inside your firewall too... If you have SharePoint 2010 and installed the Web Apps, you can embedded private, inside the firewall, data into your internal communications/emails, pages, etc. Adds a whole news dimension to sharing spreadsheets...

Not sure if this will work for those picking this up via a feed, but below is a copy of a weight chart I've been maintaining for the last few years, embedding the entire sheet (via an iframe) (and yes I'm working on getting that line to go back down... ;)

And here's just the chart;

Thursday, April 14, 2011

NuGet isn't just for Bin's any more... Publishing/getting the source/PDB's for your NuGet's

David Ebbo - The easy way to publish NuGet packages with sources

"The standard way to create NuGet packages today is to:

  • Create a nuspec file with all the metadata and package dependencies
  • Lay out the files that to want to include
  • Run ‘nuget pack’ to create the package
  • Run ‘nuget push’ to push them to the gallery

See Phil’s post more more details on those steps.

While this is pretty straightforward, it can be made yet easier if we take advantage of the fact that your VS project already contains a lot of information that shouldn’t have to be repeated.

Today, we are releasing a new nuget.exe feature of that makes this a lot easier.

Debugging support via SymbolSource.org

The other really exciting thing we’d like to announce today is that we have partnered with the folks at http://www.symbolsource.org/ to offer a really simple way of publishing your sources and PDB’s along with your package.

Up until now, there really wasn’t a great way for package authors to let their users debug into the package’s binaries. The user would have needed to download the sources separately from wherever the project is hosted, making sure that they exactly match the state of the binary. They would also need to locate the matching PDBs. That’s pretty hard to get right, and most users would generally not bother.

Now with almost no additional effort, package authors can publish their symbols and sources, and package consumers can debug into them from Visual Studio.

What the package author needs to do

Let’s first play the part of the author of a package that contains an assembly, which itself makes use of a library from another package. Let’s say that other package is Clay as an example.

...

What the package Consumer needs to do

Now let’s play the part of the package Consumer that uses this package. Here I’ll demonstrate using a simple Console app, though the steps apply equally well to other apps.

Important note: these steps are more interesting when done on a different machine than the ‘Package Author’ steps! If you do them on the same machine, rename or delete the Author project to make sure VS doesn’t take any shortcuts on you when debugging (which it will!).

...

image

..."

Nice!

Wednesday, April 13, 2011

Even simpler MVVM with Simple MVVM Toolkit v2 (think "NuGet'able, new features, new Project Templates, bug fixes and generally good and tasty stuff")

Tony Sneed's Blog - Simple Mvvm Toolkit Version 2.0: Better and Even Easier to Use

"I have just released version 2.0 of the Simple Mvvm Toolkit on CodePlex, NuGet and the Visual Studio Extensions Gallery.

Now all you have to do to get it is open Visual Studio and select Extensions Manager from the Tool menu, then search for “Simple Mvvm Toolkit” and click the Download button. Launch SimpleMvvmInstaller.exe and you’ll get the whole shebang: binaries, project and item templates, code snippets, samples and source code, copied to the SimpleMvvmToolkit directory in your Program Files folder. The ReadMe.txt file lists all the prerequisites you’ll need to install before using the toolkit. The installer will even add the toolkit to Visual Studio’s referenced assemblies, so that it appears in the list of assemblies when you show the Add Reference Dialog.

Visual Studio integration is nice, but the killer feature of v2 is the new Visual Studio project templates. You heard right, the installer not only gives you the item templates and code snippets you had in v1, but it also provides four project templates: Silverlight, Windows Phone, WPF and RIA Services. Each of these gives you a ready-made Visual Studio project that references the toolkit and includes Models, Views, ViewModels, ServiceAgents, and a ViewModelLocator. All you have to do is open the included ReadMe.txt file and follow the simple instructions, using each of the provided classes as examples. To get started just open Visual Studio, select File, New Project, then click on the Mvvm category beneath Windows (for WPF), Silverlight, or Silverlight for Windows Phone.

..."

Codeplex - Simple MVVM Toolkit for Silverlight, WPF and Windows Phone

"...

Features

New Features in v2:

  • An Installer that places the binaries, templates and snippets in all the right places.
    • Copies binaries, libraries, samples and source code to one location
    • Copies Visual Studio templates and code snippets to the correction location
    • Registers the binaries so that SimpleMvvmToolkit appears in the Visual Studio Add References dialog.
  • Visual Studio project templates
    • Project templates for Silverlight, Windows Phone and WPF, which include starter Locator, Model, ViewModel, View and ServiceAgent classes.
    • A multi-project Visual Studio template that includes a Silverlight client, a Silverlight Unit Test project and a WCF RIA Services project.
  • The main sample now has Parts 2 and 3
    • Part 2 demonstrates navigation, messaging, property associations, async
    • Part 3 demonstrates using the toolkit with WCF RIA Services, including persistence with CRUD operations
  • Simplified and consolidated ViewModelLocator template which creates ViewModels on-demand.
    • This allows Views to control the ViewModel lifetime, avoiding potential memory leaks
    • Silverlight and Windows Phone apps use the same ViewModelLocator template
    • The code snippet to insert injected (for dependency injection using MEF) ViewModels is more robust
  • Improved support for unit testing (with the Silverlight Unit Testing Framework – included in the Silverlight Toolkit)
    • Includes an extension method for enqueuing conditional tasks with a timeout
  • Simpler and more robust MessageBus
    • Now uses leak-proof eventing model so that unregistering for messages is no longer required
    • ViewModelBase now includes helper methods for sending and receiving messages
  • GenericDelegateCommand supports parsing string parameters from XAML
    • Plays nicer with CommandParameter in XAML

Other Features:

..."

A cool MVVM toolkit gets even better... I love the idea of the new Project Templates. That should help anyone new (cough... like me.. cough) up any learning curve.

 

Related Past Post XRef:
“Simple MVVM Toolkit for Silverlight” v1 Release

Caliburn.Micro RTW’s (Think a”Lighter/smaller/micro MVVM Framework for WPF, WP7 & Silverlight)

The MVVM Framework Tour – This time, Silverlight styling!
A MVVM framework “…three hour tour…”
A short diagramed guide of a few Model-View-* patterns
How about some free MVVM training/hands on/walkthroughs right in the VS box? “In the Box – MVVM Training” from Karl Shifflett (Oh yeah, with some WPF, Test, Moc, and Prism too)
One man’s introduction to MVVM with Visual Basic story OR zomg a MVVM article that’s not in C#!
MVVM Explained
From code-behind to MVVM in 90 Minutes - Jason Dolinger on MVVM
M-V-VM for… um… busy developers (not dummies… not dummies… okay, so I’m a dummy! ;)

[Humor] Damn Raptors...

WWdN: In Exile - raptors

SNAGHTML4499ffc

For another laugh, click through and check out the Title attribute for the image (i.e. over the mouse over the image)...

All-In-One Code Framework is now on MSDN Code Gallery, has a new sample browser and is cooler than ever

SampleBrowserv3

All-In-One Code Framework - More Searchable, Interactive and Optimized for Code Samples - Microsoft All-In-One Code Framework has a new home on MSDN Code Sample Gallery

"Microsoft All-In-One Code Framework - the free, centralized and developer-driven code sample library is having a new home on MSDN Code Sample Gallery to deliver a more friendly user experience to tens of thousands of developers worldwide.

The new MSDN Code Sample Gallery provides developers a greater experience around learning from code samples and enables access to the code samples where it is most relevant and in context. Thanks to the partnership with the great MSDN Code Sample Gallery team, Microsoft All-In-One Code Framework is moving its ever growing code sample library and its code sample request service to the new gallery. Here are the key improvements based on this migration.

● Sample Browser ^online coming in this week

...

● Better search function specially designed for code samples

...

● Better feedback channels

...

● Request a Code Sample

...

● Localization of Code Samples coming soon

..."

All-In-One Code Framework - New Microsoft All-In-One Code Framework “Sample Browser” v3 Released

"Microsoft All-In-One Code Framework Sample Browser v3 was released today, targeting to provide a much better code sample download and management experience for developers.

Install: http://1code.codeplex.com/releases/view/63844 (a tiny ClickOnce install)

Background of Sample Browser v3

Last month, we reached the milestone of releasing Sample Browser v2, whose features focus on providing better experience for browsing and searching around 600 code samples of Microsoft All-In-One Code Framework. We heard an important feedback from developers after that release: the sample browser accompanied with all 600 code samples is too large to download and hard to update when new releases come. We took this feedback seriously and make the enhancement in this new version of Sample Browser. In partnership with the MSDN Code Sample Gallery, the code sample download and management experience is now dramatically improved in Sample Browser v3.

Key features of Sample Browser v3

1. "on-demand" sample downloading

...

2. Sample download management

...

3. Auto-update

..."

This is one of my favorite projects and code sample sources. The stuff you can find here and that is added is always very cool and interesting. This move only makes me like it the more.

Here's a snap of the new MSDN Code Gallery for the All-in-One Code Framework. 558 code samples, so far...

image

image

 

Related Past Post XRef:
All-In-One Code Framework, your one stop shop for Windows code samples, examples and guidelines

All-In-One Knowledge Base Articles (aka another way to see all the coolness that’s in the All-In-One sample code base) 
Three languages, tons of technologies, continual additions, all source: The Microsoft All-In-One Code Framework (think “An Official Boat Load of Code Samples!”) (Added bonus “How can I on earth write a managed shell extension” with .Net 4 sample)

Tuesday, April 12, 2011

Caliburn.Micro RTW’s (Think a”Lighter/smaller/micro MVVM Framework for WPF, WP7 & Silverlight)

NET & Funky Fresh -Caliburn.Micro RTW, NuGet Support, Mix Open Source Festival!

“Today, I’m proud to announce the v1.0 RTW of Caliburn.Micro for WPF, Silverlight and Window Phone 7! The idea was born last year at Mix10 after my Build Your Own MVVM Framework talk received overwhelmingly positive feedback. I want to give a big thanks to the developers who put their time into this. Thanks Christopher, Marco and Ryan! Also, I want to say thanks to the community. It’s been exciting to see how fast a rich community of developers has grown up around this project and to see how many people are speaking about Caliburn.Micro at their local user groups, code camps and even major conferences such as Codestock and teched.

Along with his release comes a number of bug fixes and even a few new features, such as the new WindowManager for WP7 which provides View-Model-First modal dialogs with animations designed after the native MessageBox. Be sure to thank Marco for that. After you thank Marco, you need to give props to Ryan who spearheaded the NuGet package development. As of right now, Caliburn.Micro can be installed quite easily from Visual Studio. If you have NuGet 1.2 or later installed, from the Package Manager Console, just type:

…”

When I first saw “Caliburn.Micro” a while ago I thought it was Caliburn for micro sized, compact, etc platforms, i.e. phone and the like. Boy was I under the wrong impression…

Caliburn.Micro is really a rethink of a MVVM framework. Micro as in small, lighter, not-heavy, etc.

 

Related Past Post XRef:
Doing WPF/SilverLight? Interested in presentation patterns like MVVM, MVC? Testing/TDD friendly development? Solutions to common UI architecture problems? Then Caliburn might just be for you

“Search Work Items” VS2010 Extension source now available

Mike Parks - Search Work Items for TFS 2010 Source Code Published on CodePlex

“A little while back we published the Search Work Items for TFS 2010 extension in the Visual Studio Gallery. Noah Coad recently added Cory and I as Developers on the existing Search Work Items CodePlex project. Over the weekend I uploaded the new source code containing our Visual Studio and TFS 2010 updates. Feel free to check out the source code.

You can run the code locally but just be sure you point it at your experimental instance of Visual Studio. To do this, just right click on the project in the Solution Explorer, click properties, click the Debug tab, then set the following properties:

…”

This is a project/extension I’ve been using for a while now. Good to see that it’s alive and well and kudo’s to the guys for keeping the source available…

 

Related Past Post XRef:
TFS Search Work Items Visual Studio Addin v2.1 Released
TFS Quick Search Plugin 1.2 Released (Now with VS2008 Support)
TFS Inline Find (aka "Quick Search") VS2005 Plugin (with VS2008 coming soon)
Quick Search for Team Foundation Server Work Items Addin for Visual Studio

Monday, April 11, 2011

IBM getting into the HTML5 authoring game with open source Maqetta

eWeek.com - IBM Launches Maqetta HTML5 Tool as Open-Source Answer to Flash, Silverlight

IBM announced Maqetta, an HTML5 authoring tool for building desktop and mobile user interfaces, and also announced the contribution of the open-source technology to the Dojo Foundation.

LAS VEGAS – At the IBM Impact 2011 conference here, IBM announced both Maqetta as well as the open source contribution of its Maqetta HTML5 visual authoring tool to the Dojo Foundation.

Maqetta is an open source project that provides WYSIWYG visual authoring of HTML5 user interfaces using drag and drop assembly, and supports both desktop and mobile user interfaces. The Maqetta application itself is authored in HTML, and therefore runs in the browser without requiring additional plug-ins or downloads. Maqetta is available under a commercial-friendly open source license. Ands users can download the source code and install it on their own server, customize the code to fit their needs and contribute improvements to the open source project.

IBM officials said HTML5 is an umbrella term for dozens of new features that ship in modern browsers (desktop and mobile) that allow rich user interfaces, graphics, multimedia and fast performance using open standards. HTML5 ships in the latest versions of Microsoft Internet Explorer, Mozilla Firefox, Google Chrome and Apple Safari, and on modern smartphones, including iPhone, Android, RIM BlackBerry and Windows 7 Mobile.

..."

<literal.net id="snark">Okay, never heard of "Windows 7 Mobile" and Windows Phone 7 won't be getting HTML5 support for a bit yet... </literal.net>

"...

The Maqetta application itself is authored in HTML5/Ajax, and therefore runs in the browser without requiring additional plug-ins or downloads. Maqetta features include:

  • a WYSIWYG visual page editor for drawing out user interfaces

  • drag/drop mobile UI authoring within an exact-dimension device silhouette, such as the silhouette of an iPhone

  • simultaneous editing in either design or source views

  • deep support for CSS styling (the applications includes a full CSS parser/modeler)

  • a mechanism for organizing a UI prototype into a series of "application states" (aka "screens" or "panels") which allows a UI design to define interactivity without programming

  • a web-based review and commenting feature where the author can submit a live UI mockup for review by his team members

  • a "wireframing" feature that allows UI designers to create UI proposals that have a hand-drawn look

  • a theme editor for customizing the visual styling of a collection of widgets

  • export options that allow for smooth hand-off of the UI mockups into leading developer tools such as Eclipse

  • Maqetta's code base has a toolkit-independent architecture that allows for plugging in arbitrary widget libraries and CSS themes

The Preview 1 release of the Maqetta application is available for the community to use for free at the open source project's Web site, http://maqetta.org. Alternatively, users can download builds that they can install on their own servers.

..."

http://maqetta.org

image

For what ever its worth, this currently only seems to run in Chrome and Firefox (v4 in my case). With IE9 I can't seem to get past the first page (for example IE isn't happy with the initial dialogs, like New File Dialog, etc... maybe a security thing? I tried turning off pop-ups, etc, but no joy...Oh well, stuff like this is expected for betas/previews...)

"Multi-Targeting Pack for Microsoft .NET Framework 4 Platform Update 1" (with an official State Machine support for WF4)

The Problem Solver - WF4 State Machine in the Multi-Targeting Pack for Microsoft .NET Framework 4 Platform Update 1

"Lots of people like to use the state machine model workflow as this is a very flexible way of working that often fits in with how real work processes work. With WF3 we had a state machine workflow but with WF4 this was not ready in time and as a result we didn’t get to use this model. There where a few whitepapers on how to do a state machine using a flowchart and for simple cases those worked quite well.

Microsoft also released an implementation of the state machine for WF4 on CodePlex and while that worked quite well it was a not supported scenario ...

Now I always suspected we would have to wait for the next full version of the .NET framework it turns out we will get the real bits much sooner. The soon to be released Multi-Targeting Pack for Microsoft .NET Framework 4 Platform Update 1, now that is a mouth full, will contain the officially supported version of the state machine. See here for a how to guide on how to use the state machine.  ..."

I think the "Multi-Targeting Pack for Microsoft .NET Framework 4 Platform Update 1" release is new to me (at least as I sit here I don't remember hearing about this release)... Good to see Microsoft listening and responding by returning official State Machine support to WF4.

Micro-monetizing “extra” blog content? Paul presents some real world numbers from his experiment at doing so…

Paul's blog@Wildbunny - Blog micro-transactions – a viable business model?

“If you’re a regular reader, you make have noticed that my technical articles often come with source-code that you can buy if you would like to have a concrete implementation of the ideas I talk about in each article. I’m not sure if this is a new idea or not (probably not) but my decision to try it was based on necessity more than anything else; I’m rapidly running out of money since our game PuzzleShare didn’t take off the way we’d hoped it would (as described here).

The idea

The idea is simple; write a technical blog-post which contains a thorough description of the technique, diagrams, code snippits and working examples directly on the page and then provide the source code for the working examples at a small cost.

I always make sure that the reader has enough information given in the articles that they could implement the techniques described without buying the code, but can save themselves some time if they do – rather like in social games where you can buy more coins instantly instead of slowly earning them!

I think that its very important an article give as much to the reader as possible in terms of value before asking for anything in return; again very like the free-to-play model itself.

Results

I’m always very grateful when other articles reveal actual hard numbers to illustrate business concepts, so now its only fair that I do the same here. …”

As I said in "Physics engines for dummies", I thought Paul’s approach to micro-monetizing his blog post’s “extra” content pretty interesting and bold. I appreciate it even more now that he’s taken the extra step and shared the results of his experiment.

 

Related Past Post XRef:
"Physics engines for dummies"

RedGate’s “SQL in the City” coming to Los Angeles, Oct 28, 2011 (Think “Free SQL Server focused, day long, in-person, two session tracks for DBA’s & Dev’s mini-conference sponsored by RedGate”)

RedGate - SQL in the City (Los Angeles)

“…

Here's a taster of what's in store for your day out of the office:

  • Presentations about SQL Server
  • One-to-one demos from Red Gate developers
  • Break-time sessions
  • Networking time with the SQL community
  • Delicious refreshments throughout the day
  • Technical Support Clinic
  • Red Gate books library

image

SQL in the City (Los Angeles) - About SQL in the City

“12 years on from when Red Gate Software set out to produce ingeniously simple tools, we're inviting you to meet the faces behind them. SQL in the City brings together Red Gate and the SQL community for an awesome day of SQL Server training the Red Gate way.

The idea is simple: we like meeting you face to face (at events like PASS Summit, TechEd, DevConnections and SQL Bits), but realize that not everyone can always attend the paid-for conferences. That's why we're hosting our own free event, for you, your team and the SQL community.

We'll set off from the beautiful, if rather flat, university town of Cambridge, hit the road, and team up with a bunch of really great presenters (who are all experts in SQL Server) at a fantastic venue, so you can learn more about SQL Server and Red Gate tools and network with like-minded devs and DBAs.

This is your chance to tell us in person what you think about the tools that you use daily and what you'd like from us next. …”

Local SQL’ers for local LA’ers… At a great price and at a place I’ve never been, the Skirball Cultural Center (you know how it is… you never go to local places… Driven by it like 1.97 billion times, but have never been inside…). Signed up.

(via SQL Server with Mr. Denny - Join me at “SQL in the City” presented by Red Gate Software)