Posts

Showing posts from October, 2007

Time Picker User Control

The easiest way to create a WPF TimePicker control is to make a user control wrapped for TimeSpan CLR object. Here is a very simple sample which does that. Basically TimeControl is having 4 DPs one for the entire Value (Which is a TimeSpan) and individual Hours, Minutes and Seconds. (We can optionally add Days and Milliseconds also to make the control rich). Here is a C# class TimeControl.xaml.cs public partial class TimeControl : UserControl { public TimeControl() { InitializeComponent(); } public TimeSpan Value { get { return ( TimeSpan )GetValue(ValueProperty); } set { SetValue(ValueProperty, value ); } } public static readonly DependencyProperty ValueProperty = DependencyProperty .Register( "Value" , typeof ( TimeSpan ), typeof ( TimeControl ), new UIPropertyMetadata ( DateTime .Now.TimeOfDay, new PropertyChangedCallback (OnValueChanged))); ...

Blendables essentials mix v1.0 now available

A bunch of controls and utilities for Windows Presentation Foundation(WPF) has been released by Identitymine. You can take a look at Blendables here . And there is a WPF programming contest is also going on there . Have you ever wished to have a Carousal3D in your WPF app? or a ready to use Zoombox or a TimelinePanel. And have you ever thought of doing more things inside the XAML itself with out doing much C# coding? then you really need this exciting utility comming along with Blendables called EvalBinding and Simple Binding. Cheers!!!