diff Messaging/Common/Controls/MessageTile.xaml.cs @ 26:045dac571339

Working on data binding to a user control
author adminsh@apollo
date Wed, 21 Mar 2012 15:39:53 +0000
parents
children 96fdf58e05b4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Messaging/Common/Controls/MessageTile.xaml.cs	Wed Mar 21 15:39:53 2012 +0000
@@ -0,0 +1,80 @@
+using System;
+using System.ComponentModel;
+using System.Windows;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+
+namespace Common.Controls
+{
+    /// <summary>
+    /// Interaction logic for MessageTile.xaml
+    /// </summary>
+    public partial class MessageTile
+    {
+        public MessageTile()
+        {
+            InitializeComponent();
+        }
+
+        #region Dependency Properties
+
+        #region DisplayIcon
+
+        /// <summary>
+        /// Icon for the tile
+        /// </summary>
+        public static readonly DependencyProperty DisplayIconProperty =
+            DependencyProperty.Register("DisplayIcon",
+                typeof(BitmapImage),
+                typeof(MessageTile),
+                new PropertyMetadata(null));
+
+        [Bindable(true)]
+        public BitmapImage DisplayIcon
+        {
+            get { return (BitmapImage)this.GetValue(DisplayIconProperty); }
+            set { this.SetValue(DisplayIconProperty, value); }
+        }
+        #endregion
+
+        #region DisplayCount
+
+        /// <summary>
+        /// Display count for the tile
+        /// </summary>
+        public static readonly DependencyProperty DisplayCountProperty =
+            DependencyProperty.Register("DisplayCount",
+                typeof(int),
+                typeof(MessageTile),
+                new PropertyMetadata(0));
+
+        [Bindable(true)]
+        public int DisplayCount
+        {
+            get { return (int) this.GetValue(DisplayCountProperty); }
+            set { this.SetValue(DisplayCountProperty, value); }
+        }
+        #endregion
+
+        #region DisplayText
+
+        /// <summary>
+        /// Main Display text for the tile
+        /// </summary>
+        public static readonly DependencyProperty DisplayTextProperty =
+            DependencyProperty.Register("DisplayText",
+                typeof(string),
+                typeof(MessageTile),
+                new PropertyMetadata("Not set"));
+
+        [Bindable(true)]
+        public string DisplayText
+        {
+            get { return (string) this.GetValue(DisplayTextProperty); }
+            set { this.SetValue(DisplayTextProperty, value); }
+        }
+        #endregion
+
+        #endregion
+    }
+}