Showing posts with label WPF. Show all posts
Showing posts with label WPF. Show all posts

Monday, April 21, 2014

Prism continues its Windows Desktop/WPF/MVVM Love with v5

Francis K. Cheung - Prism 5.0 for WPF just shipped.

Prism version 5.0 for WPF is now available. This version of Prism includes updates to existing and several new NuGet packages:

  1. Prism
  2. Prism.Composition (New)
  3. Prism.Interactivity (New)
  4. Prism.Mvvm (New)
  5. Prism.MefExtensions
  6. Prism.UnityExtensions

We’ve updated Prism 4.1 with bug fixes and a few new features. ...

Developer's Guide to Microsoft Prism Library 5.0 for WPF

April 2014

Prism provides guidance in the form of samples and documentation that help you easily design and build rich, flexible, and easily maintained Windows Presentation Foundation (WPF) desktop applications. Using design patterns that embody important architectural design principles, such as separation of concerns and loose coupling, Prism helps you to design and build applications using loosely coupled components that can evolve independently but which can be easily and seamlessly integrated into the overall application. In short, these applications are "built to last" and "built for change." These types of applications are known as composite applications.

This topic provides a brief overview of the Prism concepts with links to associated source code and documentation. If you are considering upgrading from Prism 4.1 to Prism 5.0 we include a "What’s New" and "Upgrading from Prism 4.1" topic that you should read.

...

...

image

What's New in Prism Library 5.0 for WPF

Prism 5.0 includes guidance in several new areas, resulting in new code in the Prism Library for WPF, new and updated QuickStarts, and updated documentation. Parts of the Prism Library changed between Prism 4.1 and Prism 5.0 to support the new guidance, fix existing issues, and respond to community requests.

...

New Guidance

Prism 5.0 contains several areas of new guidance as follows:

  • Prism.Mvvm is a portable class library that encapsulates Prism’s MVVM support. This library includes ViewModelLocationProvider. Views and view models can be wired up together using the new ViewModelLocationProvider’s convention-based approach as explained in Implementing the MVVM Pattern. View model construction can be accomplished using a dependency injection container. The ViewModel Locator’s extensibility points are discussed in Extending the Prism Library. DelegateCommands are now extendable and provide Async support. A new implementation of the INotifyPropertyChanged interface, the BindabaleBase class, was added.
  • The PopupWindowAction class was added to the Prism.Interactivity assembly to open a custom window in response to an interaction request being raised.
    The InvokeCommandAction action provided by Prism now passes trigger parameters to the associated command.
    For more information see Advanced MVVM Scenarios.
  • The EventAggregator classes have been moved to the Prism.PubSubEvents portable class library.
  • The NavigationParameters class can now be used to pass object parameters during navigation, using the overloads of the RequestNavigate method of a Region or RegionManager instance.

Changes in the Prism Library

Prism Library 5.0 includes changes related to new functionality, code organization, and APIs.

Code Organization

...

API Changes

...

Additions to the Prism Library Core API

The following namespaces were added to the Prism Library to support the new areas of guidance added in Prism 5.0:

  • Microsoft.Practices.Prism.PubSubEvents was added to help you send loosely coupled message using a portable class library.
  • Microsoft.Practices.Prism.Mvvm was added to assist you in implementing MVVM using a portable class library and several platform specific libraries.
  • Microsoft.Practices.Prism.SharedInterfaces has been added to share the IActiveAware interface between Prism and Prism.Mvvm assemblies, therefore the IActiveAware interface has been moved to this assembly. It is also intended for future use.

CodePlex Issues Resolved

  • ...

Example Code Changes

Prism 5.0 contains eleven separate code samples that demonstrate portions of the provided guidance. Several samples from Prism 4.1 were removed or replaced, and new samples added.

The following samples were added for Prism 5.0:

  • Basic MVVM QuickStart. This QuickStart shows a very simple MVVM application that uses the ViewModel Locator and show a parent and child ViewModels. For more information, see the MVVM QuickStart.
  • MVVM QuickStart. This QuickStart was removed for this version.
  • MVVM Reference Implementation. This reference implementation was removed for this version.
  • View-Switching Navigation QuickStart. This QuickStart now supports WPF. It demonstrates how to use the Prism region navigation API. For more information, see View-Switching Navigation QuickStart.
  • State-Based Navigation QuickStart. This QuickStart now supports WPF. It shows an approach that uses the Visual State Manager to define the views (states) and the allowed transitions. For more information, see State-Based Navigation QuickStart.
  • UI Composition QuickStart. This QuickStart now supports WPF. It replaced the View Injection QuickStart and the View Discovery QuickStart from Prism 2.0. In the current versions, both concepts are shown in one example application. For more information, see UI Composition QuickStart.
  • Interactivity QuickStart. This new QuickStart demonstrates how to exposes an interaction request to the view through the view model. The interactions can be a popup, confirmation, custom popup, and a more complex case where the popup needs a custom view model. It also shows Prism’s InvokeCommandAction action that passes the EventArgs from the trigger, as a command parameter. For more infromation, see Interactivity QuickStart.

NuGet Packages Now Available

In your application, you can now use NuGet to add references to the Prism assemblies. These packages include:

..."

Microsoft Downloads - Prism 5.0 for WPF – April 2014

Prism provides guidance designed to help you more easily design and build rich, flexible, and easy to maintain Windows Presentation Foundation (WPF) desktop applications.

...

MSDN Code Gallery - Getting Started Code Sample Using the Prism Library 5.0 for WPF

In this lab and associated sample, you will learn the basic concepts of modular application development using the Prism Library, and apply them to create a solution that you can use as the starting point for building a composite Windows Presentation Foundation (WPF) application. After completing this lab, you will be able to do the following:

  • You will create a new solution based on the Prism Library.
  • You will create and load a module.
  • You will create a view and show it in the shell window. 

This lab includes the following tasks:

...

MSDN Code Gallery - MVVM Code Sample using the Prism Library 5.0 for WPF

The Model-View-ViewModel (MVVM) QuickStart provides sample code that demonstrates how to separate the state and logic that support a view into a separate class named ViewModel using the Prism Library. The view model sits on top of the application data model to provide the state or data needed to support the view, insulating the view from needing to know about the full complexity of the application. The view model also encapsulates the interaction logic for the view that does not directly depend on the view elements themselves. This QuickStart provides a tutorial on implementing the MVVM pattern.

A common approach to designing the views and view models in an MVVM application is the first sketch out or storyboard for what a view looks like on the screen. Then you analyze that screen to identify what properties the view model needs to expose to support the view, without worrying about how that data will get into the view model. After you define what the view model needs to expose to the view and implement that, you can then dive into how to get the data into the view model. Often, this involves the view model calling to a service to retrieve the data, and sometimes data can be pushed into a view model from some other code such as an application controller.

This QuickStart leads you through the following steps:

  • Analyzing the view to decide what state is needed from a view model to support it
  • Defining the view model class with the minimum implementation to support the view
  • Defining the bindings in the view that point to view model properties
  • Attaching the view to the view model

..."

Finally:

That should be enough Prism for WPF to get you started at least...

Wednesday, January 29, 2014

Searchable WPF MVVM happy Treeview

CodeProject - Searchable WPF TreeView

In this article I will demonstrate a WPF way of how to create a tree view to which filtering can be applied as a way of searching for a particular node or item in the tree. Using filtering to prune or limit a tree view is something I find very useful and it really bugs me when I can't for example use it to quickly find the option I want to change in the Visual Studio Options. I usually know roughly what I am looking for and it's often faster to type a portion of that than to visually inspect the entire tree, the Window 7 start-menu or the Windows 8 UI are fine examples of this approach being put to good use.

This is obviously not a new problem nor is the internet lacking in example implementations, this article is based on something I did for a friend and I got several requests for the source code after posting it on YouTube so here it is.

Because the subject matter is fairly limited, this will be a relatively short article.

Using the code

Two archives are provided, one for C# and one for VB.NET, so that each can read the sources in the language of their choice.

For the article, since there is so little code involved I've decided to have both the C# and VB.NET code present.

Requirements

When my friend requested this to be implemented he gave me a short list of requirements that it needed to fulfill:

  • 1. It needs to be based on a System.Windows.Controls.TreeView.
  • 2. Tree view should, when not filtered, behave like a normal tree view.
  • 3. A text input field should accept input that prunes the tree view in real time (by real-time he meant there should be no need to hit Enter or something like that for the filtering to occur).
  • 4. The filter conditions should be remembered so that they could easily be re-used (personally, I think this is a bit superfluous as this type of control become really useful when the criterion one enters for the filtering are simple enough to be easily remembered).
  • 5. The text input field should not occupy too much screen real estate, whilst at the same time being obvious enough for a first time user to find and understand.

Further, the components of the implementation should lend themselves to MVVM approach as it's likely that the visual appearance would be changed by the UI designers.

...

image

I don't know about you, but WPF treeviews have been one of my WPF learning speed bumps. I'm starting to grok it now, but it's taken me a bit. And now I need a treeview that is not only searchable, but filterable too... Something just like this project! :)

And kudo's to the author for providing both C# and VB.

Friday, January 17, 2014

WAMS WPF QS (Window Azure Mobile Services Windows Presentation Foundation Quick Start]

Microsoft Developer Network - Samples - Azure Mobile Services Quickstart for WPF

One of the great features in my opinion of Azure Mobile Services is the “quickstart” app – a ready-to-use, fully-functional application which you can get from the portal in many of the supported platforms, and start running right away. I find it to be a great way to learn about the service and the client SDK for the selected platform.

In the portal one can download a QuickStart app for the most used platforms. But every once in a while someone asks about another platform which is not in the list. Since not all platforms will make its way to the portal (unless there is strong demand for that), I’ll try to answer that question, specifically about WPF, with this post.

Creating the QuickStart app for WPF isn’t too hard – after all, the NuGet package with the client SDK for Azure Mobile Services actually supports WPF apps as well (as long as they target the .NET Framework 4.5). It has most of the functionality as the more prominent platforms, with the notable exception of the lack of the UI-based login feature (which can be implemented as an extension, as I’ve shown in another post). So, without further ado, here are the steps I took to create the app.

If you just want to get the app, download from this sample and replace in the file App.xaml.cs the URL and key for your mobile service.

Create a new WPF project

...

At this point (after replacing the service name and key with the actual values) you should be able to build and run the app.

That's it. Those are the steps to convert the Windows Store QuickStart into a WPF one. But if you just want the code, feel free to download it from this sample.

image..."

It's easier for me, and most people I'm sure, to learn if I can focus on one area at a time. WAMS demo's are usually also mixed in with other tech, all that's pretty new for me. This quick start lets me focus on that one thing, learning WAMS, without distracting me with mobile or WinStore dev. Nice...

Make sure you check out the original blog about for this, Carlos Figueira MSDN blog - Azure Mobile Services QuickStart for WPF

Tuesday, January 14, 2014

What are Perforator and Visual Profiler? Free, that's what... Welcome to the WPF Performance Suite

Visual Studio Magazine - .Net Tips and Tricks - Free Tool: WPF Performance Suite

I like Windows Presentation Foundation (WPF) very much, especially its implementation of the Model-View-Controller (MVC) design pattern. I've also grown to appreciate XAML as a declarative (if quirky) way of building complex user interfaces that integrate with a testable code file. However, every once in a while, I end up with a WPF Window that takes a long time to render, or renders in a bizarre series of jumps. If that's happened to you, it's worthwhile to download Microsoft's WPF Performance Suite.

The suite includes two tools: Perforator and Visual Profiler. Neither will tell you what to do to fix your problem, but both will help you locate the problem.

Perforator concentrates on the low-level routines that render your XAML. The download page for the package includes some useful information ...

While Perforator looks at how WPF is rendering your XAML, Visual Profiler shows how individual ...

WPF Performance Suite

The Windows SDK includes a suite of performance profiling tools for Windows Presentation Foundation (WPF) applications called the WPF Performance Suite. The WPF Performance Suite enables you to analyze the run-time behavior of your WPF applications and determine performance optimizations that you can apply. The WPF Performance Suite includes performance profiling tools called Perforator and Visual Profiler. This topic describes how to install and use the Perforator and Visual Profiler tools in the WPF Performance Suite.

This topic contains the following sections:

image

...

Perforator

Perforator is a performance profiling tool for analyzing the rendering behavior of your WPF application. The Perforator user interface displays a set of graphs that enable you to analyze very specific rendering behavior in parts of your application, such as the dirty rectangle addition rate and the frame rate. WPF uses a rendering technique called dirty rectangle, which means that only the portions of the screen that have changed are rendered on a new rendering pass. In addition, Perforator has several options that you can use to look for specific rendering problems. Perforator also reports the software rendering targets and a slider to control the duration of the graphs. The following illustration shows the Perforator user interface.

Perforator user interface

image

...

Visual Profiler

Visual Profiler is a performance profiling tool of WPF services, such as layout, rendering, and animation, for elements in the visual tree. By analyzing the profiling output of this tool, you can determine which visual elements in your application may be causing performance bottlenecks.

Visual Profiler presents performance issues in the context of the basic building blocks that are used to construct visual scenes in your application. These building blocks include high-level objects, such as Button and TextBlock controls, as well as low-level objects, such as Line and Ellipse elements. Instead of describing performance issues in terms of call graphs of functions names, Visual Profiler describes these issues by using the representation of visual objects. This is similar to the way the Windows SDK tool, UI Spy, represents information. For more information, see UISpy.exe (UI Spy).

image

Some pretty cool utilities that I don't remember seeing before... I'm almost afraid (heck, no almost about it)  to run them on my WPF LOB app's... :/

Wednesday, December 18, 2013

Does using the Windows 8.x touch/onscreen keyboard in your WPF desktop sound cool to you?

Brian Lagunas - Showing the Windows 8 Touch keyboard in WPF

With the release of Windows 8, the era of touch devices is in full swing.  Manufacturers are scrambling to create mobile devices that can run Microsoft Windows with the touch of a finger, without the need for a keyboard and mouse.  Even Microsoft has released their very own Surface brand to satisfy this need to run Windows in a mobile world.  This is all fine and dandy if you are building Windows Store applications that run on any version of Windows 8, and are built with touch as a first class citizen.  Windows Store apps integrate perfectly with the device, such as automatically showing the Windows 8 touch keyboard when giving focus to an input element in the application.  Windows Store apps are smart enough to know when I am not using a mouse and keyboard, and I give focus to a TextBox by touching it, it will show the touch keyboard to allow me to input data.  On the other hand, if I am using a mouse and keyboard, and I give focus to the TextBox by clicking it with the mouse, the touch keyboard does not show, but rather I use the keyboard to enter my data.  This is a nice feature built into the platform.

...

image

...

This is a pretty cool way to leverage what you've got. If you're already running on Windows 8.x, you might as well use as much of it as you can, right? Brian's post does just that...

Tuesday, November 26, 2013

Creating Per-Monitor DPI-Aware Applications Code Sample

Microsoft Developer Network - Samples - Per-Monitor Aware WPF Sample

image

This sample demonstrates updating a Windows Presentation Foundation (WPF) application to be per-monitor DPI-aware.

The sample consists of two projects:

  • NativeHelpers.vcxproj The native helper project that implements the core functionality to make a WPF application per-monitor DPI-aware
  • WPFApplication.csproj A sample WPF application that inherits from the PerMonitorDPIWindow base class and showcases how the application window resizes when the user moves the window to another monitor with a different DPI or when the user changes the DPI by adjusting the Display slider in Control Panel.

...

In the coming year we're going to start seeing more and more of this, where our uses not only have multiple monitors but have them set at different DPI settings. This code sample will help you handle that gracefully in your LOB/WPF applications.

Thursday, October 24, 2013

Doughnuts! (Well, Infragistics XAML Doughnut Charts anyway)

Marina Stoyanova's Blog - How to build XAML Doughnut Chart

The Infragistics packages for WPF and Silverlight contain a lot of diverse charts for data visualization. The control that we are going to look at is The Doughnut Chart. This chart supports one or more rings surrounding a blank center. It can be customized by controlling the slices labels and colors or by configuring the inner radius. In this blog you can learn how to add this control to your application and how to create a custom hierarchical chart by using multiple rings.

image

...

image

image

..."

This is an Infragistics graph type that I've been wanting to use for a while... I just dig how compact the information density can be, without being overwhelming or ugly. That, and I just like doughnuts. :P

Doughnuts! (Well, Infragistics XAML Doughnut Charts anyway)

Marina Stoyanova's Blog - How to build XAML Doughnut Chart

The Infragistics packages for WPF and Silverlight contain a lot of diverse charts for data visualization. The control that we are going to look at is The Doughnut Chart. This chart supports one or more rings surrounding a blank center. It can be customized by controlling the slices labels and colors or by configuring the inner radius. In this blog you can learn how to add this control to your application and how to create a custom hierarchical chart by using multiple rings.

image

...

image

image

..."

This is an Infragistics graph type that I've been wanting to use for a while... I just dig how compact the information density can be, without being overwhelming or ugly. That, and I just like doughnuts. :P

Thursday, October 03, 2013

XAML Spy v2 Beta Visual Studio now available... (think "Spy++ for XAML as a VS Extension")

XAML Spy - XAML Spy for Visual Studio [beta]

First Floor Software is proud to announce the immediate availability of the first beta release of XAML Spy for Visual Studio. XAML Spy for Visual Studio enables spying on Silverlight, Windows Phone, Windows Store and WPF apps right in Visual Studio.

XAML Spy for Visual Studio is a VS2012 and 2013 extension for XAML projects. The extension is part of XAML Spy 2. You are only three steps away from happiness:

  1. Download and install XAML Spy 2 (beta). Start Visual Studio and load your XAML project.
  2. Right-mouse click your XAML project, select Enable XAML Spy, compile and run your app in DEBUG mode.
  3. Switch back to Visual Studio, open the XAML Spy Explorer (View > Other Windows > XAML Spy Explorer) and start inspecting your app.

Tip: hit Alt-Enter to open the Visual Studio property grid for details on the selected object in the XAML Spy Explorer.

Introduction

XAML Spy for Visual Studio adds a XAML Spy Explorer tool window to Visual Studio 2012 and 2013. The XAML Spy Explorer provides a real-time view of your running XAML app, with access to the app's package, isolated storage, user interface, and more.

image

...

XAML Spy 2

XAML Spy for Visual Studio is part of the next major release of XAML Spy (version 2). At this point in time, version 2 only consists of the Visual Studio extension. The standalone XAML Spy app (with its Modern UI interface) will be added in a future update. This beta release replaces any XAML Spy version 1 you may have installed. If your environment doesn't meet the requirements for XAML Spy for Visual Studio, or if you require features not available yet in this beta release, do not install this beta release. Learn more about the requirements and features in the next paragraphs.

XAML Spy for Visual Studio requires at least the Professional Edition of Visual Studio 2012 or 2013. The Express editions of Visual Studio are not supported.

...

Beta

Feel free to install and use this public beta to spy on your XAML apps. The release is fully functional, and does not require a license. This version will cease to function on October 15, 2013. Your feedback is highly appreciated, be sure to send us your comments and questions. XAML Spy 2 is available in the download section.

While the beta is only free for a couple days yet, that still a few days where you can play with it and check it out...

Monday, September 09, 2013

Get Blue! (No, not that Blue...) Get the free Office 2010 inspired Blue theme, free from Infragistics

Brian Lagunas - FREE Office 2010 Blue Theme for WPF and Silverlight Microsoft Controls

Shhhhh…. Do you hear that?????  That’s the sound of another great FREE theme!

Today’s theme is the highly requested Office 2010 Blue theme.  The Office 2010 Blue theme takes it’s visual cues from the Microsoft Office 2010 product suite.  This is probably the most popular theme among Windows developers.  Why?  Well ,let’s face it!  Most clients want all their apps to look like Outlook and Excel.  Don’t ask me why, they just do.  Maybe they just feel more comfortable with apps that have that Office feel to them.  Because of that, most LOB developers have to provide an “Office” type theme to make their end-users feel all warm and fuzzy inside.  Well, now you can!  I am giving you this awesome Office 2010 Blue theme for Free!

Now remember, there is a catch to this free theme.  I will NOT support every single Microsoft control.  Why?  Well, because I would prefer for you to use Infragistics controls instead.  For example, I will not be providing a style for the Microsoft DataGrid because Infragistics has a much better xamDataGrid control.  You get the idea.

Silverlight

First up is the Silverlight version of the Infragistics’ “Office 2010 Blue Theme”. ...

image

WPF

Next up is the WPF version of the Infragistics’ “Office 2010 Blue Theme”.  Just like the Silverlight version, we are providing you with styles for the primitive WPF controls that appear in the Visual Studio toolbox, as well as some controls in the WPF Toolkit.  Just like for the Silverlight version, we organized the themes by their respective source so that if you don’t use the WPF toolkit, there will be no need for your code to take a dependency on it....

 

Here is the full list of support controls:

  • Accordion
  • AutoCompleteBox
  • Button
  • CheckBox
  • ComboBox
  • Expander
  • GridSplitter
  • GroupBox
  • Label
  • ListBox
  • PasswordBox
  • ProgressBar
  • RadioButton
  • Rating
  • RepeatButton
  • Slider
  • TextBox
  • ToggleButton
  • Tooltip

image

Blue is coming back, as seems to be a theme that people like, so having a free version that supports many WPF controls, is nice...

 

Related Past Post XRef:
WPF/SilverLight IG Theme is now free from Infragistics
Brian (and Infragistics) is having a theme give-away... As in giving away some of their WPF and Silverlight themes

Friday, August 09, 2013

WPF/SilverLight IG Theme is now free from Infragistics

Brian Lagunas - FREE IG Theme for WPF and Silverlight Microsoft Controls

It’s that time again!  Time for another free WPF and Silverlight theme for the Microsoft controls.  The last free theme I gave away was the Metro Light and Dark Themes for WPF and Silverlight Microsoft controls.  Soon after I released that theme, there was an overwhelming positive response from the community.  So, I am fulfilling the promise I made in my last post.  I am releasing another free theme.

Today’s free theme is the standard Infragistics Theme, also referred to as the IG Theme.

Silverlight

First up is the Silverlight version of the Infragistics’ “IG Theme”.  We are providing a style for each primitive control that appears in the Visual Studio toolbox, the controls that ship with the Silverlight SDK, and of course some controls from the Silverlight Toolkit.  As you can see, we organized the themes by their respective source so that you have the option to use which ever control you need and not add any unnecessary dependencies on other assemblies.  Here is the list of resource dictionaries you are getting.

...

WPF

Next up is the WPF version of the Infragistics’ “IG Theme”.  Just like the Silverlight version, we are providing you with styles for the primitive WPF controls that appear in the Visual Studio toolbox, as well as some controls in the WPF Toolkit.  Just like for the Silverlight version, we organized the themes by their respective source so that if you don’t use the WPF toolkit, there will be no need for your code to take a dependency on it.

Here is the full list of support controls:

  • Accordion
  • AutoCompleteBox
  • Button
  • CheckBox
  • ComboBox
  • Expander
  • GridSplitter
  • GroupBox
  • Label
  • ListBox
  • PasswordBox
  • ProgressBar
  • RadioButton
  • Rating
  • RepeatButton
  • Slider
  • TextBox
  • ToggleButton
  • Tooltip

image

Kudo's again to Infragistics and Brian for releasing this theme for free...

 

Related Past Post XRef:
Brian (and Infragistics) is having a theme give-away... As in giving away some of their WPF and Silverlight themes

Wednesday, August 07, 2013

Brian brings some Unity to using Prism and dynamically discovering and loading Modules at runtime

brian lagunas - Prism: Dynamically Discover and Load Modules at Runtime

If you develop WPF applications with Prism, then you are probably already aware of the many ways in which you can load a module.  Loading a module starts with what is called a ModuleCatalog.  You can’t load a module unless it has been added to a ModuleCatalog.  Once the module has been added to a ModuleCatalog, Prism will then take care of loading the module assembly for you.  Prism even comes with a handful of module catalogs to give you flexibility in how you register your modules with your Prism application.  You can populate a module catalog from code, from XAML, with XML in an app.config, or from a directory.  Heck, you can even use a combination of all these options to populate your module catalog.

When I am giving a Prism talk at a public event or an internal lunch and learn at a company, I am sure to explain all the different ways of loading your modules and which catalog to use.  This is about the time where the questions really start getting interesting.  Of these questions, the most common is about the DirectoryModuleCatalog.  This particular catalog allows you to specify a folder path to load your modules from.  Now the interesting question… “but, what happens when a new module assembly is dropped into the folder?  Will it automatically be loaded into the app while it is running?”  That is a great question, and the answer is NO.  The DirectoryModuleCatalog does a one time scan of the directory and then loads all the modules that it finds.  If you drop a new module assembly into the directory, it will not be loaded until the application is restarted.  Now the follow-up question… “well, is it possible to dynamically discover the modules and load them from the directory as well?”  Answer; well of course it is.  If you’re using MEF, it’s easy.  If you’re using a container such as Unity, you will need to write the code to handle it yourself.  “Well, we don’t use MEF, so can you show us how?”  This is where my reply is always the same, “a simple web search (Google or Bing) should help you find what you are looking for”.

Well, it turns out, that’s not the case.  It seems that no one has blogged about or shared any code that handles the dynamic discovery and loading of modules using a DI container such as Unity.  Not that I could find, nor anyone who is asking me to show them could find.  Which leads me to this post.  I am going to show you an approach that I have used to support such a scenario.  I am actually going to give you two approaches.  One is the “Quick and Dirty” way.  Basically, I will throw together the simplest sample to achieve the goal.  Then I will show you “A Better Way” in which we will encapsulate this functionality into a custom ModuleCatalog that will handle everything for us.

...

My name is Greg and I pretend to write LOB Prism apps...

Well I am in the middle of using Prism & Unity to build a LOB app I and I ran into exactly what Brian is blogging about. I wanted to do a runtime discovery of modules and just couldn't figure out how to do it quickly enough, so gave up and just did it the hard way. Now that Brian has shown the way, I'm going to have to revisit that... :)

Friday, August 02, 2013

FEZ Game-O Emulator - Community Edition

Project Update #3: FEZ Game-O Emulator - Community Edition

We are proud to announce the release of FEZ Game-O Emulator - Community Edition.  Please feel to download the latest version at https://www.ghielectronics.com/community/codeshare/entry/776.  Community members have already been using the emulator to create and share gaming examples! Visit the FEZ Game-O code base at https://www.ghielectronics.com/community/codeshare and search for "Game-O".

The FEZ Game-O Team

* Note - The emulator does not support sound or the features of the accelerometer.

GHI Electronics - Game-O Emulator Community Edition

This is a community edition of the emulator for Fez Game-O console. It is WPF based application. To exit the emulator press "Power" button. To change the color of the emulator press one of the colored button at the bottom of the screen.

Enjoy!

Initial submit: Source code only. The installation project is in progress and will be added later.

image

image

...

I think I just found my weekend project... :)

 

Related Past Post XRef:
Full O'Fun with the "FEZ Game-O", an open-source .Net Micro Framework console

Monday, June 24, 2013

Need some help up the WPF learning curve? "WPF Succinctly" from Syncfusion is now available (and free :)

Syncfusion - WPF Succinctly

WPF Succinctly is for software developers with an understanding of the .NET Framework who have yet to dive into WPF. Author Buddy James approaches the platform at its simplest point—single-window applications that contain a single control—and gradually adds more complex controls and back-end features. By the end of the book, you'll be able to manage data flow between application elements, use WPF commands to maximize your application's functionality while adding minimal code, and confidently redesign controls to give your application a unique look and feel that other applications can't compete with.

Table of Contents

  1. WPF Origins
  2. Inside WPF
  3. WPF Controls Overview
  4. WPF Applications
  5. WPF and MVVM
  6. WPF Commands
  7. Advanced WPF Concepts
  8. WPF Control Styles and Templates
  9. WPF Tools and Frameworks

Most of you won't need this, but maybe you have a "friend" who does... :P

 

Here's some snaps of the PDF:

imageimage

 

Related Past Post XRef:
TypeScript Succinctly - Free [Name/email-ware] eBook
Getting sharp with F# with the free "F# Succinctly" eBook [reg-ware]
Syncfusion helps shed a little succinct light on LightSwitch with "LightSwitch Succinctly" (Reg-ware)
"JavaScript Succinctly" - Another free (reg-ware) eBook from Syncfusion
Get into sync with HTTP with the new free (reg-ware) Syncfusion Succinctly eBook, "HTTP Succinctly"
Spelunk the technical details of the PDF format with "PDF Succinctly" from Syncfusion (Free/reg-ware PDF/Mobi ebook)
"Git Succinctly" Free/reg-ware PDF/Mobi ebook)
jQuery Succinctly - Free eBook (reg-ware, PDF and/or Mobi)

Friday, June 14, 2013

WPF TextBlock vs Label, what's the diff?

2,000 Things You Should Know About WPF - #842 – The Differences Between Label and TextBlock

You can use either Label or TextBlock elements to display text in an application.

image
The two elements appear to behave similarly, but there are a few differences:

  • A Label...
  • A TextBlock....

image

I love Sean's 2,000 Things You Should Know About WPF posts. "WPF? Isn't that dead?" No, not even. Mature, maybe, but hell so am I and I'm not dead (well, at least I like to think so... ;)

Anyway... I was asked this the other day and I gave a pretty lame answer. Now I can actually sound like I know something! I know, imagine that!

 

Related Past Post XRef:
A Feed You Should Read #34 - 2,000 Things You Should Know About WPF

Friday, May 31, 2013

Brian (and Infragistics) is having a theme give-away... As in giving away some of their WPF and Silverlight themes

Brian Lagunas - FREE Metro Light and Dark Themes for WPF and Silverlight Microsoft Controls

The quest for a good application theme never ends.  You spend hours scouring the realms of Google and Bing looking for a clean, modern, and touch friendly theme to use in your application.  That is, until now!  If you have been looking for a free Metro theme for WPF and Silverlight, then look no further.

Infragistics ships a number of great themes with their NetAdvantage for WPF and Silverlight products.  As the Product Manager for these controls, I started asking myself, “Why should we keep these great themes to ourselves?”.  If you know me, you know I am a hard core XAML developer and I am all about community.  Heck, I single handedly wrote the most popular Extended WPF toolkit in the world, and I provided it to everyone for free.  So starting today, I am excited to announce that I am going to be giving away, all of our themes for the standard WPF and Silverlight Microsoft controls.  Yes, I said GIVING AWAY, as in FREE.

There is a catch though.  We will NOT support every single Microsoft control.  Why?  Well, because we would prefer for you to use our controls instead.  For example, we will not be providing a style for the Microsoft DataGrid because we have a much better xamDataGrid control.  You get the idea.  Also,  I am not going to give them to you all at once.  I am going to release them a one at a time.  Why?  Well, I want to see what kind of response I get from the community.  If I get zero response or support from the community, then there is no need to keep releasing themes.  I don’t want to waste my time, or the developers who create these themes time.  On the other hand, if the community gives me an overwhelming show of support, then I will be releasing more themes.  Seems fair, wouldn’t you agree?

Today’s free theme is a clean, modern, touch friendly theme in the form of the Infragistics’ Metro Theme.  You will be getting both a Light and Dark version. ...

...

Silverlight

You can see the full list of supported controls in the list below.

  • Accordion
  • AutoCompleteBox
  • BusyIndicator
  • Button
  • CheckBox
  • ComboBox
  • Expander
  • GridSplitter
  • Label
  • ListBox
  • PasswordBox
  • ProgressBar
  • RadioButton
  • Rating
  • RepeatButton
  • Slider
  • TabControl
  • TextBox
  • ToggleButton
  • Tooltip

...

WPF

Next up is the WPF version of the Infragistics’ Metro Theme.  Just like the Silverlight version, we are providing you with styles for the primitive WPF controls that appear in the Visual Studio toolbox, as well as some controls in the WPF Toolkit.  Just like for the Silverlight version, we organized the themes by their respective source so that if you don’t use the WPF toolkit, there will be no need for your code to take a dependency on it..

Here is the full list of support controls:

  • Accordion
  • AutoCompleteBox
  • Button
  • CheckBox
  • ComboBox
  • Expander
  • GridSplitter
  • GroupBox
  • Label
  • ListBox
  • PasswordBox
  • ProgressBar
  • RadioButton
  • Rating
  • RepeatButton
  • Slider
  • TextBox
  • ToggleButton
  • Tooltip

...

image

..."

This made me chuckle, "There is a catch though.  We will NOT support every single Microsoft control.  Why?  Well, because we would prefer for you to use our controls instead..." GOT to love that kind of clear and honest answer. Will that me everyone happy? No, it's the internet. I'm sure someone will whine... But hey, what do you want for free, your money back?

I applaud them for looking at their stuff and saying, "you know, this isn't directly revenue generating and we could do something nice for the community by giving some of our theme's away." Or they could have been thinking, "OMG the WPF app's I'm seeing are pretty darn fugly. Maybe if we gave our themes away..." Or more likely, "Brian, will you shut the heck up and stop bugging us about 'community' if we give something away? Like maybe our themes?"

Anyway, no matter what they were thinking, I'm glad they are doing it.

Finally I also like that it's a a little WPF and Silverlight love... :)

Tuesday, May 21, 2013

Extended WPF Toolkit gets all v2.0 and now includes AvalonDock too!

Extended WPF Toolkit  - Extended WPF Toolkit - 2.0.0

What's new in the 2.0.0 Community Edition?

Improvements and bug fixes
  • Another 67 improvements were made for v2.0.0 Community Edition, including some new controls, almost as many as last releases' record-breaking 70. See the complete list of improvements in v2.0.0.
  • New! Live Explorer app available online as a Click Once app. Try it now!

...

v2.0.0 Community Edition improvements and bug fixes

67 new improvements
Notable new features

  • Our flexible docking window control, AvalonDock, is now part of the toolkit. Provides a system that allows developers to create customizable layouts using a dock system similar to what is found in many popular integrated development environments (IDEs). Aero, Metro, and VS2010 themes are provided for the control, in addition to the Office 2007 themes.
  • WindowContainer has been added. This container can contain more than one ChildWindow at the same time.
  • ChildWindow has several new properties that allow the window chrome to be styled. It also derives from the newly added WindowControl, which has various advantages over the old version.
  • The MessageBox class also has several new properties that allow its chrome to be styled; furthermore, it can now be displayed in XBAP application when displayed in a WindowContainer. It also now derives from WindowControl.
  • A Windows 8 theme is now supported by all of the controls in the toolkit.
  • New 'Live Explorer' application with source code demonstrates all the features. See an online version here.


Minor features and Issues resolved

...

image..."

There are some awesome controls in this toolkit. What kinds of controls? Here's the list...

Extended WPF Toolkit™ Community Edition (Doc's)

Controls

  • AutoSelectTextBox
  • BusyIndicator
  • ButtonSpinner
  • Calculator
  • CalculatorUpDown
  • CheckComboBox
  • CheckListBox
  • ChildWindow
  • CollectionEditor
  • CollectionControlDialog
  • ColorCanvas
  • ColorPicker
  • DataGrid
  • DateTimePicker
  • DateTimeUpDown
  • DropDownButton
  • Magnifier
  • MaskedTextBox
  • MessageBox
  • MultiLineTextEditor
  • NumericUpDown - OBSOLETE! Use the NumericUpDown-derived controls (see next)
  • NumericUpDown-derived controls (for decimal, double, byte, integer, long, short, and single types)
  • Panel controls (SwitchPanel control provides an animated, switchable environment for children and panels)
  • PrimitiveTypeCollectionEditor
  • PropertyGrid
  • RichTextBox
  • RichTextBoxFormatBar
  • SplitButton
  • TimelinePanel
  • TimePicker
  • WatermarkTextBox
  • Wizard
  • Zoombox

And the price? Free! :)

 

Related Past Post XRef:
Take two [AvalonDock 2.0 Tutorials] and call...
THE open source WinForm & WPF docking library gets overhauled and a new version two, AvalonDock v2's!

Monday, May 06, 2013

Sometimes you just need a donut [chart]... Free ModernUI Charts for WPF, Windows Store Apps (and SilverLight too)

SharePoint Software Quality, .NET and ModernUI apps - Free ModernUI Charts for WPF, Windows Store Apps und Silverlight published

Some days ago I have published a free library with chart controls which can be used in client applications. The library can be used in WPF desktop applications, in Windows Store apps and in Silverlight applications.

Download the binaries, source code and some test applications: http://modernuicharts.codeplex.com/

Or directly try them in the Silverlight application: http://www.spalmblogger.de/charts/

image

...

Modern UI (Metro) Charts for Windows 8, WPF, Silverlight

This project provides a small library to display charts in Modern UI Style (formerly known as Metro) in WPF, Silverlight and Windows 8 applications. You can check the charts with the Silverlight test application here: http://www.tetracon.de/charts

Available Charts

  • ColumnChart (ClusteredColumnChart, StackedColumnChart, StackedColumnChart100Percent)
  • PieChart (PieChart and Dognut)
  • BarChart (ClusteredBarChart, StackedBarChart, StackedBarChart100Percent)
  • Doughnut Chart
  • Radial Gauge Chart

News

  • 2013-05-05: Release of BETA version with several bug fixes and new charts (Doughnut, Radial Gauge, improved test applications and many more)
  • 2013-05-04: Availability of Silverlight test application via http://www.tetracon.de/charts

Screenshots

Default Layout

image

I love that the source for these are available. Also that they are cross XAML platform...

Tuesday, April 09, 2013

"The Last Visibility Converter" (you'll ever need)

Compiled Experience - The last Visibility Converter

The Boolean to Visibility Converter is as close you’re going to get to bread and button in the xaml frameworks. You need it in almost every app and almost every framework has one, even the Windows 8 project templates come with one.

The trouble is that a lot of these implementations are na├»ve and simplistic, and soon enough you’ll be writing “Inverse Boolean to Visibility Converter”, “Int32 to Visibility Converter” etc. Ultimately these all exhibit very similar behavior, convert the default value (false, 0, null etc.) to Collapsed and anything else to Visible or do the same but inversed. Having over a dozen converters for all the implementations becomes a pain to manage and awkward.

So let’s build the last Visibility Converter you’ll need, we’ve already defined what the behavior should be, “Convert the default value to Collapsed and everything else to Visible”. ...

image

..."

Until we get one as part of the Framework (which I kind of doubt will happen) I'm going to let him do the work and let Nigel do the work for my last Visibility Converter... (Good developers code, Great developers... ;)

Friday, April 05, 2013

WPF is to PowerShell as the PowerShell ISE is to Extensibility (Think "Extending the PowerShell ISE is as easy as 1, 2, DLL...")

Precision Computing - Creating Add-ons, Plugins, and Tools for the PowerShell ISE

We frequently get questions asking if the PowerShell ISE supports a feature that it doesn’t. For example, variable watch windows, function browsers, or “find all matches in the current document”.

Or as another example, many of you are very familiar with Visual Studio and naturally wish for Visual Studio feature <x>. That <x> is usually different for each person :) The Visual Studio team is many times larger than the PowerShell team, and they’ve had a 15-year head start.

When preparing for PowerShell V3, we realized that the appetite for new functionality in the ISE would far outstrip our ability to create it, so we designed one of the most (until now) un-heralded features in the PowerShell ISE: the ability to create custom tool windows:

image

See the “Find All” pane on the right-hand side? That didn’t come with the ISE.

Creating a PowerShell ISE Add-In / Plugin is very straight-forward. Jason gives a great overview in his blog: http://blog.codeassassin.com/2012/01/16/create-a-powershell-v3-ise-add-on-tool/.

The design center of ISE plugins are that they are really just WPF UserControls. In addition, they implement the IAddOnToolHostObject interface.

...

After that, the control is all yours.

You have full access to WPF, XAML, C#, and anything else you can imagine or would expect from a WPF control. For example, here is the simplistic XAML used to create the control in the ‘Find All’ window shown above:

...

All-in-all, a very easy development experience.

Once you’ve compiled a DLL, adding it to the ISE is as easy as:

..."

I though this post a great example of how easy it can be to extend the PowerShell ISE. I love seeing tools being extensible like this...