comparison 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
comparison
equal deleted inserted replaced
25:81f9b72a44ce 26:045dac571339
1 using System;
2 using System.ComponentModel;
3 using System.Windows;
4 using System.Windows.Media;
5 using System.Windows.Media.Imaging;
6
7 namespace Common.Controls
8 {
9 /// <summary>
10 /// Interaction logic for MessageTile.xaml
11 /// </summary>
12 public partial class MessageTile
13 {
14 public MessageTile()
15 {
16 InitializeComponent();
17 }
18
19 #region Dependency Properties
20
21 #region DisplayIcon
22
23 /// <summary>
24 /// Icon for the tile
25 /// </summary>
26 public static readonly DependencyProperty DisplayIconProperty =
27 DependencyProperty.Register("DisplayIcon",
28 typeof(BitmapImage),
29 typeof(MessageTile),
30 new PropertyMetadata(null));
31
32 [Bindable(true)]
33 public BitmapImage DisplayIcon
34 {
35 get { return (BitmapImage)this.GetValue(DisplayIconProperty); }
36 set { this.SetValue(DisplayIconProperty, value); }
37 }
38 #endregion
39
40 #region DisplayCount
41
42 /// <summary>
43 /// Display count for the tile
44 /// </summary>
45 public static readonly DependencyProperty DisplayCountProperty =
46 DependencyProperty.Register("DisplayCount",
47 typeof(int),
48 typeof(MessageTile),
49 new PropertyMetadata(0));
50
51 [Bindable(true)]
52 public int DisplayCount
53 {
54 get { return (int) this.GetValue(DisplayCountProperty); }
55 set { this.SetValue(DisplayCountProperty, value); }
56 }
57 #endregion
58
59 #region DisplayText
60
61 /// <summary>
62 /// Main Display text for the tile
63 /// </summary>
64 public static readonly DependencyProperty DisplayTextProperty =
65 DependencyProperty.Register("DisplayText",
66 typeof(string),
67 typeof(MessageTile),
68 new PropertyMetadata("Not set"));
69
70 [Bindable(true)]
71 public string DisplayText
72 {
73 get { return (string) this.GetValue(DisplayTextProperty); }
74 set { this.SetValue(DisplayTextProperty, value); }
75 }
76 #endregion
77
78 #endregion
79 }
80 }