using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Aitex.Core.UI.Control { /// /// Interaction logic for Filter.xaml /// public partial class Filter : UserControl { public Filter() { InitializeComponent(); } /// /// define dependency property /// public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( "Orientation", typeof(Orientation), typeof(Filter), new FrameworkPropertyMetadata(Orientation.Horizontal, FrameworkPropertyMetadataOptions.AffectsRender)); /// /// filter oritation /// public Orientation Orientation { get { return (Orientation)this.GetValue(OrientationProperty); } set { this.SetValue(OrientationProperty, value); } } /// /// control rendering /// /// protected override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); if (Orientation == Orientation.Horizontal) { this.rotateTransform.Angle = 0; } else { this.rotateTransform.Angle = 90; } } } }