# HG changeset patch # User adminsh@apollo # Date 1332861345 -3600 # Node ID 83c1f62d93703f7dd079a5b5c20c6332dbc6673d # Parent 874e51b94623a87293c9b354f49322f053457592 All working except image so far diff -r 874e51b94623 -r 83c1f62d9370 Messaging/Common/Common.csproj --- a/Messaging/Common/Common.csproj Thu Mar 22 08:42:03 2012 +0000 +++ b/Messaging/Common/Common.csproj Tue Mar 27 16:15:45 2012 +0100 @@ -12,6 +12,8 @@ Common v4.0 512 + true + 4.0.20525.0 true @@ -31,6 +33,9 @@ 4 + + ..\Libs\Elysium.Theme.1.3\Elysium.Theme.dll + ..\Libs\MvvmLight.4.0\GalaSoft.MvvmLight.WPF4.dll @@ -38,29 +43,35 @@ + + + + + - - MessageTile.xaml - - + + MSBuild:Compile + Designer + + Designer MSBuild:Compile - + diff -r 874e51b94623 -r 83c1f62d9370 Messaging/Common/Controls/MessageTile.xaml --- a/Messaging/Common/Controls/MessageTile.xaml Thu Mar 22 08:42:03 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff -r 874e51b94623 -r 83c1f62d9370 Messaging/Common/Controls/MessageTile.xaml.cs --- a/Messaging/Common/Controls/MessageTile.xaml.cs Thu Mar 22 08:42:03 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -using System.ComponentModel; -using System.Windows; -using System.Windows.Media.Imaging; - -namespace Common.Controls -{ - /// - /// Interaction logic for MessageTile.xaml - /// - public partial class MessageTile - { - public MessageTile() - { - InitializeComponent(); - } - - // Dependency Properties - - #region DisplayIcon - - /// - /// Icon for the tile - /// - 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 - - /// - /// Display count for the tile - /// - public static readonly DependencyProperty DisplayCountProperty = - DependencyProperty.Register("DisplayCount", - typeof(int), - typeof(MessageTile), - new UIPropertyMetadata(0)); - - public int DisplayCount - { - get { return (int) this.GetValue(DisplayCountProperty); } - set { this.SetValue(DisplayCountProperty, value); } - } - - #endregion - - #region DisplayText - - /// - /// Main Display text for the tile - /// - 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 - } -} diff -r 874e51b94623 -r 83c1f62d9370 Messaging/Common/Controls/MetroTile.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Messaging/Common/Controls/MetroTile.cs Tue Mar 27 16:15:45 2012 +0100 @@ -0,0 +1,143 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace Common.Controls +{ + [TemplatePart(Name="PART_DISPLAY_ICON", Type=typeof(Image))] + [TemplatePart(Name = "PART_DISPLAY_COUNT_CONTAINER", Type = typeof(TextBlock))] + [TemplatePart(Name = "PART_DISPLAY_TITLE_CONTAINER", Type = typeof(TextBlock))] + public class MetroTile : UserControl + { + + #region Constructor + + static MetroTile() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(MetroTile), + new FrameworkPropertyMetadata(typeof(MetroTile))); + + CommandManager.RegisterClassCommandBinding( + typeof(MetroTile), + new CommandBinding(ResetCountCommand, OnResetCountCommand)); + } + + #endregion + + #region Dependency Properties + + #region DisplayIcon + + /// + /// Icon for the tile + /// + public static readonly DependencyProperty DisplayIconProperty = + DependencyProperty.Register("DisplayIcon", + typeof(Image), + typeof(MetroTile), + new PropertyMetadata(null)); + + public Image DisplayIcon + { + get { return (Image) this.GetValue(DisplayIconProperty); } + set { this.SetValue(DisplayIconProperty, value); } + } + #endregion + + #region DisplayCount + + /// + /// Display count for the tile + /// + public static readonly DependencyProperty DisplayCountProperty = + DependencyProperty.Register("DisplayCount", + typeof(int), + typeof(MetroTile), + new UIPropertyMetadata(0)); + + public int DisplayCount + { + get { return (int)this.GetValue(DisplayCountProperty); } + set { this.SetValue(DisplayCountProperty, value); } + } + + #endregion + + #region DisplayText + + /// + /// Main Display text for the tile + /// + public static readonly DependencyProperty DisplayTextProperty = + DependencyProperty.Register("DisplayText", + typeof(string), + typeof(MetroTile), + new PropertyMetadata("Not set")); + + public string DisplayText + { + get { return (string)this.GetValue(DisplayTextProperty); } + set { this.SetValue(DisplayTextProperty, value); } + } + #endregion + + #endregion + + #region Events + + public static readonly RoutedEvent DisplayCountChangedEvent = + EventManager.RegisterRoutedEvent("DisplayCountChanged", + RoutingStrategy.Bubble, + typeof(RoutedEventHandler), + typeof(MetroTile)); + + public event RoutedEventHandler DisplayCountChanged + { + add { AddHandler(DisplayCountChangedEvent, value); } + remove { RemoveHandler(DisplayCountChangedEvent, value); } + } + + protected virtual void OnDisplayCountChanged(int oldValue, int newValue) + { + // 1. Pair of events: A preview that tunnels and a main event that bubbles + // 2. We could also create our own RoutedEventArgs that includes oldValue & new Value + + var previewEvent = new RoutedEventArgs(PreviewDisplayCountChangedEvent); + RaiseEvent(previewEvent); + + var e = new RoutedEventArgs(DisplayCountChangedEvent); + RaiseEvent(e); + } + + public static readonly RoutedEvent PreviewDisplayCountChangedEvent = + EventManager.RegisterRoutedEvent("PreviewDisplayCountChanged", + RoutingStrategy.Tunnel, + typeof(RoutedEventHandler), + typeof(MetroTile)); + + public event RoutedEventHandler PreviewDisplayCountChanged + { + add { AddHandler(PreviewDisplayCountChangedEvent, value); } + remove { RemoveHandler(PreviewDisplayCountChangedEvent, value); } + } + + #endregion + + #region Commands + + public static readonly ICommand ResetCountCommand = + new RoutedUICommand("ResetCount", "ResetCount", typeof(MetroTile)); + + private static void OnResetCountCommand(object sender, ExecutedRoutedEventArgs e) + { + var target = (MetroTile)sender; + target.DisplayCount = 0; + } + + #endregion + + } +} \ No newline at end of file diff -r 874e51b94623 -r 83c1f62d9370 Messaging/Common/Themes/Generic.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Messaging/Common/Themes/Generic.xaml Tue Mar 27 16:15:45 2012 +0100 @@ -0,0 +1,76 @@ + + + + + + + + + \ No newline at end of file diff -r 874e51b94623 -r 83c1f62d9370 Messaging/Common/Themes/MetroColours.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Messaging/Common/Themes/MetroColours.xaml Tue Mar 27 16:15:45 2012 +0100 @@ -0,0 +1,28 @@ + + #FF0097 + #A200FF + #00ABA9 + #8CBF26 + #996600 + #FF0097 + #F09609 + #1BA1E2 + #FFB2E0F4 + #E51400 + #339933 + #FFF2F2F2 + #FFFFEEEE + + + + + + + + + + + + + + \ No newline at end of file diff -r 874e51b94623 -r 83c1f62d9370 Messaging/Server/App.xaml --- a/Messaging/Server/App.xaml Thu Mar 22 08:42:03 2012 +0000 +++ b/Messaging/Server/App.xaml Tue Mar 27 16:15:45 2012 +0100 @@ -10,36 +10,14 @@ + +