10/7/2014 - I've successfully used this library to build a couple small WPF tools. The only thing I found missing so far is a native FileDialog built in WPF-CPS. Therefore, I may build one in the Contrib project.
"If WPF via XAML and MVVM is heavyweight like EntityFramework is; then, maybe, WPF-CPS is like the LINQ-to-SQL of WPF Development? Nimble and lightweight, even if limited!" --AnonymousWPF Composites (WPF-CPS) may enable a Rapid-Application-Development (RAD) approach to building Fluent WPF desktop applications and/or Windows Store Desktop Apps for Windows 8*?
Windows Desktop Apps may likely continue to be superior for
synchronous, enterprise and content creation apps. In counterpoint, touch-first, Modern UI WinRT apps may best serve the arena of asynchronous, individual consumer and content consumption apps. There may, indeed, be a place for Desktop apps ongoing after all?
WPF-CPS provides an alternative, concise, C# (or IronPython or F#) code-behind approach to managing WPF UI Framework Element composites. WPF Composites are normally managed via XAML and DataTemplates but this library uses
ID's and X-Y Coordinates instead to position elements on the screen. This is currently for synchronous apps only. It is not designed to be thread-safe. I welcome volunteers!
It works via
100% code-behind, zero XAML, has CSS-like Selectors, has Generators to generate multiple Framework Elements based on a single Prototype Element's properties (e.g. create a button and automatically clone it 5 times), and supports 26 different WPF controls. Just added sorting to the panels too to allow sorting Grid, StackPanel, DockPanel, WrapPanel, TreeView, and DataGrid.
It contains four child namespaces: Observables, Selectors, Generators, and Dialogs.
These all reside within the comprehensive FasterWPF parent namespace.
* I haven't actually submitted a desktop app to the Windows Store using WPF Composites. I can't vouch for whether an app created with this library would readily pass or fail the stringent Windows App Certification Requirements. I am not liable for any success or failure in attempting to get your app certified. Certification details:http://msdn.microsoft.com/en-us/library/windows/desktop/hh749939.aspxAddress Book Demo - Desktop ApplicationBelow is a screenshot of a
full-featured demo desktop application that I wrote in F# leveraging WPF-CPS:

Feel free to try out this demo application (at your own risk, of course) here:
Address Book DemoAddress Book Demo Source CodeWPF Composites ContribI recently added a supporting project to WPF Composites (WPF-CPS) to allow exploring/building out new controls and techniques which leverage this existing code library.
https://wpfcompositescontrib.codeplex.com/The first contribution is an experimental
Squares Navigator, a kind of data visualization control similar to paging. Each square represents
1/400th of a very large dataset. In this example, I leverage a dataset of around
39,000 mutual fund records provided by the SEC for free at data.gov here:
http://catalog.data.gov/dataset/investment-company-series-and-class-information
The second contribution is a rudimentary
Paging Control for a DataGrid. I recently added
Page Recycling to this example so that the Paging Control can now likely handle a few hundred records per page with relative ease. Therefore, a total dataset of 3500 records would likely be quite manageable.
LINKSDemosC#
Demo App Screenshots, also
Hello WorldIron Python Example F Sharp ExampleTutorials and DetailsEasy as 1-2-3-4-5How-To ExamplesDictionariesEventsCPSBaseWindowImplementing IParentImplementing ICompositeSortingGroup DescriptionsCascading ListBoxVisual State ManagerWPF Databinding, INotifyPropertyChanged, and Dependency PropertiesGeometriesAttached PropertiesAnimationsPrint HelperImage FlipperAeroThe Four NamespacesRx ObservablesSelectorsDialogsGenerators (Prototypes)CommentaryPros and ConsTo-Do ListStatus UpdateWINRT NotePort to SilverlightModel-View-PresenterMemory ProfileRecognitionCaveatsKnown IssuesBEGIN COMPOSITE . . . END COMPOSITEBelow is an example for creating a new composite, adding a new Rectangle to the composite, followed by adding two Textblocks underneath the Rectangle (all in column 0 if using a Grid Composite):
myDockPanel.BeginComposite(myGuid)
.AddAnything<Rectangle, DockPanel>(0,0)
.AddText(1,0, "Hello World 1")
.AddText(2,0, "This is text at Row 2 Column 0 in the composite")
.EndComposite(new DockArgs(Dock.Left));
- The entire composite is then added to myDockPanel at Dock.Left.- myDockPanel is an IParent.- IComposites are added to IParent controls.- IComposites are containers for Child elements.Typically, objects retrieved from or saved to a SQL database will have a record ID associated with them, either a GUID or a basic IDENTITY number (1-...). It follows then that composites of UI Elements on the screen may also be associated with such an ID. However, a GUID is not required as one can be created by the library automatically behind the scenes.
This use of ID's works well for binding and retrieving sets of UI Elements. Within a single composite tied to an ID, identify X-Y Coordinates for positioning child elements within a parent container.
COMPOSITE STRUCTUREEach "composite" is wrapped in a Border. This is always the top-level Type of the composite. In this way, the Border may play a versatile role similar to the DIV tag on the web?
The different container types are added at the end of a ContentControl. This ContentControl is wrapped in a Border:

Besides
BeginComposite...EndComposite, there is also
BeginSettings...EndSettings which should be defined first. These settings are stored and then applied to each item (either by Type or based on X-Y position) when BeginComposite is called. There is also support for subscribing/unsubscribing events.
ICOMPOSITE CONTAINER TYPESCurrently, I support multiple containers (each implementing IComposite):
public enum ContainerType
{
HorizontalPanel = 0,
Grid = 1,
WrapPanel = 2,
DockPanel = 3,
VerticalPanel = 4,
ContentControlPanel = 5,
Canvas = 6,
UniformGrid = 7
}
//Define the container to use upon initializing an IParent
myDockPanel.Initialize(100, 100, ContainerType.Grid, . . .
The X-Y Coordinate obviously ties to Rows and Columns when using a container type of Grid, but here is a full breakdown for all the different IComposites:
Grid: x-y maps to row-column
HorizontalPanel, VerticalPanel, WrapPanel, UniformGrid; x is ignored (should be 0), y maps to index of Children
DockPanel: x maps to the Dock enum by int: Left = 0, Top = 1, Right = 2, Bottom = 3; y maps to index of Children
ContentControlPanel: there is only one x-y and that is 0,0 for the single Child
Canvas: x maps to distance from Top, and y maps to distance from Left.
Remember that x-y coordinates must be unique per child item; i.e., you can't have two items share the same x-y coordinate since this is used as a unique key to store and retrieve by.
COMMON COMPOSITE SCENARIOSHere is a breakdown of several common Composite scenarios. It can occasionally be confusing to think about how to nest complex Composites or build up chains of IParents and Composites. Hopefully, this may be a helpful guide:
26 IPARENT CONTROLSI started with a working example of this code-behind approach via
extensions to the WPF ListBox. I used extension methods because I didn't want developers to have to implement new custom controls.
This humble start has grown into fair support for 26 IParent controls:
Code ExamplesExamples for all of these exist in the Demo App. Completion of the documentation here is pending . . .
1.
Grid Example2.
Menu Example3.
ListBox Example4.
Combo Example5.
ScrollViewer Example6.
Dock Panel Example7.
StackPanel Example8.
Wrap Panel Example9.
GroupBox Example10.
DialogBox (Border) Example11.
TabControl Example12.
Tree View Example13.
Window Example14.
DataGrid15.
Canvas Example16.
Expander17.
CheckBox Example18.
RadioButton Example19.
AdornerDecorator Example (Field Validation)
20.
ToolBarTray and ToolBar Example21.
ContentControl3D22.
UserControl Example23.
ListView Example24.
Button Example25.
ContentControl Example26.
Popup ExampleIScrollViewerStrategy Examples1.
TextBox (Multi-Line) Example2.
RichTextBox ExampleOther Compatible Controls Exampleshttps://wpftoolkit.codeplex.com/ by Xceed
http://xceed.com1.
Extended WPF Toolkit™ Community Edition DataGrid2.
Extended WPF Toolkit™ Community Edition DecimalUpDown (aka NumericTextBox for Currency and %)
3.
Extended WPF Toolkit™ Community Edition MaskedTextBox (For fixed-length formatted strings such as phone number or social security number)
4.
Extended WPF Toolkit™ Community Edition MultiLineTextEditor5.
System.Windows.Controls.TextBox6.
System.Windows.Controls.DatePicker7.
System.Windows.Forms.DataVisualization.Charting.Chart8.
TextBlock and Label9.
Images10.
Context Menu ExampleSupported ControlsThese controls are official IParents.
Other Compatible ControlsThese controls are NOT official IParents but they may not need to be; e.g., if a control is more atomic. Below are controls that are such compatible controls that are showcased in examples in the Demo App:
1. Extended WPF Toolkit™ Community Edition DataGrid offered open-source
https://wpftoolkit.codeplex.com/ by Xceed
http://xceed.com2. Extended WPF Toolkit™ Community Edition DecimalUpDown (Format strings include C-Currency, F-Fixed Point, G-General, N-Number, P-Percent)
3. Extended WPF Toolkit™ Community Edition MaskedTextBox (For fixed-length formatted strings such as phone number or social security number)
4. Extended WPF Toolkit™ Community Edition MultiLineTextEditor5. System.Windows.Controls.TextBox6. System.Windows.Controls.DatePicker7. System.Windows.Forms.DataVisualization.Charting.Chart