DCSIMG
DEV - David Sackstein's Blog

Browse by Tags

All Tags » DEV (RSS)

Clean Code or Working Code? by David Sackstein

I was working on a legacy project with a friend and I sorely bemoaned the messiness of the code. Later, the friend sent me this link and warmly recommended I keep the balance in life. If you cant be bother to read the article, the short of it is that we developers should have more respect for legacy code that works. I acknowledge the underlying truth presented in the article, but I don’t think it gives the whole picture. Just because you can make catastrophic mistakes while disrespectfully accusing...

Visual Studio 2010 and Eclipse by David Sackstein

From time to time I do some work in C++ for Linux using Eclipse. Many developers say that Eclipse is the state of the art IDE for C++ development on Linux. From my experience, I can say that Eclipse simply pales in comparison with Visual Studio 2010 when it comes to an integrated, streamlined development experience out of the box. Rather than compare the pros and cons of both IDEs I would like to share with you a VS 2010 experience that I enjoy that is often taken for granted by Windows developers...

MVVM : Injecting INotifyPropertyChanged Into an Existing Class by David Sackstein

Download the source code for this post here . Using MVVM in Silverlight and WPF I often encounter the following problem. I have a business class that needs to be exposed through the ViewModel. For this, it needs to implement INotifyPropertyChanged or expose Dependency properties. I take the side of those who prefer to keep WPF dependencies out of the ViewModel, so I usually take the path of writing a proxy that delegates properties to the business object and implementing INotifyPropertyChanged. I...

How to Bind to the Index of a Collection in WPF by David Sackstein

Let's say you have a customer class and you are binding a DataGrid to a collection of customers. You would like the index of the customer in the collection to appear in the first column, like so: One way to do this might be to add an Index property to the Customer class and bind to that. I prefer not to go that way because it would pollute our business layer with presentation layer constraints. Solution Here is a different approach using a MultiBinding. You can download the source code for this...
תגים:, ,

Hierarchical Grid with WPF by David Sackstein

A TreeView handles hierarchical data well, and a DataGrid handles tabular data. But what about hierarchical tabular data? A simple example of such a source is a System.IO.DirectoryInfo. Each item can have zero or more children of the same type, enumerated by EnumerateDirectories. I would like to have it displayed like this: Solution You can download the source code for this solution here . The inspiration for this solution came from Delay's Blog by David Anson. I think David's idea of measuring...

Project Packager Add-In for Visual Studio 2010 by David Sackstein

This Add-In for Visual Studio 2010 will package up your solution (actually, any folder you choose) into a zip file excluding any files with extensions you specify and any folders whose names you specify.I cant upload msi files to this blog, so in order to install you will need to build the project. I packaged up the Add-In solution using the Add-In itself and uploaded it here . Download the solution, open with Visual Studio 2010 and Build All. Right click the setup project and select Install. Close...

John Bryce Lab Zone at Developer Academy 4 by David Sackstein

Today, John Bryce hosted a very successful Lab Zone at Developer Academy 4. This year's zone was larger than ever before with 40 computers installed with 11 labs on the latest and greatest Microsoft technologies! Over 1600 people attended the conference, and many of them came to the Lab Zone to get invaluable hands on experience with Windows Azure, SharePoint 2010, Windows 7, WCF 4, WPF 4 and Silverlight 4. For further study, I recommend you take a look at John Bryce's site for a list of...

Windows 7 and WPF 4 at Developer Academy 4 by David Sackstein

Today at Developer Academy I gave a demonstration session called Capture the Windows 7 User Experience with Windows Presentation Foundation 4. In the demo I showed how to integrate the following Windows 7 taskbar features into Windows applications using WPF 4: Specifying the area of the application visible in the Thumbnail Preview Controlling the Progress Bar overlay in the Task Bar Adding Taskbar Buttons to an application on the Task Bar Adding Icon Overlays Adding Jump List items to the context...

Top Tips for Rapid Application Development by David Sackstein

In recent weeks I have been busy on a number of projects with very tight, almost impossible schedules. When schedules are tight, there is simply not enough time to implement all the steps of a formal development procedure. But I have found that some good practices shine through as time savers every time. Not only do they save time, but they also help produce exensible, maintainable code – which also saves time in the long run. So here are my top tips for Rapid Application Development. Document the...
תגים:

Rendering Video with VMR9 on a Windows Form by David Sackstein

This week I taught a class on video and DirectShow and sat down to prepare some demos. In this demo I show how to use the Video Mixing Render 9 (VMR9) in Windowless mode to render video on the Form of a Windows Forms application. As in my posts on MSXML I found that the smart pointers of comdef.h and comip.h really helped to clean up the code. Why, programming the VMR9 in C++ can be as elegant as C# ! You can find the complete source code here . High Level Design For this demo I started with the...
תגים:, , , ,

Mapping MediaElement onto a Sphere with WPF by David Sackstein

In my previous post I created a 3D cube, mapped a MediaElement onto each of its faces and animated the camera around the cube. In this post, I will replace the 3D cube with a sphere and wrap the video onto the surface of the sphere. I omit the camera animation for simplicity, but you can add it back, of course. You can download the source code here . In order to create the sphere mesh I made use of Charles Petzold’s elegant SphereMeshGenerator. In Chapter 6 of his book (3D Programming for Windows...
תגים:, , , ,

A Custom Animation Class - Point3DAnimationUsingPath by David Sackstein

For 2D graphics WPF provides three classes for animating points: PointAnimation (for linear interpolation), PointAnimationUsingKeyFrames and PointAnimationUsingPath. For 3D graphics WPF provides only two: Point3DAnimation (for linear interpolation) and Point3DAnimationUsingKeyFrames. There is no built in class for animating points over a path in three dimensions. In this post I will show you a custom animation class that I wrote to partially fill that gap. In the next post I will put it to use in...
תגים:, , ,

Instrumentation Tip for ASMX Web Services by David Sackstein

This post describes a simple way to trace all method invocations on an ASMX Web Service. The source code for the demo can be downloaded here . Problem I am currently adding some features to a customer’s application that exposes its core functionality as an ASMX Web Service. About every mistake in the book was made in the design of this product, so I was having a rough time understanding the API of the service, never mind the implementation. For a start, the methods are not strongly typed, mostly...

WCF Transactions – Barebones Demo – Part 4 by David Sackstein

In this post we will run the demo developed in the previous posts in the series and analyze the results. The last sections contain conclusions and suggestions for further reading. The other posts in this series are: WCF Transactions – Barebones Demo – Overview WCF Transactions – Barebones Demo – Part 1 (Tools) WCF Transactions – Barebones Demo – Part 2 (Service Code) WCF Transactions – Barebones Demo – Part 3 (Client Code) You can download the source code for the series from here . Run the Demo ...
תגים:, ,

WCF Transactions – Barebones Demo – Overview by David Sackstein

In the next four posts, we will be building a barebones project to demonstrate WCF’s support for Transactions. The other posts in this series are: WCF Transactions – Barebones Demo – Part 1 (Tools) WCF Transactions – Barebones Demo – Part 2 (Service Code) WCF Transactions – Barebones Demo – Part 3 (Client Code) WCF Transactions – Barebones Demo – Part 4 (Analysis) You can download the source code for the series from here . The demo focuses on the usage of these properties: TransactionScopeRequired...
תגים:,
More Posts Next page »
Powered by Community Server (Commercial Edition), by Telligent Systems