Skip to content
Browse files

Skinned the controls

-Added DarkExpression skin
-Changed styles of UI elements
-Added BoolToVisibility converter
  • Loading branch information...
1 parent f279d45 commit e0ae644022e59926e2d220bd474f23ceec0339a6 @HEskandari HEskandari committed Aug 30, 2010
View
1 Rhino.Licensing.AdminTool.Tests/ViewModels/ShellViewModelTests.cs
@@ -16,7 +16,6 @@ public class ShellViewModelTests
private readonly IWindowManager _windowManager;
private readonly IProjectService _projectService;
private readonly IDialogService _dialogService;
-
public ShellViewModelTests()
{
View
27 Rhino.Licensing.AdminTool/App.xaml
@@ -2,29 +2,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
-
- <Style TargetType="{x:Type TextBox}">
- <Setter Property="Margin" Value="5" />
- </Style>
- <Style x:Key="Label" TargetType="{x:Type TextBlock}">
- <Setter Property="Margin" Value="5" />
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="HorizontalAlignment" Value="Right"/>
- </Style>
-
- <Style x:Key="ToolButton" TargetType="{x:Type ButtonBase}">
- <Setter Property="Width" Value="25"/>
- <Setter Property="Height" Value="25"/>
- <Setter Property="Margin" Value="1"/>
- </Style>
-
- <Style x:Key="ToolSeparator" TargetType="{x:Type Rectangle}">
- <Setter Property="Height" Value="25"/>
- <Setter Property="Width" Value="2"/>
- <Setter Property="Margin" Value="2"/>
- <Setter Property="Fill" Value="Gray"/>
- </Style>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="/Theme/ExpressionDark.xaml" />
+ </ResourceDictionary.MergedDictionaries>
+ </ResourceDictionary>
</Application.Resources>
</Application>
View
30 Rhino.Licensing.AdminTool/Controls/FXPopup.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Windows;
+using System.Windows.Controls.Primitives;
+
+namespace Rhino.Licensing.AdminTool.Controls
+{
+ public class FXPopup : Popup
+ {
+ public static readonly RoutedEvent PopupClosedEvent;
+ public static readonly RoutedEvent PopupOpenedEvent;
+
+ static FXPopup()
+ {
+ PopupOpenedEvent = EventManager.RegisterRoutedEvent("PopupOpened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(FXPopup));
+ PopupClosedEvent = EventManager.RegisterRoutedEvent("PopupClosed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(FXPopup));
+ }
+
+ protected override void OnClosed(EventArgs e)
+ {
+ RaiseEvent(new RoutedEventArgs(PopupClosedEvent, this));
+ base.OnClosed(e);
+ }
+
+ protected override void OnOpened(EventArgs e)
+ {
+ RaiseEvent(new RoutedEventArgs(PopupOpenedEvent, this));
+ base.OnOpened(e);
+ }
+ }
+}
View
1,567 Rhino.Licensing.AdminTool/Theme/ExpressionDark.xaml
1,567 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
43 Rhino.Licensing.AdminTool/ValueConverters/BoolToVisibilityCollapsedConverter.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Rhino.Licensing.AdminTool.ValueConverters
+{
+ public class BoolToVisibilityCollapsedConverter : IValueConverter
+ {
+ public bool InvertBoolean
+ {
+ get; set;
+ }
+
+ public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
+ {
+ var collapsed = Visibility.Collapsed;
+
+ if (o is bool?)
+ {
+ var nullable = (bool?)o;
+
+ if (nullable.Value ^ InvertBoolean)
+ collapsed = Visibility.Visible;
+
+ return collapsed;
+ }
+
+ if (o is bool && ((bool)o) ^ InvertBoolean)
+ {
+ collapsed = Visibility.Visible;
+ }
+
+ return collapsed;
+ }
+
+ public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
+ {
+ var visibility = (Visibility)o;
+ return ((visibility == Visibility.Visible) ^ InvertBoolean);
+ }
+ }
+}
View
3 Rhino.Licensing.AdminTool/Views/AboutView.xaml
@@ -5,8 +5,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cal="http://www.caliburnproject.org"
mc:Ignorable="d"
+ Background="{DynamicResource DialogBackgroundBrush}"
Width="400" Height="100">
-
+
<StackPanel Orientation="Vertical" Margin="10">
<TextBlock Text="{Binding Version, StringFormat='Rhino Licensing Admin Tool Version {0}'}"
View
16 Rhino.Licensing.AdminTool/Views/ProjectView.xaml
@@ -13,23 +13,23 @@
HorizontalAlignment="Left"
Orientation="Horizontal">
- <Button Style="{DynamicResource ToolButton}"
+ <Button
Content="Save"
cal:Message.Attach="[Event Click]=[Action Save]"/>
- <Button Style="{DynamicResource ToolButton}"
+ <Button
Content="Close"
cal:Message.Attach="[Event Click]=[Action TryClose]"/>
<Rectangle Style="{DynamicResource ToolSeparator}" />
- <Button Style="{DynamicResource ToolButton}"
+ <Button
Content="Generate Key Pair"
cal:Message.Attach="[Event Click]=[Action GenerateKey]"/>
</ToolBarPanel>
- <GroupBox Header="Product Information" Margin="5">
+ <GroupBox Header="Product Information">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -41,12 +41,12 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
- <TextBlock Style="{DynamicResource Label}" Text="Name: " Grid.Column="0" Grid.Row="0" />
- <TextBlock Style="{DynamicResource Label}" Text="Public Key: " Grid.Column="0" Grid.Row="1"/>
- <TextBlock Style="{DynamicResource Label}" Text="Private Key: " Grid.Column="0" Grid.Row="2"/>
+ <Label Content="Name: " Grid.Column="0" Grid.Row="0" />
+ <Label Content="Public Key: " Grid.Column="0" Grid.Row="1"/>
+ <Label Content="Private Key: " Grid.Column="0" Grid.Row="2"/>
<TextBox Text="{Binding Path=CurrentProject.Product.Name}"
- Grid.Column="1" Grid.Row="0" />
+ Grid.Column="1" Grid.Row="0" />
<TextBox Text="{Binding Path=CurrentProject.Product.PublicKey}"
IsReadOnly="True"
View
4 Rhino.Licensing.AdminTool/Views/ShellView.xaml
@@ -8,8 +8,8 @@
Title="{Binding DisplayName}"
d:DesignHeight="300" d:DesignWidth="300"
Height="480" Width="640">
-
- <DockPanel>
+
+ <DockPanel Background="{DynamicResource DialogBackgroundBrush}">
<Menu DockPanel.Dock="Top">
<Menu.Items>

0 comments on commit e0ae644

Please sign in to comment.
Something went wrong with that request. Please try again.