Color Gradient Generator

November 12, 2013

A while back, I created a WPF Mandelbrot Set program with zoom abilities. I demonstrated the use of async/await for writing code that works asynchronously (to keep the UI responsive), but is easy to write as synchronous code. Here’s a sample image:The image is grayscale, so I wanted to make it use colors, to indicate the level of “being part of” the Mandelbrot set. The problem here is how to create a nice color gradient that moves smoothly from color to color.One possible option might be to leverage an existing class, such as WPF’s LinearGradientBrush, set up a bunch...

MVVM View vs. Control

November 3, 2013

In the MVVM world, Views are attached to ViewModels. How can a view be implemented? Typical answers for say, WPF, are: Window, User Control and Data Template. Similar answers exist for Windows Phone and Windows 8, where “Window” may be dropped or replaced by Page.This is certainly true, but about that User Control? Can any user control automatically be considered a View? Not quite.The distinction between view and control (user control or otherwise) is based on reusability and dependency. A View requires a ViewModel to give it context. A View cannot function without a ViewModel. Typical XAML View would...
no comments