changeset 18:8049f7c58c2b

Login form 75% there
author stevenh7776 stevenhollidge@hotmail.com
date Wed, 14 Mar 2012 18:06:36 +0700
parents 7721a1270363
children 09d18d6e5f40
files MetroWpf/MetroWpf.Xaml/Controls/PlayerControl.xaml MetroWpf/MetroWpf.Xaml/Controls/PlayerControl.xaml.cs MetroWpf/MetroWpf.Xaml/Controls/WatermarkTextBox.cs MetroWpf/MetroWpf.Xaml/Converters/BoolVisibilityConverter.cs MetroWpf/MetroWpf.Xaml/Converters/BooleanToVisibilityConverter.cs MetroWpf/MetroWpf.Xaml/MetroWpf.Xaml.csproj MetroWpf/MetroWpf.Xaml/Styles/Controls.WatermarkTextBox.xaml MetroWpf/MetroWpf/Presentation/Login/LoginView.xaml MetroWpf/MetroWpf/Presentation/Menu/MenuView.xaml MetroWpf/MetroWpf/Presentation/Shell/MainWindow.xaml
diffstat 10 files changed, 417 insertions(+), 175 deletions(-) [+]
line wrap: on
line diff
--- a/MetroWpf/MetroWpf.Xaml/Controls/PlayerControl.xaml	Wed Mar 14 01:23:57 2012 +0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-<UserControl x:Class="MetroWpf.Xaml.Controls.PlayerControl"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:MetroWpf.Xaml.Controls"
-             mc:Ignorable="d" 
-             Height="90" Width="120"
-             DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}">
-  <Grid>
-    <Button>
-      <StackPanel>
-        <Ellipse Fill="{Binding Path=KitColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
-                 Width="30" Height="30"/>
-        <TextBlock Foreground="White" FontSize="16" Margin="0,-25" 
-                   HorizontalAlignment="Center"
-                   Text="{Binding Path=ShirtNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-        <TextBlock FontSize="15" Margin="0,10,0,5" 
-                   HorizontalAlignment="Center"
-                   Text="{Binding Path=Surname, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-        <TextBlock HorizontalAlignment="Center"
-                   Text="{Binding Path=Position, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-      </StackPanel>
-
-    </Button>
-  </Grid>
-</UserControl>
--- a/MetroWpf/MetroWpf.Xaml/Controls/PlayerControl.xaml.cs	Wed Mar 14 01:23:57 2012 +0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-using System.ComponentModel;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-
-namespace MetroWpf.Xaml.Controls
-{
-  
-  /// <summary>
-  /// Interaction logic for PlayerControl.xaml
-  /// </summary>
-  public partial class PlayerControl : UserControl
-  {
-    #region Dependency Properties
-
-    public static readonly DependencyProperty ShirtNumberProperty
-      = DependencyProperty.Register("ShirtNumber",
-    typeof(int),
-    typeof(PlayerControl),
-    new PropertyMetadata(0));
-
-    [Bindable(true)]
-    public int ShirtNumber
-    {
-      get { return (int)this.GetValue(ShirtNumberProperty); }
-      set { this.SetValue(ShirtNumberProperty, value); }
-    }
-
-    public static readonly DependencyProperty KitColorProperty
-      = DependencyProperty.Register("KitColor",
-    typeof(Brush),
-    typeof(PlayerControl),
-    new PropertyMetadata(new SolidColorBrush(Color.FromArgb(0,0,0,0))));
-
-    [Bindable(true)]
-    public Brush KitColor
-    {
-      get { return (Brush)this.GetValue(KitColorProperty); }
-      set { this.SetValue(KitColorProperty, value); }
-    }
-
-    public static readonly DependencyProperty SurnameProperty
-      = DependencyProperty.Register("Surname",
-    typeof(string),
-    typeof(PlayerControl),
-    new PropertyMetadata("Not set"));
-
-    [Bindable(true)]
-    public string Surname
-    {
-      get { return (string)this.GetValue(SurnameProperty); }
-      set { this.SetValue(SurnameProperty, value); }
-    }
-
-    public static readonly DependencyProperty PositionProperty
-      = DependencyProperty.Register("Position",
-    typeof(string),
-    typeof(PlayerControl),
-    new PropertyMetadata("Not set"));
-
-    [Bindable(true)]
-    public string Position
-    {
-      get { return (string)this.GetValue(PositionProperty); }
-      set { this.SetValue(PositionProperty, value); }
-    }
-
-    #endregion
-
-    public PlayerControl()
-    {
-      InitializeComponent();        
-    }
-  }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MetroWpf/MetroWpf.Xaml/Controls/WatermarkTextBox.cs	Wed Mar 14 18:06:36 2012 +0700
@@ -0,0 +1,79 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+
+namespace Microsoft.Windows.Controls
+{
+    public class WatermarkTextBox : TextBox
+    {
+        #region Properties
+
+        #region SelectAllOnGotFocus
+
+        public static readonly DependencyProperty SelectAllOnGotFocusProperty = DependencyProperty.Register("SelectAllOnGotFocus", typeof(bool), typeof(WatermarkTextBox), new PropertyMetadata(false));
+        public bool SelectAllOnGotFocus
+        {
+            get { return (bool)GetValue(SelectAllOnGotFocusProperty); }
+            set { SetValue(SelectAllOnGotFocusProperty, value); }
+        }
+
+        #endregion //SelectAllOnGotFocus
+
+        #region Watermark
+
+        public static readonly DependencyProperty WatermarkProperty = DependencyProperty.Register("Watermark", typeof(object), typeof(WatermarkTextBox), new UIPropertyMetadata(null));
+        public object Watermark
+        {
+            get { return (object)GetValue(WatermarkProperty); }
+            set { SetValue(WatermarkProperty, value); }
+        }
+
+        #endregion //Watermark
+
+        #region WatermarkTemplate
+
+        public static readonly DependencyProperty WatermarkTemplateProperty = DependencyProperty.Register("WatermarkTemplate", typeof(DataTemplate), typeof(WatermarkTextBox), new UIPropertyMetadata(null));
+        public DataTemplate WatermarkTemplate
+        {
+            get { return (DataTemplate)GetValue(WatermarkTemplateProperty); }
+            set { SetValue(WatermarkTemplateProperty, value); }
+        }       
+
+        #endregion //WatermarkTemplate
+
+        #endregion //Properties
+
+        #region Constructors
+
+        static WatermarkTextBox()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(WatermarkTextBox), new FrameworkPropertyMetadata(typeof(WatermarkTextBox)));
+        }
+
+        #endregion //Constructors
+
+        #region Base Class Overrides
+
+        protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
+        {
+            if (SelectAllOnGotFocus)
+                SelectAll();
+
+            base.OnGotKeyboardFocus(e);
+        }
+
+        protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
+        {
+            if (!IsKeyboardFocused)
+            {
+                e.Handled = true;
+                Focus();
+            }
+
+            base.OnPreviewMouseLeftButtonDown(e);
+        }
+
+        #endregion //Base Class Overrides
+    }
+}
--- a/MetroWpf/MetroWpf.Xaml/Converters/BoolVisibilityConverter.cs	Wed Mar 14 01:23:57 2012 +0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// http://drwpf.com/blog/2009/03/17/tips-and-tricks-making-value-converters-more-accessible-in-markup/
-// to use in xaml:  <TextBlock Text="{Binding SomePath, Converter={src:BoolVisibilityConverter}}" />
-
-using System;
-using System.Windows;
-using System.Windows.Data;
-using System.Windows.Markup;
-
-namespace MetroWpf.Xaml.Converters
-{
-  public class BoolVisibilityConverter : MarkupExtension, IValueConverter
-  {
-    private static BoolVisibilityConverter _boolVisibilityConverter = null;
-
-    public override object ProvideValue(IServiceProvider serviceProvider)
-    {
-      if (null == _boolVisibilityConverter)
-        _boolVisibilityConverter = new BoolVisibilityConverter();
-
-      return _boolVisibilityConverter;
-    }
-
-    #region IValueConverter Members
-
-    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-    {
-      return (bool)value ? Visibility.Visible : Visibility.Collapsed;
-    }
-
-    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-    {
-      throw new NotImplementedException();
-    }
-
-    #endregion
-  }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MetroWpf/MetroWpf.Xaml/Converters/BooleanToVisibilityConverter.cs	Wed Mar 14 18:06:36 2012 +0700
@@ -0,0 +1,49 @@
+// http://drwpf.com/blog/2009/03/17/tips-and-tricks-making-value-converters-more-accessible-in-markup/
+// to use in xaml:  <TextBlock Text="{Binding SomePath, Converter={src:BoolVisibilityConverter}}" />
+
+using System;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+using System.Globalization;
+
+namespace MetroWpf.Xaml.Converters
+{
+  public class BooleanToVisibilityConverter : MarkupExtension, IValueConverter
+  {
+    private static BooleanToVisibilityConverter booleanToVisibilityConverter = null;
+
+    public override object ProvideValue(IServiceProvider serviceProvider)
+    {
+      if (null == booleanToVisibilityConverter)
+        booleanToVisibilityConverter = new BooleanToVisibilityConverter();
+
+      return booleanToVisibilityConverter;
+    }
+
+    public bool IsReversed { get; set; }
+    public bool UseHidden { get; set; }
+
+    #region IValueConverter Members
+
+    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+    {
+      var val = System.Convert.ToBoolean(value, CultureInfo.InvariantCulture);
+      if (this.IsReversed)
+      {
+        val = !val;
+      }
+      if (val)
+      {
+        return Visibility.Visible;
+      }
+      return this.UseHidden ? Visibility.Hidden : Visibility.Collapsed;
+    }
+    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+    {
+      throw new NotImplementedException();
+    }
+    
+    #endregion
+  }
+}
--- a/MetroWpf/MetroWpf.Xaml/MetroWpf.Xaml.csproj	Wed Mar 14 01:23:57 2012 +0700
+++ b/MetroWpf/MetroWpf.Xaml/MetroWpf.Xaml.csproj	Wed Mar 14 18:06:36 2012 +0700
@@ -50,13 +50,11 @@
   <ItemGroup>
     <Compile Include="Adorners\NotesAdorner.cs" />
     <Compile Include="Binding\BindingErrorTraceListener.cs" />
-    <Compile Include="Controls\PlayerControl.xaml.cs">
-      <DependentUpon>PlayerControl.xaml</DependentUpon>
-    </Compile>
+    <Compile Include="Controls\WatermarkTextBox.cs" />
     <Compile Include="Converters\AddConverter.cs" />
     <Compile Include="Converters\AgeToReadableStringConverter.cs" />
     <Compile Include="Converters\AngleToCoordinateConverter.cs" />
-    <Compile Include="Converters\BoolVisibilityConverter.cs" />
+    <Compile Include="Converters\BooleanToVisibilityConverter.cs" />
     <Compile Include="Converters\CollapseWhenZeroConverter.cs" />
     <Compile Include="Converters\ContentVisibilityConverter.cs" />
     <Compile Include="Converters\DateTimeToStringConverter.cs" />
@@ -80,7 +78,7 @@
     <Compile Include="Styles\Colors.cs" />
   </ItemGroup>
   <ItemGroup>
-    <Page Include="Controls\PlayerControl.xaml">
+    <Page Include="Styles\Controls.WatermarkTextBox.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MetroWpf/MetroWpf.Xaml/Styles/Controls.WatermarkTextBox.xaml	Wed Mar 14 18:06:36 2012 +0700
@@ -0,0 +1,231 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:local="clr-namespace:Microsoft.Windows.Controls"
+                    xmlns:System="clr-namespace:System;assembly=mscorlib">
+
+  <LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
+    <GradientStop Color="#ABADB3" Offset="0.05"/>
+    <GradientStop Color="#E2E3EA" Offset="0.07"/>
+    <GradientStop Color="#E3E9EF" Offset="1"/>
+  </LinearGradientBrush>
+
+  <LinearGradientBrush x:Key="TextBox_MouseOver" EndPoint="0,1" StartPoint="0,0">
+    <GradientStop Color="#5794BF" Offset="0.05"/>
+    <GradientStop Color="#B7D5EA" Offset="0.07"/>
+    <GradientStop Color="#C7E2F1" Offset="1"/>
+  </LinearGradientBrush>
+
+  <LinearGradientBrush x:Key="TextBox_Focused" EndPoint="0,1" StartPoint="0,0">
+    <GradientStop Color="#3D7BAD" Offset="0.05"/>
+    <GradientStop Color="#A4C9E3" Offset="0.07"/>
+    <GradientStop Color="#B7D9ED" Offset="1"/>
+  </LinearGradientBrush>
+
+  <SolidColorBrush x:Key="TextBox_DisabledBorder" Color="#ADB2B5" />
+  <SolidColorBrush x:Key="TextBox_DisabledBackground" Color="#F4F4F4" />
+
+  <DataTemplate x:Key="DefaultWatermarkTemplate">
+    <ContentControl Content="{Binding}" Foreground="Gray" Focusable="False" />
+  </DataTemplate>
+
+  <Style TargetType="{x:Type local:WatermarkTextBox}">
+    <Setter Property="FontFamily" Value="{DynamicResource ContentFontFamily}" />
+    <Setter Property="FontSize" Value="{DynamicResource ContentFontSize}" />
+    <Setter Property="BorderThickness" Value="1" />
+    <Setter Property="Height" Value="26" />
+    <Setter Property="MinHeight" Value="26" />
+    <Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}" />
+    <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
+    <Setter Property="VerticalContentAlignment" Value="Center" />
+    <Setter Property="Padding" Value="0" />
+    <Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderBrush}" />
+    <Setter Property="AllowDrop" Value="true"/>
+    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
+    <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
+    <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
+    <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
+    <Setter Property="Template">
+      <Setter.Value>
+        <ControlTemplate TargetType="{x:Type local:WatermarkTextBox}">
+          <Grid>
+            <VisualStateManager.VisualStateGroups>
+              <VisualStateGroup x:Name="CommonStates">
+                <VisualState x:Name="Normal" />
+                <VisualState x:Name="MouseOver">
+                  <Storyboard>
+                    <DoubleAnimation Duration="0"
+                                    To="1"
+                                    Storyboard.TargetProperty="(UIElement.Opacity)"
+                                    Storyboard.TargetName="FocusRectangle" />
+                  </Storyboard>
+                </VisualState>
+                <VisualState x:Name="Disabled">
+                  <Storyboard>
+                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
+                                                                       Storyboard.TargetName="DisabledVisualElement">
+                      <SplineDoubleKeyFrame KeyTime="0"
+                                                                  Value="1" />
+                    </DoubleAnimationUsingKeyFrames>
+                  </Storyboard>
+                </VisualState>
+                <VisualState x:Name="ReadOnly">
+                  <Storyboard>
+                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
+                                                                       Storyboard.TargetName="ReadOnlyVisualElement">
+                      <SplineDoubleKeyFrame KeyTime="0"
+                                                                  Value="1" />
+                    </DoubleAnimationUsingKeyFrames>
+                  </Storyboard>
+                </VisualState>
+              </VisualStateGroup>
+              <VisualStateGroup x:Name="FocusStates">
+                <VisualState x:Name="Focused">
+                  <Storyboard>
+                    <DoubleAnimation Duration="0"
+                                                         To="1"
+                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
+                                                         Storyboard.TargetName="FocusRectangle" />
+                    <DoubleAnimation Duration="0"
+                                                         To="1"
+                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
+                                                         Storyboard.TargetName="FocusInnerRectangle" />
+                  </Storyboard>
+                </VisualState>
+                <VisualState x:Name="Unfocused">
+                  <Storyboard />
+                </VisualState>
+              </VisualStateGroup>
+              <VisualStateGroup x:Name="ValidationStates">
+                <VisualState x:Name="Valid" />
+                <VisualState x:Name="InvalidUnfocused">
+                  <Storyboard>
+                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
+                                                                       Storyboard.TargetName="ValidationErrorElement">
+                      <DiscreteObjectKeyFrame KeyTime="0">
+                        <DiscreteObjectKeyFrame.Value>
+                          <Visibility>Visible</Visibility>
+                        </DiscreteObjectKeyFrame.Value>
+                      </DiscreteObjectKeyFrame>
+                    </ObjectAnimationUsingKeyFrames>
+                  </Storyboard>
+                </VisualState>
+                <VisualState x:Name="InvalidFocused">
+                  <Storyboard>
+                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
+                                                                       Storyboard.TargetName="ValidationErrorElement">
+                      <DiscreteObjectKeyFrame KeyTime="0">
+                        <DiscreteObjectKeyFrame.Value>
+                          <Visibility>Visible</Visibility>
+                        </DiscreteObjectKeyFrame.Value>
+                      </DiscreteObjectKeyFrame>
+                    </ObjectAnimationUsingKeyFrames>
+                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
+                                                                       Storyboard.TargetName="validationTooltip">
+                      <DiscreteObjectKeyFrame KeyTime="0">
+                        <DiscreteObjectKeyFrame.Value>
+                          <System:Boolean>True</System:Boolean>
+                        </DiscreteObjectKeyFrame.Value>
+                      </DiscreteObjectKeyFrame>
+                    </ObjectAnimationUsingKeyFrames>
+                  </Storyboard>
+                </VisualState>
+              </VisualStateGroup>
+            </VisualStateManager.VisualStateGroups>
+            <Rectangle x:Name="Base"
+                        Stroke="{TemplateBinding BorderBrush}"
+                        StrokeThickness="{TemplateBinding BorderThickness}"
+                        Opacity="1"
+                        Fill="{TemplateBinding Background}" />
+            <Rectangle x:Name="FocusRectangle"
+                      StrokeThickness="{TemplateBinding BorderThickness}"
+                      Opacity="0"
+                      Stroke="{DynamicResource TextBoxMouseOverBorderBrush}" />
+            <Rectangle x:Name="FocusInnerRectangle"
+                      StrokeThickness="{TemplateBinding BorderThickness}"
+                      Opacity="0"
+                      Margin="1"
+                      Stroke="{DynamicResource TextBoxMouseOverInnerBorderBrush}" />
+            <Grid Margin="0,1,0,0" >
+              <Border x:Name="ReadOnlyVisualElement"
+                      Background="{x:Null}"
+                      Opacity="0"/>
+              <Grid Margin="8,0,0,0">
+                <ScrollViewer x:Name="PART_ContentHost" 
+                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                <ContentPresenter x:Name="PART_WatermarkHost" 
+                                  Content="{TemplateBinding Watermark}"
+                                  ContentTemplate="{TemplateBinding WatermarkTemplate}"
+                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"                                       
+                                  IsHitTestVisible="False"
+                                  Margin="{TemplateBinding Padding}"
+                                  Visibility="Collapsed"/>
+
+              </Grid>
+            </Grid>
+            <Rectangle x:Name="DisabledVisualElement"
+                                   Stroke="{DynamicResource ControlsDisabledBrush}"
+                                   StrokeThickness="{TemplateBinding BorderThickness}"
+                                   Fill="{DynamicResource ControlsDisabledBrush}"
+                                   IsHitTestVisible="False"
+                                   Opacity="0" />
+            <Border x:Name="ValidationErrorElement"
+                                BorderBrush="{DynamicResource ControlsValidationBrush}"
+                                BorderThickness="1"
+                                Visibility="Collapsed">
+              <ToolTipService.ToolTip>
+                <ToolTip x:Name="validationTooltip"
+                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
+                                         Placement="Right"
+                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
+                                         Template="{DynamicResource ValidationToolTipTemplate}">
+                  <ToolTip.Triggers>
+                    <EventTrigger RoutedEvent="Canvas.Loaded">
+                      <BeginStoryboard>
+                        <Storyboard>
+                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"
+                                                                                   Storyboard.TargetName="validationTooltip">
+                            <DiscreteObjectKeyFrame KeyTime="0">
+                              <DiscreteObjectKeyFrame.Value>
+                                <System:Boolean>true</System:Boolean>
+                              </DiscreteObjectKeyFrame.Value>
+                            </DiscreteObjectKeyFrame>
+                          </ObjectAnimationUsingKeyFrames>
+                        </Storyboard>
+                      </BeginStoryboard>
+                    </EventTrigger>
+                  </ToolTip.Triggers>
+                </ToolTip>
+              </ToolTipService.ToolTip>
+              <Grid Background="Transparent"
+                                  HorizontalAlignment="Right"
+                                  Height="12"
+                                  Margin="1,-4,-4,0"
+                                  VerticalAlignment="Top"
+                                  Width="12">
+                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
+                                      Fill="{DynamicResource ValidationBrush5}"
+                                      Margin="1,3,0,0" />
+                <Path Data="M 0,0 L2,0 L 8,6 L8,8"
+                                      Fill="{DynamicResource WhiteColorBrush}"
+                                      Margin="1,3,0,0" />
+              </Grid>
+            </Border>
+          </Grid>
+          <ControlTemplate.Triggers>
+            <MultiTrigger>
+              <MultiTrigger.Conditions>
+                <Condition Property="IsFocused" Value="False"></Condition>
+                <Condition Property="Text" Value=""></Condition>
+              </MultiTrigger.Conditions>
+              <MultiTrigger.Setters>
+                <Setter Property="Visibility" TargetName="PART_WatermarkHost" Value="Visible"></Setter>
+              </MultiTrigger.Setters>
+            </MultiTrigger>
+          </ControlTemplate.Triggers>
+        </ControlTemplate>
+      </Setter.Value>
+    </Setter>
+  </Style>
+
+</ResourceDictionary>
\ No newline at end of file
--- a/MetroWpf/MetroWpf/Presentation/Login/LoginView.xaml	Wed Mar 14 01:23:57 2012 +0700
+++ b/MetroWpf/MetroWpf/Presentation/Login/LoginView.xaml	Wed Mar 14 18:06:36 2012 +0700
@@ -4,9 +4,14 @@
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
   xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
-  DataContext="{Binding LoginViewModel, Source={StaticResource Locator}}" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="292" d:DesignWidth="392">
+  xmlns:converters="clr-namespace:MetroWpf.Xaml.Converters;assembly=MetroWpf.Xaml"  
+  xmlns:controls="clr-namespace:Microsoft.Windows.Controls;assembly=MetroWpf.Xaml"
+  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+  mc:Ignorable="d" 
+  DataContext="{Binding LoginViewModel, Source={StaticResource Locator}}">
 
-  <Grid x:Name="VisualRoot">
+  <Grid x:Name="VisualRoot" Height="500" Width="570">
     <Grid.InputBindings>
       <KeyBinding Gesture="Enter" Command="{Binding LoginCommand}" />
     </Grid.InputBindings>
@@ -14,17 +19,32 @@
     <Grid.RowDefinitions>
       <RowDefinition Height="Auto" />
       <RowDefinition Height="10" />
+      <RowDefinition Height="60" />
+      <RowDefinition Height="Auto" />
+      <RowDefinition Height="10" />
       <RowDefinition Height="Auto" />
       <RowDefinition Height="Auto" />
       <RowDefinition Height="90" />
       <RowDefinition Height="Auto" />
     </Grid.RowDefinitions>
 
-    <Grid Grid.Row="0">
+    <Rectangle 
+            x:Name="BrandBar" Grid.Row="1" 
+            Fill="{DynamicResource BrandingBrush}"
+            HorizontalAlignment="Left" VerticalAlignment="Bottom" 
+            Width="100" Height="6" IsHitTestVisible="False" />
+
+    <TextBlock Grid.Row="2" FontSize="24" FontFamily="{DynamicResource HeaderFontFamily}"><Run>WELCOME</Run></TextBlock>
+
+
+    <Grid Grid.Row="3">
       <Border Grid.RowSpan="4" 
               Grid.ColumnSpan="3"
               BorderThickness="1"
+              BorderBrush="{DynamicResource PageBorderBrush}"
+              Background="{DynamicResource BackgroundGradient}"
               Padding="3.5">
+        
         <Grid VerticalAlignment="Top">
           <Grid.RowDefinitions>
             <RowDefinition Height="Auto" />
@@ -38,30 +58,29 @@
             <ColumnDefinition Width="85" />
           </Grid.ColumnDefinitions>
 
-          <TextBox Grid.Column="0" Grid.Row="0" 
-                  Text="{Binding UserId, Mode=TwoWay, ValidatesOnDataErrors=True}"
-                  FontWeight="Bold"
-                  HorizontalAlignment="Left" VerticalAlignment="Center"
-                  Width="220" MaxLength="50" Margin="3.5">
-          </TextBox>
-
+          <controls:WatermarkTextBox 
+            Grid.Column="0" Grid.Row="0" 
+            Watermark="USERNAME"
+            Text="{Binding UserId, Mode=TwoWay, ValidatesOnDataErrors=True}"
+            HorizontalAlignment="Left" VerticalAlignment="Center"
+            Width="220" MaxLength="50" Margin="3.5" />
 
           <!--chronos:PasswordBoxHelper.BoundPassword="{Binding Password, Mode=TwoWay, UpdateSourceTrigger=Default, ValidatesOnDataErrors=True}"-->
           <PasswordBox 
               Grid.Column="0" Grid.Row="1" 
-              FontWeight="Bold"
               HorizontalAlignment="Left" VerticalAlignment="Center"
-              Width="220" MaxLength="50" Margin="3.5">
-          </PasswordBox>
+              Width="220" MaxLength="50" Margin="3.5" />
 
           <Button Grid.Column="1" Grid.Row="1"
                   Margin="3.5"
                   Content="SIGN IN"
-                  FontWeight="Bold" FontSize="10"
+                  FontWeight="Bold" 
+                  FontSize="10"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Command="{Binding LoginCommand}"
-                  IsDefault="True">
+                  IsDefault="True"
+                  Width="90">
           </Button>
 
           <CheckBox Grid.Column="0" Grid.Row="2" 
@@ -72,7 +91,7 @@
                     Content="Remember me" 
                     Margin="3.5" VerticalAlignment="Center" 
                     Opacity="0.6" />
-          <CheckBox Grid.Column="1" Grid.Row="3" 
+          <CheckBox Grid.Column="1" Grid.Row="2" 
                     Content="Sign me in automatically" 
                     Margin="3.5" VerticalAlignment="Center" 
                     Opacity="0.6" />
@@ -80,27 +99,31 @@
       </Border>
     </Grid>
 
-    <Button Grid.Row="2"
+    <Button Grid.Row="5"
             FontWeight="Normal" FontSize="16"
             Content="create new account"
             HorizontalAlignment="Left"
-            VerticalAlignment="Bottom">
+            VerticalAlignment="Bottom"
+            Style="{DynamicResource ChromelessButtonStyle}">
     </Button>
 
-    <Button Grid.Row="3"
+    <Button Grid.Row="6"
             FontWeight="Normal" FontSize="16"
             Content="forgot your password"
             HorizontalAlignment="Left"
-            VerticalAlignment="Top">
+            VerticalAlignment="Top"
+            Style="{DynamicResource ChromelessButtonStyle}">
     </Button>
 
-    <Button Grid.Row="5"
+    <Button Grid.Row="8"
             Margin="3.5"
             FontWeight="Bold"
             Content="CANCEL"
             Command="{Binding CloseCommand}"
-            HorizontalAlignment="Right" VerticalAlignment="Center"
-            IsCancel="True">
+            HorizontalAlignment="Right" 
+            VerticalAlignment="Center"
+            IsCancel="True"
+            Width="90">
     </Button>
   </Grid>
 </UserControl>
--- a/MetroWpf/MetroWpf/Presentation/Menu/MenuView.xaml	Wed Mar 14 01:23:57 2012 +0700
+++ b/MetroWpf/MetroWpf/Presentation/Menu/MenuView.xaml	Wed Mar 14 18:06:36 2012 +0700
@@ -13,44 +13,44 @@
   <Grid>
     <TabControl x:Name="tabHost" SelectedIndex="{Binding SelectedTabIndex, Converter={converters:EnumToIntConverter}}">
 
-      <TabItem Header="_Stocks" Visibility="{Binding ShowStocks, Converter={converters:BoolVisibilityConverter}}">
+      <TabItem Header="_Stocks" Visibility="{Binding ShowStocks, Converter={converters:BooleanToVisibilityConverter}}">
         <StackPanel Margin="25,10">
 
         </StackPanel>
       </TabItem>
 
-      <TabItem Header="_Rates" Visibility="{Binding ShowFxRates, Converter={converters:BoolVisibilityConverter}}">
+      <TabItem Header="_Rates" Visibility="{Binding ShowFxRates, Converter={converters:BooleanToVisibilityConverter}}">
         <StackPanel Margin="25,10">
 
         </StackPanel>
       </TabItem>
 
       <!-- Start of hidden tabs-->
-      <TabItem Name="tabItemLogin" Visibility="{Binding ShowLogin, Converter={converters:BoolVisibilityConverter}}">
+      <TabItem Name="tabItemLogin" Visibility="{Binding ShowLogin, Converter={converters:BooleanToVisibilityConverter}}">
         <StackPanel Margin="25,10">
           <login:LoginView/>
         </StackPanel>
       </TabItem>
 
-      <TabItem Name="tabItemUserProfile" Visibility="{Binding ShowUserProfile, Converter={converters:BoolVisibilityConverter}}">
+      <TabItem Name="tabItemUserProfile" Visibility="{Binding ShowUserProfile, Converter={converters:BooleanToVisibilityConverter}}">
         <StackPanel Margin="25,10">
           <userprofile:UserProfileView />
         </StackPanel>
       </TabItem>
 
-      <TabItem Name="tabItemSettings" Visibility="{Binding ShowSettings, Converter={converters:BoolVisibilityConverter}}">
+      <TabItem Name="tabItemSettings" Visibility="{Binding ShowSettings, Converter={converters:BooleanToVisibilityConverter}}">
         <StackPanel Margin="25,10">
           <settings:SettingsView />
         </StackPanel>
       </TabItem>
 
-      <TabItem Name="tabItemAbout" Visibility="{Binding ShowAbout, Converter={converters:BoolVisibilityConverter}}">
+      <TabItem Name="tabItemAbout" Visibility="{Binding ShowAbout, Converter={converters:BooleanToVisibilityConverter}}">
         <StackPanel Margin="25,10">
           <about:AboutView />
         </StackPanel>
       </TabItem>
 
-      <TabItem Name="tabItemHelp" Visibility="{Binding ShowHelp, Converter={converters:BoolVisibilityConverter}}">
+      <TabItem Name="tabItemHelp" Visibility="{Binding ShowHelp, Converter={converters:BooleanToVisibilityConverter}}">
         <StackPanel Margin="25,10">
           <about:AboutView />
         </StackPanel>
--- a/MetroWpf/MetroWpf/Presentation/Shell/MainWindow.xaml	Wed Mar 14 01:23:57 2012 +0700
+++ b/MetroWpf/MetroWpf/Presentation/Shell/MainWindow.xaml	Wed Mar 14 18:06:36 2012 +0700
@@ -28,6 +28,7 @@
         <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Icons/MergedResources.xaml" />
         <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
         <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
+        <ResourceDictionary Source="pack://application:,,,/MetroWpf.Xaml;component/Styles/Controls.WatermarkTextBox.xaml" />
       </ResourceDictionary.MergedDictionaries>
     </ResourceDictionary>
   </Window.Resources>
@@ -42,7 +43,7 @@
                   VerticalAlignment="Top" 
                   Margin="0,4,0,0" 
                   Orientation="Horizontal"
-                  Visibility="{Binding ShowTopRightOptions, Converter={converters:BoolVisibilityConverter}}">
+                  Visibility="{Binding ShowTopRightOptions, Converter={converters:BooleanToVisibilityConverter}}">
         <Button x:Name="UserLogOnInfo" 
                 Content="stevenh" 
                 Style="{DynamicResource ChromelessButtonStyle}"