Maritime DevCon June 18 in Moncton, NB

The Maritime Developer Conference is a half-day event happening in Moncton, NB on Friday, June 18. With hot topics like iPhone development and MongoDB on the agenda along with introductory sessions to many popular languages and frameworks, Maritime DevCon is an amazing value at $19. This event is possible thanks to the generosity of many talented developers who are volunteering their time to share their expertise. Sessions are happening in two simultaneous tracks: Room 1 - Java Jumpstart for Developers - iPhone Development - Basics of ASP.NET - Development Methods Interactive Panel - Building Rockstar Estimating Skills Room 2 - NoSQL & Document Databases with MongoDB - Programmer’s Primer on .NET - Python for Hatchlings - Groovy & Dynamic JVM - A Gem of a Ruby Intro Visit http://careertown.ca/devcon/ for speaker bios, agenda, and registration information. And as if all that great content isn’t enough, there’s an added bonus: the big door prize at the end of a day is an Apple iPad (courtesy of the Maritimes Java User Group)!

How To Debug Weird AJAX Errors

Media_httpwwwshawndug_ebcjc
Ever had a weird AJAX error that literally gave you no information?  This post describes a simple thing you can do to make AJAX spill its guts and reveal its dirty little secret. I was helping a coworker today with a weird issue he was having with a website after deploying to the QA server.  The error was not happening on his local dev machine (naturally). All that we had to go on was: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500 The code itself was nothing special – a simple MultiView inside an UpdatePanel.  And it worked fine on his own machine.  I checked in Firebug to see if there was any information in the Response.  But there was literally nothing to work with.  I was puzzled and did a few searches on the web. I stumbled on this little snippet which was buried in an ASP.NET Forums post.
1: function EndRequestHandler(sender, args) {
2:   if (args.get_error() != undefined)
3:   {
4:     args.set_errorHandled(true);
5:     alert("There was an error" + args.get_error().message);
6:   }
7: }
8:
9: function load() {
10:   Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
11: }
12:
13:
The instructions were pretty simple.  First paste this JavaScript into your page.  Next, ensure in your web.config that CustomErrors=Off.  Then call the load() method on your body Onload Event. After doing this the Alert box contained a meaningful message and I was able to quickly fix the issue (Linq To SQL error due to QA schema being out of date). It’s not fancy – but it is effective.

Dev East Event: Windows Desktop Deployment Made Easy (Jun 28, 2010)

Windows Desktop Deployment Made Easy Light-Touch Installation from start to finish. Join Mitch Garvis for a two hour presentation on deploying Windows 7 and applications, either to new PCs or as a tool to migrate existing Windows XP Machines. Using only free tools from Microsoft, I will show you how you too can become a deployment guru, saving yourself and your clients time, money, and headaches! To register head over to http://deveast.eventbrite.com. Rough schedule for the evening:
  • 6:00 pm to 6:30 pm :  Social mixer with pizza and pop
  • 6:30 pm to 8:30 pm :  Presentation
  • 8:30 pm to 8:45 pm :  Prize giveaways and wrap up
More About Mitch: Mitch is an IT Trainer with a passion for community. Having founded and led two major Canadian user groups for IT Professionals he understands both the value and rewards of helping his peers. After several years as a consultant and in-house IT Pro for companies in Canada, he now works with various companies creating and delivering training for Microsoft to its partners and clients around the world. As a Microsoft Certified Trainer he has worked throughout the US and Canada, as well as internationally, and has been recognized for his community work with the Microsoft Most Valuable Professional award over time across several different product focus designations. He is a member of Microsoft’s Springboard Technical Experts Panel (STEP) and offers presentations to groups around the world on Windows and other topics of interest. Mitch is an avid writer, and blogs at http://www.garvis.ca. Mitch has one wife, two children, three dogs, and four free minutes to himself per week.  He parks his car in Oakville, Ontario.

Energize IT Halifax Mar 23 - Volunteers Needed

As this is a joint event with Microsoft, Dev East will be helping out with onsite logistics.  This includes things like registration, and other small details.  Nothing too difficult.  I need a couple of folks to help me out with some of these things in order to help make the event a success. Please contact me via email or through the About page on this blog.  If you don't hear back from me right away, I am travelling until Mar 20th and will get back to you on my return. Your help is appreciated and its important that we show Microsoft the great group we have here.  Thanks!

Dev East Halifax .NET UG Meeting Apr. 6, 2010

This time out we're bringing in Joel Hebert from Ottawa.  Joel is a Microsoft Community Influencer and a Microsoft MVP for ASP.NET.  He's presenting 2 great topics...it's going to be a great night!  Hurry now and reserve your seat because space is limited. To register go to http://deveast.eventbrite.com. Rough schedule for the evening:
  • 6:00 pm to 6:30 pm :  Social mixer with pizza and pop
  • 6:30 pm to 6:45 pm :  What's new in Entity Framework 4.0?
  • 6:45 pm to 7:00 pm :  break
  • 7:00 pm to 8:00 pm :  A Busy Developers Guide to ASP.NET 4.0 and VS 2010
  • 8:00 pm to 8:15 pm :  Prize giveaways and wrap up
More About Joel: As the Director / Solutions Architect at Opulent ASP Development Inc., Joel works as a consultant specializing in ASP.NET Enterprise Architecture / Development. He is passionate about web farms / web gardens and distributed caching. His interests are Domain Driven Design - DDD, Distributed Domain Driven Design -DDDD, Enterprise Integration Patterns, Patterns of Enterprise Application Architecture, Analysis Patterns and of course wine as he is studying to become a sommelier.

Design Contest: Create Dev East A Logo - Win Windows 7 Ultimate

I don't know about you, but I'm not a big fan of the text logo for the Dev East blog.  So today I'm announcing a contest - design Dev East a logo and win a copy of Windows 7 Ultimate.  Put on your design hat and create something awesome! What are the rules?
  1. All submitted entries must be your own original artwork and free of any licensing issues or limitations.
  2. If you win, you give up all rights of ownership and the logo and all source files (e.g. Illustrator, PhotoShop, whatever) become the property of Dev East.  You no longer own it.  We do.
  3. The best 5 entries will be featured on the Dev East blog and a public voting will help decide the winner.
  4. All entries must be received by April 1st, 2010.
  5. All decisions are final.
  6. Submit entries with a written explanation of your design vision and contact info to:  shawn dot duggan at gmail dot com with the Subject: "Dev East Design Contest".
Good luck!

Register Now For Energize IT Halifax

I am excited to announce to the members of the Dev East Halifax User Group that Microsoft is coming to town to host EnergizeIT Community Connection: FROM THE CLIENT TO THE CLOUD on March 23rd and you are invited! This exclusive event series is hosted by user groups across Canada. We’re opening our doors to other passionate technical professionals yet I want to give you the first opportunity to register for the event.
Media_httpwwwshawndug_hhaei
EnergizeIT Dev East Halifax Community Connection: From the Client to the Cloud TO REGISTER: Click here. REGISTRATION START TIME: 5-6PM, EVENT START/END TIME: 6PM-9PM LOCATION: Halifax Board of Trade, Room 200C2, 1800 Argyle Street, Halifax, NS SESSION OVERVIEW: Windows Azure. Office System 2010. Visual Studio 2010. Windows Phone 7. The Microsoft-based platform presents a bevy of opportunities for all of us. Whether you are a Developer or an IT Pro, knowing how these will impact you is critical, especially in the new economic reality. This evening Community EnergizeIT event will help you understand Microsoft’s Cloud Services vision. You will find out about the possibilities that these technologies help realize and the value that they can bring to your organization and yourself. Microsoft advisors will explore the Microsoft-based platform through a scenario that will demonstrate different points of view - from developer to IT Pro, from consumer to the information worker. From the client to the cloud, this fun-filled demo-intensive exploration will excite you about the possibilities of the Microsoft-based platform. You’ll see how to build next generation applications with technology like Silverlight, .NET 4.0 and Visual Studio 2010. You will find out how to consume those applications on a variety of devices, like mobile devices running Windows Phone, netbooks and PCs running Windows 7, as well as the web. You will learn about how the Microsoft-based platform allows you to connect with your colleagues no matter where you are –office, coffee shops, or your own living room. You’ll also see how you and your colleagues can be even more productive with Office 2010 and SharePoint 2010. EnergizeIT Community Connection: From the Client to the Cloud is your opportunity to learn how to harness the power and flexibility of the Microsoft-based platform from the client to the cloud. To learn more about the EnergizeIT program visit www.microsoft.ca/EnergizeIT.  I look forward to seeing you at this event. Sincerely, Shawn Duggan Dev East Halifax http://deveast.com
Media_httpwwwshawndug_umgcx
Media_httpwwwshawndug_recfe

It's Going to be a Great Spring for Dev East

While it might seem quiet - there is a lot going on behind the scenes.  There are wheels in motion for 3 events! First - our next UG meeting will be Apr. 6th and a guest speaker from Ottawa will be joining us.  He is a Microsoft MVP and will present on 2 great topics.  When everything is finalized I'll post more details on the Dev East blog. Next, there is a potential special event in the late Feb or early March timeframe.  I can't talk about it, but if anyone would like to help present some material on a very cool topic, please let me know. Lastly, there is a major event coming.  That's all I can say for now. Stay tuned.

WPF RichTextBox With Two Way DataBinding

In an application I’m currently writing my users will be creating many text notes and I wanted to allow for the user to create nicely formatted documents, as well as having the ability for fine-grained control over printing options.  Enter the RichTextBox â€" it is similar to a TextBox, but provides more advanced text formatting options to the user.  Enabling the advanced editing features is trivial (read up on the available Editing Commands), literally in minutes you can create a WYSIWYG editor.   Where things get sticky is when you start talking about databinding.

The RichTextBox stores the text in its Document property which is of type FlowDocument.  It isn’t a dependency property, nor does it implement INotiftyPropertyChanged so you can’t bind directly to it.  This is a problem.  In my application I want my users to create richly formatted documents which are added to a Notes collection on my entity and then have each note persisted as a string in my database.

I decided the best way to go would be to subclass the RichTextBox, and expose a DependencyProperty to handle the binding.  I’d then need some plumbing internally to keep things in sync.  Before I plunged headfirst into my own implementation, I spent a little time on Google to see how others have approached the problem.  I found many people hoping to do the same thing I was, but not any complete solutions.  I did find a MSDN forum post which had a code snippet that looked like a good place to start, and I also found some sample code for a WYSIWYG editor, so I cobbled the 2 together in my new WPFControls project and I was off and running.

Getting the Two-Way databinding working did turn out to be more of a chore than I’d hoped, but using the IValueConverter interface I was eventually able to bind a string property on a domain entity to the Document property on a RichTextBox.  I decided to wrap the implementation up in its own UserControl for reuse, so in the end my domain entity is bound to a string DP on the UC, and the Document property on the RichTextBox is bound to this same string property on the UC using IValueConverter.

To use the control in a project you first need to reference it in your project, and then in xaml you can reference it like this:

1: xmlns:WPFControls="clr-namespace:BlueTango.WPFControls;assembly=BlueTango.WPFControls"

and then to use it:

1:
2: SpellCheckIsEnabled="True"
3: AcceptsTab="True"
4: Document="{Binding ElementName=lstNotes, Path=SelectedItem.Description, Mode=TwoWay}" />

I added a couple of properties on the control itself to illustrate that it easy to still have control over the inner wrapped RTB.  You can see in my sample above I have it bound to a ListBox control which has a list of Notes.  The Description property is the string holding the xaml of the FlowDocument.

I have included a rough sample project you can use to create your own control for your projects.  Enjoy!

[download#1]

UPDATE:   A reader contributed this code a while back...

From Abbott Fleur and Dan Vanderboom: "I'm expanding your BindableRichTextBox control to allow linq-sql binding to db text source. I'm planning on using an existing routine I've written that loads the RTB based on the ip format and saves based on a SaveAs (DataFormats) property. "

While I have not tried this code myself - here it is.  Thanks Abbott and Dan!

[download id="2"]

While comments are welcome, please note that I am unable to offer help or support for using this update or the original code.  It is provided "as-is" without warranty or guarantees.

Dev East Halifax .NET UG Meeting Jan 5, 2010

What better way to kick off the new year than with an evening of MOSS? Rough schedule for the evening:
  • 6:00 pm to 6:30 pm :  Social mixer with pizza and pop
  • 6:30 pm to 6:45 pm :  Introductions
  • 6:45 pm to 8:00 pm :  Programming MOSS with Scott Rogers
  • 8:00 pm to 8:15 pm :  Prize giveaways and wrap up
To register please visit http://deveast.eventbrite.com. Programming MOSS with Scott Rogers This session will introduce MOSS and will focus on programming reusable components (web parts) to reside in MOSS.  It will introduce the SharePoint application programming interface (API) and will discuss deployment of components. Scott Rogers works for Cyberplex, a leader in providing web advertising solutions, online customer acquisition strategies and technology development. A software architect, he has over 13 years of experience covering a board range of technologies, including ASP, Java, .Net and most recently SharePoint. He has been working heavily with Microsoft Office SharePoint 2007 (MOSS) for the last several years.