Project DescriptionA set of controls, extensions and helper classes for Windows Runtime XAML applications.
How do I use it?Download the full
source code or just the snippet you find useful. Be sure to try the samples! Find me on
twitter to ask any questions.
Features
- A copy of the AsyncUI library - a set of extension methods for UI classes that add support for async/await to wait for events such as:
- Wait for a BitmapImage to load
- Wait for a Button or one of a list of buttons to be clicked
- Wait for a FrameworkElement to load, unload or become non-zero-sized
- Wait for a MediaElement to change state - eg. to start or finish playback
- Wait for a Selector (e.g. ListBox) to change selected item
- Wait for a Storyboard to complete
- Controls
- AnimationHelper - two attached properties - Storyboard and IsPlaying. Allows to easily control Storyboard playback from a view model (note limitation - a single storyboard per control).
- AnimatingContainer - a container control that will animate its contents rotating or zooming in/out, eg. to make them feel more alive
- CameraCaptureControl - under development - currently supports displaying camera preview - ultimately it will look and work much like a regular CameraCaptureUI interface, but embeddable inside of your application UI layout
- CascadingTextBlock - a TextBlock replacement that animates the individual letters in a cascade - fading in while falling down into position, then optionally fading out while falling down from the standard position
- ControlExtensions.Cursor - enables setting a mouse cursor to show when hovering over a control
- CountdownControl - a movie-style control that animates a ring-slice shape while counting down seconds - e.g. to take a picture with a camera after a given number of seconds (supports async/await)
- CustomAppBar - a custom implementation of the AppBar that automatically handles the three gestures to switch IsOpen (WinKey+Z, Right-Click, EdgeGesture), adds a CanOpen property, so you can prevent it from opening and opens/hides with a sliding animation when placed anywhere in the app, so you can layer content on top of it
- CustomGridSplitter - a custom implementation of a GridSplitter
- DelayedLoadControl - given a content/DataTemplate - loads the contents after a given amount of time - e.g. to allow for staged loading of contents on screen
- InputDialog - a dialog control that takes text input
- ListBoxExtensions./ListViewExtensions.BindableSelection - allows a two-way binding of the SelectedItems collection on the Selector/list controls
- ListItemButton - a simple button control with Click event and Command property to be used inside of list controls (the standard button steals pointer capture from the List/Grid~Items so they can't be selected
- PieSlice - a pie slice path/shape given StartAngle, EndAngle and Radius
- RingSlice - a pie slice path/shape given StartAngle, EndAngle, Radius and InnerRadius
- RichTextBlockExtensions.PlainText - attached property that allows to easily single-way-bind plain text to a RichTextBlock (not really that useful other than for visualizing RichTextBlock styles in the sample app provided)
- TextBlockExtensions/GetCharacterRect() - an extension method that returns a rectangle that holds a character at a given index in the TextBlock
- Conterters
- BooleanToDataTemplateConverter - given two DataTemplates (TrueTemplate and FalseTemplate) - converts the input value to the given template. A different take on DataTemplateSelector.
- Extensions
- WriteableBitmap - a set of extension methods for a WriteableBitmap
- ColorExtensions - Conversions between pixels and pixel buffer types of byte, int and Color
- IBufferExtensions - Adds a GetPixels() extension method to the PixelBuffer property of a WriteableBitmap that reads in the buffer to a byte array and exposes an indexer compatible to the one of the Pixels property in Silverlight's WriteableBitmap
- WriteableBitmapSaveExtensions - support for loading and saving the bitmap to/from files
- WriteableBitmapBlitBlockExtensions - support for quick blitting of a full-width section of a bitmap to another bitmap of same width
- WriteableBitmapCopyExtensions - support creating a copy of a WriteableBitmap
- WriteableBitmapCropExtensions - support for creating a cropped version of a WriteableBitmap
- WriteableBitmapFloodFillExtensions - support for flood-filling a region of a WriteableBitmap - either limited by an outline color or by replacing a given color - usually a color at the starting position or colors similar to it
- Serialization
- JsonSerialization - allows to serialize a properly DataContract-annotated object to a JSON string or file or deserialize an existing one.
- XmlSerialization - allows to serialize a properly DataContract- or XmlSerializer-annotated object to a XML string or file or deserialize an existing one.
- StringIOExtensions - allows to easily read or write a string from/to file in a single call
- VisualTree helpers
- VisualTreeDebugger - provides a trace of the visual tree structure when a control loads, its layout updates or it gets tapped as well as allowing the application to break in the debugger if one of these events occurs
- VisualTreeHelperExtensions - provides a set of extension methods that enumerate visual tree ascendants/descendants of a given control - making it easy to do these operations with LINQ as well as simple ways to list controls of a given type or find the first control of a given type searching up or down the visual tree
Work in ProgressThe libraries are just a set of helper methods and controls that I found useful to fill the gaps in Windows Runtime XAML framework and continues to evolve.
Likely Additions
- TransitionFrame - something similar to the one from the Silverlight Toolkit - to get nicer transitions when switching between pages.
- Pivot control - analogous to a Pivot control on Windows Phone or a TabControl in WPF.
- WebBrowser control - WebView + some UI feature like address bar, backstack navigation etc.
- WeatherAppTabControl - a Pivot/TabControl like control that mimics the one in the Weather App.
Similar Projects
- Tim Heuer's and Morten Nielsen's Callisto - contains a host of controls (DateTimePicker, Flyout, LiveTile, Menu, SettingsFlyout), converters, Tilt Effect, OAuth helper, SQLite connection helper, etc.