first_page

WPF Lanky Links…

We’re almost there! There’s the feeling that a big change is coming! The Mayan world came to an end centuries ago so let’s get each apocalypse in order! According to a recent episode of The Business, “DVD’s are dying”—this means that, after the “big boys” copy what Netflix.com has been doing for years, the video-on-demand player market is going to “trickle down” to the masses. The rest of us will expect a rich, DVD-like interface in “the cloud”—this is why getting into technologies, like WPF (translated by me into Silverlight and Flex), is so damn relevant to little sites like kintespace.com.

So my WPF research yielded a bunch of links (in order of appearance since 11/11):

“[WPF Grid vs Stackpanel](http://stackoverflow.com/questions/452045/wpf-grid-vs-stackpanel)” “You should use a Grid if you need things to line up horizontally and vertically. Use a StackPanel to create a row or column of things when those things don’t need to line up with anything else.”
“[MVVM (ICommand) in Silverlight](http://stackoverflow.com/questions/1254879/mvvm-icommand-in-silverlight)” “There is no support for commands in Silverlight. When the user manipulates controls in your view you will have to write code (e.g. event handlers) that modifies the view-model in the code-behind for your view.”
“[Microsoft België & Luxemburg… Styles and triggers in WPF](http://www.microsoft.com/belux/msdn/nl/community/columns/gillcleeren/wpf_stylesandtriggers.mspx)” “Triggers allow us to define several Setter elements in a style. But, contrary to the previous situation, not all these Setter elements will be applied to the controls using the particular style. The trigger includes a condition, and when that condition is true, the Setters defined in the trigger will be applied. When the condition is false, the Setters are ignored.”
“[WPF ControlTemplate vs UserControl](http://stackoverflow.com/questions/1131106/wpf-controltemplate-vs-usercontrol)” “A special case here is if you use the MVVM pattern. MVVM works best by using UserControls as Views, and ControlTemplates and Styles are resources used by those views. MVVM practice also minimizes the need for a custom Control, and has many other benefits.”
“[Building WPF Applications with the Page Navigation framework (It’s just like ASP.NET but with state...)](http://weblogs.asp.net/plip/archive/2007/11/11/building-wpf-applications-with-the-page-navigation-framework-it-s-just-like-asp-net-but-with-state.aspx)” “If you’re an ASP.NET developer like myself, then you’re familiar with the concept of pages and links and the general way in which navigation works. In turn, it’s possible you know nothing about the way in which Windows (of the XAML variety) work, how to move from one to the next and generally make an application look and feel seamless. That’s the position I approached this from.”
“[ICommand for Silverlight with Attached Behaviors](http://blogs.southworks.net/jdominguez/2008/08/icommand-for-silverlight-with-attached-behaviors/)” Reading this may not be needed because Silverlight 3 might have full `ICommand` support.
“[What is the difference between CollectionView and CollectionViewSource?](http://www.beacosta.com/blog/?m=200611)” “The short answer is that `CollectionView` is a view and `CollectionViewSource` is not.” This subject is important because MVVM Observable Collections have a relationship with `IC``ollectionView` and `CollectionViewSource`.
“[How to apply multiple styles in WPF](http://stackoverflow.com/questions/16096/how-to-apply-multiple-styles-in-wpf)” “That is, for any particular element only one Style can be applied. …However, as others have stated above, maybe you can use `BasedOn` to help you out.”
“[WPF Multithreading: Using the BackgroundWorker and Reporting the Progress to the UI.](http://elegantcode.com/2009/07/03/wpf-multithreading-using-the-backgroundworker-and-reporting-the-progress-to-the-ui/)” “At times, you may want to change the user interface from a worker thread. For example, you may want to enable or disable buttons, or show a modal `ProgressBar` that provides more detailed progress information than is allowed by the `ReportProgress` method. The WPF threading model provides the Dispatcher class for cross thread calls. By using the Dispatcher, you can safely update your user interface from background worker threads.”
“[WPF tip : Using a custom title bar](http://blog.voidnish.com/?p=156)”—also: “[C# WPF Custom Title Bar Tutorial](http://www.dreamincode.net/forums/showtopic121576.htm),” “[Custom Window Control](http://pavanpodila.spaces.live.com/blog/cns!9C9E888164859398!345.entry)” “While you can always custom paint the windows title bar, in most cases it ends up being a very messy approach with possible side effects. What I do in WPF is to disable the title bar in the window by setting its `WindowStyle` to none.”

For a few precious hours, it seemed a high-priority design goal to take control of the look of the OS window. Now it seems too intrusive—it breaks away from any UI themes set by the user.

“[Which came first, the View or the Model?](http://wildermuth.com/2009/05/22/Which%5Fcame%5Ffirst%5Fthe%5FView%5For%5Fthe%5FModel)” “In my design, I want the View and the ViewModel to be ignorant of each other so that I could mock either side of the equation without impacting the other. In practice, mocking the View-Model is common, but mocking (and testing) the View is not common at all. But by not tying them tightly, it does allow us to move to a one View-Model to multiple Views without any real pain.”
“[Windows User Experience Interaction Guidelines](http://msdn.microsoft.com/en-us/library/aa511258.aspx)” “The goals for these official Windows User Experience Interaction Guidelines (or ‘UX Guide’ for short) are to:

Establish a high quality and consistency baseline for all Windows-based applications.

Answer your specific user experience questions.

Make your job easier!”

“[Optimizing Performance in WPF Applications](http://www.codedigest.com/Articles/VisualStudio/228_Optimizing_Performance_in_WPF_Applications.aspx)” “The **TextBlock** element should be used when limited text support is required, such as a brief sentence in a user interface (UI). Label can be used when minimal text support is required. The FlowDocument element is a container for re-flowable documents that support rich presentation of content, and therefore, has a greater performance impact than using the **TextBlock** or **Label** controls. ….Avoid using **TextBlock** in **FlowDocument**. When possible, use **Run**(derived from **TextElement**) rather than **TextBlock**(derived from **UIElement**) for displaying text content in a **FlowDocument**.”
“[Grid Size Sharing in WPF](http://blogs.interknowlogy.com/johnbowen/archive/2007/08/27/21132.aspx)” “…but a fixed width, non-resizable table isn’t going to be something that’s used very often. Making the columns resizable would make a lot more sense. So what happens when GridSplitters get added into this setup?” This question is a bit advanced for me at the moment. “To get all of these different Grids to stay synchronized, WPF includes size sharing functionality, accessed through the `Grid.IsSharedSizeScope` attached property and the `SharedSizeGroup` property available on `ColumnDefinition` and `RowDefinition`.”
“[WPF Basics—Layout Panels](http://www.wpfdude.com/articles/LayoutPanels.aspx)” “In order to arrange controls, you need to use a layout panel. WPF ships with the following layout panels:

Canvas—for specific (X,Y) positioning

StackPanel—for stacking elements horizontally or vertically

WrapPanel—automatically handles wrapping elements to a new row as needed

DockPanel—for familiar docking functionality

Grid—for a row and column based layout

UniformGrid—a specialized form of Grid where all cells are the same size”

“[UI Scaling (UI Zooming) with WPF](http://blogs.msdn.com/ivo_manolov/archive/2007/10/05/ui-scaling-ui-zooming-with-wpf.aspx)” I assume (maybe erroneously) that this technique can be used for window resizing behavior. By default, window resizing has a “cropping” behavior—so scaling the entire interface *might* be a more desirable user experience.
“[How to perform WPF Data Binding using LINQ to XML](http://www.codedigest.com/Articles/WPF/238_How_to_perform_WPF_Data_Binding_using_LINQ_to_XML_-_Part_2.aspx)” This technique is based on `ObjectDataProvider` and I position this as an alternative to `XmlDataProvider`—but I’m not quite sure when one may be better than the other (especially in view of performance issues).
“[Download free WPF ribbon control (Windows Scenic and Office 2007 style, too)](http://www.uxpassion.com/2008/11/download-free-wpf-ribbon-windows-scenic-office-2007-style/)” We have to get a royalty-free license from Microsoft for this one.
“[A Decent WPF StatusBar Example](http://www.smartypantscoding.com/content/decent-wpf-statusbar-example)” “It is pretty easy to create a `StatusBar`, it’s just as you might imagine it would be in XAML…”

rasx()