提交 9d324001 编写于 作者: cdy816's avatar cdy816

DBInStudio 主题颜色修改成深色

上级 72b418e0
......@@ -9,7 +9,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
<PackageReference Include="Google.Protobuf" Version="3.12.2" />
<PackageReference Include="Grpc.Net.Client" Version="2.31.0" />
<PackageReference Include="Grpc.Tools" Version="2.31.0">
<PrivateAssets>all</PrivateAssets>
......
......@@ -18,6 +18,7 @@
<ItemGroup>
<None Remove="Image\add.png" />
<None Remove="Image\cancel.png" />
<None Remove="Image\close.png" />
<None Remove="Image\database-add.png" />
<None Remove="Image\export.png" />
<None Remove="Image\export2.png" />
......@@ -25,6 +26,8 @@
<None Remove="Image\import.png" />
<None Remove="Image\import2.png" />
<None Remove="Image\log-out.png" />
<None Remove="Image\max.png" />
<None Remove="Image\minus.png" />
<None Remove="Image\mrdbd.ico" />
<None Remove="Image\ok.png" />
<None Remove="Image\permissions.png" />
......@@ -54,6 +57,7 @@
<ItemGroup>
<Resource Include="Image\add.png" />
<Resource Include="Image\cancel.png" />
<Resource Include="Image\close.png" />
<Resource Include="Image\database-add.png" />
<Resource Include="Image\export.png" />
<Resource Include="Image\export2.png" />
......@@ -61,6 +65,8 @@
<Resource Include="Image\import.png" />
<Resource Include="Image\import2.png" />
<Resource Include="Image\log-out.png" />
<Resource Include="Image\max.png" />
<Resource Include="Image\minus.png" />
<Resource Include="Image\mrdbd.ico" />
<Resource Include="Image\ok.png" />
<Resource Include="Image\permissions.png" />
......
Develop/DbManager.Desktop/Image/Security.png

504 字节 | W: | H:

Develop/DbManager.Desktop/Image/Security.png

414 字节 | W: | H:

Develop/DbManager.Desktop/Image/Security.png
Develop/DbManager.Desktop/Image/Security.png
Develop/DbManager.Desktop/Image/Security.png
Develop/DbManager.Desktop/Image/Security.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/Switch.png

443 字节 | W: | H:

Develop/DbManager.Desktop/Image/Switch.png

564 字节 | W: | H:

Develop/DbManager.Desktop/Image/Switch.png
Develop/DbManager.Desktop/Image/Switch.png
Develop/DbManager.Desktop/Image/Switch.png
Develop/DbManager.Desktop/Image/Switch.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/add.png

122 字节 | W: | H:

Develop/DbManager.Desktop/Image/add.png

138 字节 | W: | H:

Develop/DbManager.Desktop/Image/add.png
Develop/DbManager.Desktop/Image/add.png
Develop/DbManager.Desktop/Image/add.png
Develop/DbManager.Desktop/Image/add.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/export.png

272 字节 | W: | H:

Develop/DbManager.Desktop/Image/export.png

614 字节 | W: | H:

Develop/DbManager.Desktop/Image/export.png
Develop/DbManager.Desktop/Image/export.png
Develop/DbManager.Desktop/Image/export.png
Develop/DbManager.Desktop/Image/export.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/hidden.png

257 字节 | W: | H:

Develop/DbManager.Desktop/Image/hidden.png

702 字节 | W: | H:

Develop/DbManager.Desktop/Image/hidden.png
Develop/DbManager.Desktop/Image/hidden.png
Develop/DbManager.Desktop/Image/hidden.png
Develop/DbManager.Desktop/Image/hidden.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/import.png

268 字节 | W: | H:

Develop/DbManager.Desktop/Image/import.png

489 字节 | W: | H:

Develop/DbManager.Desktop/Image/import.png
Develop/DbManager.Desktop/Image/import.png
Develop/DbManager.Desktop/Image/import.png
Develop/DbManager.Desktop/Image/import.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/rerun.png

342 字节 | W: | H:

Develop/DbManager.Desktop/Image/rerun.png

962 字节 | W: | H:

Develop/DbManager.Desktop/Image/rerun.png
Develop/DbManager.Desktop/Image/rerun.png
Develop/DbManager.Desktop/Image/rerun.png
Develop/DbManager.Desktop/Image/rerun.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/save.png

271 字节 | W: | H:

Develop/DbManager.Desktop/Image/save.png

258 字节 | W: | H:

Develop/DbManager.Desktop/Image/save.png
Develop/DbManager.Desktop/Image/save.png
Develop/DbManager.Desktop/Image/save.png
Develop/DbManager.Desktop/Image/save.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/show.png

263 字节 | W: | H:

Develop/DbManager.Desktop/Image/show.png

301 字节 | W: | H:

Develop/DbManager.Desktop/Image/show.png
Develop/DbManager.Desktop/Image/show.png
Develop/DbManager.Desktop/Image/show.png
Develop/DbManager.Desktop/Image/show.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/user.png

738 字节 | W: | H:

Develop/DbManager.Desktop/Image/user.png

420 字节 | W: | H:

Develop/DbManager.Desktop/Image/user.png
Develop/DbManager.Desktop/Image/user.png
Develop/DbManager.Desktop/Image/user.png
Develop/DbManager.Desktop/Image/user.png
  • 2-up
  • Swipe
  • Onion skin
Develop/DbManager.Desktop/Image/文件夹.png

173 字节 | W: | H:

Develop/DbManager.Desktop/Image/文件夹.png

144 字节 | W: | H:

Develop/DbManager.Desktop/Image/文件夹.png
Develop/DbManager.Desktop/Image/文件夹.png
Develop/DbManager.Desktop/Image/文件夹.png
Develop/DbManager.Desktop/Image/文件夹.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -28,6 +28,65 @@ namespace DBInStudio.Desktop
this.DataContext = new MainViewModel();
}
private void closeB_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void minB_Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}
private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
//(sender as Grid).CaptureMouse();
if (e.ClickCount > 1)
{
if (WindowState == WindowState.Maximized)
{
WindowState = WindowState.Normal;
}
else
{
WindowState = WindowState.Maximized;
}
}
else
{
this.DragMove();
}
}
private void Grid_MouseMove(object sender, MouseEventArgs e)
{
if(e.LeftButton == MouseButtonState.Pressed)
{
if(WindowState == WindowState.Maximized)
{
WindowState = WindowState.Normal;
}
}
}
private void Grid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
}
private void maxB_Click(object sender, RoutedEventArgs e)
{
if (WindowState == WindowState.Maximized)
{
WindowState = WindowState.Normal;
}
else
{
WindowState = WindowState.Maximized;
}
}
private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
(this.DataContext as MainViewModel).CurrentSelectGroup = tv.SelectedItem as TreeItemViewModel;
......@@ -66,5 +125,7 @@ namespace DBInStudio.Desktop
(sender as TextBox).SelectAll();
(sender as TextBox).Focus();
}
}
}
......@@ -357,6 +357,15 @@ namespace DBInStudio.Desktop.Properties {
}
}
/// <summary>
/// 查找类似 Welcome to Mars realtime iot database 的本地化字符串。
/// </summary>
internal static string MarsTitle {
get {
return ResourceManager.GetString("MarsTitle", resourceCulture);
}
}
/// <summary>
/// 查找类似 MaxValue 的本地化字符串。
/// </summary>
......
......@@ -218,6 +218,9 @@
<data name="MainwindowTitle" xml:space="preserve">
<value>Mars database developer</value>
</data>
<data name="MarsTitle" xml:space="preserve">
<value>Welcome to Mars realtime iot database</value>
</data>
<data name="MaxValue" xml:space="preserve">
<value>MaxValue</value>
</data>
......
......@@ -2,7 +2,7 @@
"profiles": {
"DBInStudio.Desktop": {
"commandName": "Executable",
"executablePath": "C:\\Users\\cdy81\\source\\repos\\mars\\Output\\DBInStudio.exe"
"executablePath": "C:\\Users\\chongdaoyang\\source\\repos\\mars\\Output\\DBInStudio.exe"
}
}
}
\ No newline at end of file
......@@ -63,6 +63,10 @@
<view:LinearConvertView />
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:MarInfoViewModel}">
<view:MarInfoView />
</DataTemplate>
<BooleanToVisibilityConverter x:Key="bvc" />
<Style TargetType="{x:Type local:CustomWindowBase}">
......@@ -151,7 +155,7 @@
<Border x:Name="border" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" SnapsToDevicePixels="true">
<Grid>
<!--<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>-->
<Image x:Name="contentPresenter" Source="/DBInStudio;component/Image/hidden.png" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<Image x:Name="contentPresenter" Source="/DBInStudio;component/Image/hidden.png" Width="16" Height="8" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
......@@ -159,15 +163,17 @@
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="Background" TargetName="border" Value="#1FFFFFFF"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="Background" TargetName="border" Value="#1FFFFFFF"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Source" TargetName="contentPresenter" Value="/DBInStudio;component/Image/show.png"/>
<Setter Property="Height" TargetName="contentPresenter" Value="16"/>
<Setter Property="Width" TargetName="contentPresenter" Value="24"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
......@@ -184,9 +190,9 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<PasswordBox x:Name="pb" VerticalContentAlignment="Center" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
<TextBox x:Name="tb" VerticalContentAlignment="Center" Text="{Binding Password,Mode=TwoWay,RelativeSource={RelativeSource Mode=TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
<ToggleButton Background="Transparent" BorderThickness="0" Margin="10,0,0,0" Grid.Column="1" IsChecked="{Binding IsShowPassword,Mode=TwoWay,RelativeSource={RelativeSource Mode=TemplatedParent},UpdateSourceTrigger=PropertyChanged}" Width="30" Height="24" >
<PasswordBox x:Name="pb" Foreground="{TemplateBinding Foreground}" Background="{TemplateBinding Background}" VerticalContentAlignment="Center" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
<TextBox Foreground="{TemplateBinding Foreground}" Background="{TemplateBinding Background}" x:Name="tb" VerticalContentAlignment="Center" Text="{Binding Password,Mode=TwoWay,RelativeSource={RelativeSource Mode=TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
<ToggleButton Style="{StaticResource ToggleButtonStyle1}" Background="Transparent" BorderThickness="0" Margin="10,0,0,0" Grid.Column="1" IsChecked="{Binding IsShowPassword,Mode=TwoWay,RelativeSource={RelativeSource Mode=TemplatedParent},UpdateSourceTrigger=PropertyChanged}" Width="30" Height="24" >
<Image Source="/Image/show.png" />
</ToggleButton>
</Grid>
......
<UserControl x:Class="DBInStudio.Desktop.View.MarInfoView"
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:DBInStudio.Desktop.View"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Opacity="0.1" Foreground="White" HorizontalAlignment="Center" Margin="0,0,0,20" Text="{Binding MarsTitle}" FontSize="56" TextWrapping="Wrap" VerticalAlignment="Bottom" FontFamily="Microsoft YaHei" FontWeight="Bold" />
<TextBlock Opacity="0.1" Foreground="White" HorizontalAlignment="Center" Margin="0,20,0,0" Text="{Binding TimeString}" FontSize="56" TextWrapping="Wrap" VerticalAlignment="Top" Grid.Row="1" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DBInStudio.Desktop.View
{
/// <summary>
/// MarInfoView.xaml 的交互逻辑
/// </summary>
public partial class MarInfoView : UserControl
{
public MarInfoView()
{
InitializeComponent();
}
}
}
......@@ -5,11 +5,112 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DBInStudio.Desktop.View"
xmlns:res="clr-namespace:DBInStudio.Desktop"
mc:Ignorable="d"
mc:Ignorable="d" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=Window}}"
xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<res:IndexConverter x:Key="ic" />
<BooleanToVisibilityConverter x:Key="btv" />
<Style x:Key="DataGridRowStyle1" TargetType="{x:Type DataGridRow}">
<Setter Property="Background" Value="#1FFFFFFF"/>
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
<Setter Property="ValidationErrorTemplate">
<Setter.Value>
<ControlTemplate>
<TextBlock Foreground="Red" Margin="2,0,0,0" Text="!" VerticalAlignment="Center"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRow}">
<Border x:Name="DGR_Border" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" SnapsToDevicePixels="True">
<SelectiveScrollingGrid>
<SelectiveScrollingGrid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</SelectiveScrollingGrid.ColumnDefinitions>
<SelectiveScrollingGrid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</SelectiveScrollingGrid.RowDefinitions>
<DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<DataGridDetailsPresenter Grid.Column="1" Grid.Row="1" SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Visibility="{TemplateBinding DetailsVisibility}"/>
<DataGridRowHeader Grid.RowSpan="2" SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HeadersVisibility, Converter={x:Static DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</SelectiveScrollingGrid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsNewItem" Value="True">
<Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</Trigger>
</Style.Triggers>
</Style>
<SolidColorBrush x:Key="{x:Static DataGrid.FocusBorderBrushKey}" Color="#FF000000"/>
<Style x:Key="DataGridCellStyle1" TargetType="{x:Type DataGridCell}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" SnapsToDevicePixels="True">
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static DataGrid.FocusBorderBrushKey}}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
<Setter Property="Width" Value="8"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Cursor" Value="SizeWE"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DataGridColumnHeaderStyle1" TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}"/>
<Setter Property="Height" Value="28"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<Grid>
<theme:DataGridHeaderBorder Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" IsClickable="{TemplateBinding CanUserSort}" IsPressed="{TemplateBinding IsPressed}" IsHovered="{TemplateBinding IsMouseOver}" Padding="{TemplateBinding Padding}" SeparatorBrush="{TemplateBinding SeparatorBrush}" SortDirection="{TemplateBinding SortDirection}" SeparatorVisibility="{TemplateBinding SeparatorVisibility}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</theme:DataGridHeaderBorder>
<Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}"/>
<Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
......@@ -18,14 +119,14 @@
<RowDefinition Height="32"/>
</Grid.RowDefinitions>
<Border BorderBrush="Gray" BorderThickness="0,0,0,1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Label Content="{res:ResMarker PermissionList}" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Center"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker PermissionList}" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Center"/>
</Border>
<DataGrid ItemsSource="{Binding Permissions}" SelectedItem="{Binding CurrentSelected}" Background="Transparent" BorderThickness="0,0,0,1" Grid.Row="1" CanUserAddRows="False" CanUserDeleteRows="False" AutoGenerateColumns="False" MinRowHeight="24">
<DataGrid RowHeaderWidth="0" ColumnHeaderStyle="{DynamicResource DataGridColumnHeaderStyle1}" CellStyle="{DynamicResource DataGridCellStyle1}" RowStyle="{DynamicResource DataGridRowStyle1}" ItemsSource="{Binding Permissions}" SelectedItem="{Binding CurrentSelected}" Background="Transparent" BorderThickness="0,0,0,1" Grid.Row="1" CanUserAddRows="False" CanUserDeleteRows="False" AutoGenerateColumns="False" MinRowHeight="24">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="Auto" MinWidth="30" Header="{res:ResMarker Id}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" >
<TextBlock Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" HorizontalAlignment="Center" VerticalAlignment="Center" >
<TextBlock.Text>
<MultiBinding Converter="{StaticResource ic}">
<Binding />
......@@ -41,12 +142,12 @@
<DataGridTemplateColumn Header="{res:ResMarker Name}" Width="100">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="5,0" Text="{Binding Name}" VerticalAlignment="Center" />
<TextBlock Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="5,0" Text="{Binding Name}" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Margin="0,0" IsReadOnly="{Binding IsNameReadOnly}" IsEnabled="{Binding IsEnableEdit}" Padding="4,0" BorderThickness="0" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<TextBox Background="#1FFFFFFF" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="0,0" IsReadOnly="{Binding IsNameReadOnly}" IsEnabled="{Binding IsEnableEdit}" Padding="4,0" BorderThickness="0" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -55,12 +156,12 @@
<DataGridTemplateColumn Header="{res:ResMarker Desc}" Width="200">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="5,0" Text="{Binding Desc}" VerticalAlignment="Center" />
<TextBlock Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="5,0" Text="{Binding Desc}" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Margin="0,0" Padding="4,0" IsEnabled="{Binding IsEnableEdit}" BorderThickness="0" Text="{Binding Desc,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<TextBox Background="#1FFFFFFF" Margin="0,0" Padding="4,0" IsEnabled="{Binding IsEnableEdit}" BorderThickness="0" Text="{Binding Desc,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -69,7 +170,7 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox VerticalAlignment="Center" IsEnabled="{Binding IsEnableEdit}" IsChecked="{Binding EnableWrite,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="5,0" />
<CheckBox BorderBrush="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" VerticalAlignment="Center" IsEnabled="{Binding IsEnableEdit}" IsChecked="{Binding EnableWrite,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="5,0" />
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
......@@ -78,14 +179,14 @@
<DataGridTemplateColumn Header="{res:ResMarker Group}" Width="*" MinWidth="100">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="5,0" Text="{Binding GroupString}" VerticalAlignment="Center" />
<TextBlock Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="5,0" Text="{Binding GroupString}" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBox Margin="0,0" Padding="4,0" IsEnabled="{Binding IsEnableEdit}" MinWidth="200" BorderThickness="0" Text="{Binding GroupString,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<Button Margin="10,0,0,0" Content="..." IsEnabled="{Binding IsEnableEdit}" MinWidth="40" VerticalAlignment="Center" VerticalContentAlignment="Top" Command="{Binding GroupEditCommand}" />
<TextBox Background="#1FFFFFFF" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="0,0" Padding="4,0" IsEnabled="{Binding IsEnableEdit}" MinWidth="200" BorderThickness="0" Text="{Binding GroupString,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<Button Background="#1FFFFFFF" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="10,0,0,0" Content="..." IsEnabled="{Binding IsEnableEdit}" MinWidth="40" VerticalAlignment="Center" VerticalContentAlignment="Top" Command="{Binding GroupEditCommand}" />
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
......@@ -100,7 +201,7 @@
<StackPanel Orientation="Horizontal" Margin="0">
<Image Source="/Image/Add.png" Height="12" RenderOptions.BitmapScalingMode="NearestNeighbor" Margin="0,0,4,0"/>
<TextBlock Text="{Binding}" Grid.Column="1" />
<TextBlock Text="{Binding}" Grid.Column="1" />
</StackPanel>
</DataTemplate>
</Button.ContentTemplate>
......
......@@ -80,14 +80,14 @@
<RowDefinition Height="32"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ListBox SelectionMode="Extended" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" Grid.Row="1" Margin="9,6,0,12" HorizontalAlignment="Left" Width="300" ItemsSource="{Binding SelectGroups}">
<ListBox Background="Transparent" SelectionMode="Extended" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" Grid.Row="1" Margin="9,6,0,12" HorizontalAlignment="Left" Width="300" ItemsSource="{Binding SelectGroups}">
<ListBox.ItemTemplate>
<DataTemplate>
<Label Content="{Binding Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox SelectionMode="Extended" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" Grid.Row="1" Margin="408,6,0,12" HorizontalAlignment="Left" Width="300" ItemsSource="{Binding AllGroups}">
<ListBox Background="Transparent" SelectionMode="Extended" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" Grid.Row="1" Margin="408,6,0,12" HorizontalAlignment="Left" Width="300" ItemsSource="{Binding AllGroups}">
<ListBox.ItemTemplate>
<DataTemplate>
<Label Content="{Binding Name}" />
......
......@@ -19,13 +19,13 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="333*"/>
</Grid.ColumnDefinitions>
<Label Content="{res:ResMarker UserName,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
<TextBox Text="{Binding UserName}" Grid.Column="1" HorizontalAlignment="Left" Margin="10,0,0,0" Height=" 26" TextWrapping="Wrap" VerticalAlignment="Center" Width="260" IsReadOnly="True"/>
<Label Content="{res:ResMarker Password,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="1"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker UserName,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
<TextBox Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Background="#1FFFFFFF" VerticalContentAlignment="Center" Text="{Binding UserName}" Grid.Column="1" HorizontalAlignment="Left" Margin="10,0,0,0" Height=" 26" TextWrapping="Wrap" VerticalAlignment="Center" Width="260" IsReadOnly="True"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker Password,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="1"/>
<res:PasswordControl BorderBrush="Gray" BorderThickness="1" Password="{Binding Password,Mode=TwoWay}" Grid.Column="1" Grid.Row="1" Margin="10,0,0,0" Width="300" VerticalAlignment="Center" Height="26" HorizontalAlignment="Left"/>
<Label Content="{res:ResMarker PasswordNew,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="2"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker PasswordNew,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="2"/>
<res:PasswordControl BorderBrush="Gray" BorderThickness="1" Password="{Binding NewPassword, Mode=TwoWay}" Grid.Column="1" Grid.Row="2" Margin="10,0,0,0" Width="300" VerticalAlignment="Center" Height="26" HorizontalAlignment="Left"/>
<Label Content="{res:ResMarker PasswordConfirm, :}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="3"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker PasswordConfirm, :}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="3"/>
<res:PasswordControl BorderBrush="Gray" BorderThickness="1" Password="{Binding ConfirmPassword, Mode=TwoWay}" Grid.Column="1" Grid.Row="3" Margin="10,0,0,0" Width="300" VerticalAlignment="Center" Height="26" HorizontalAlignment="Left"/>
<Button Content="{res:ResMarker Modify}" Command="{Binding ModifyCommand}" Grid.Column="1" HorizontalAlignment="Left" Margin="9,16,0,0" Grid.Row="4" VerticalAlignment="Top" Width="124" Height="31"/>
</Grid>
......
......@@ -5,8 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DBInStudio.Desktop.View"
xmlns:res="clr-namespace:DBInStudio.Desktop"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Background="White">
mc:Ignorable="d" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=Window}}"
d:DesignHeight="450" d:DesignWidth="800" >
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="btv" />
<res:BoolInvertConvert x:Key="bic" />
......@@ -29,6 +29,42 @@
</Setter.Value>
</Setter>
</Style>
<SolidColorBrush x:Key="ListBox.Static.Background" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="ListBox.Static.Border" Color="#FFABADB3"/>
<SolidColorBrush x:Key="ListBox.Disabled.Background" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="ListBox.Disabled.Border" Color="#FFD9D9D9"/>
<Style x:Key="ListBoxStyle1" TargetType="{x:Type ListBox}">
<Setter Property="Background" Value="{StaticResource ListBox.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource ListBox.Static.Border}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Padding="1" SnapsToDevicePixels="true">
<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true"/>
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
......@@ -38,29 +74,29 @@
<RowDefinition Height="32"/>
</Grid.RowDefinitions>
<Border BorderBrush="Gray" BorderThickness="0,0,0,1"/>
<Label Content="{res:ResMarker UserList}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ListBox ItemsSource="{Binding Users}" HorizontalContentAlignment="Stretch" SelectedItem="{Binding CurrentSelectedUser}" Grid.Row="1" HorizontalAlignment="Left" Width="300" Margin="5,5,0,1">
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker UserList}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ListBox Background="#1FFFFFFF" ItemsSource="{Binding Users}" HorizontalContentAlignment="Stretch" SelectedItem="{Binding CurrentSelectedUser}" Grid.Row="1" HorizontalAlignment="Left" Width="300" Margin="5,5,0,1">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch" Height="26">
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" />
<TextBox Margin="-5,-1" Loaded="TextBox_Loaded" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Visibility="{Binding IsEdit,Converter={StaticResource btv}}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Keyboard.KeyDown="TextBox_KeyDown" />
<TextBlock Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Text="{Binding Name}" VerticalAlignment="Center" />
<TextBox Background="#1FFFFFFF" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="-5,-1" Loaded="TextBox_Loaded" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Visibility="{Binding IsEdit,Converter={StaticResource btv}}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Keyboard.KeyDown="TextBox_KeyDown" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Command="{Binding AddCommand}" Content="{res:ResMarker Add}" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="2" VerticalAlignment="Center" Width="94" Height="26">
<Button BorderBrush="Gray" Command="{Binding AddCommand}" Content="{res:ResMarker Add}" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="2" VerticalAlignment="Center" Width="94" Height="26">
<Button.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0">
<Image Source="/Image/Add.png" Height="12" RenderOptions.BitmapScalingMode="NearestNeighbor" Margin="0,0,4,0"/>
<TextBlock Text="{Binding}" Grid.Column="1" />
<TextBlock Text="{Binding}" Grid.Column="1" />
</StackPanel>
</DataTemplate>
</Button.ContentTemplate>
</Button>
<Button Command="{Binding RemoveCommand}" Content="{res:ResMarker Remove}" HorizontalAlignment="Left" Margin="110,0,0,0" Grid.Row="2" VerticalAlignment="Center" Width="94" Height="26">
<Button BorderBrush="Gray" Command="{Binding RemoveCommand}" Content="{res:ResMarker Remove}" HorizontalAlignment="Left" Margin="110,0,0,0" Grid.Row="2" VerticalAlignment="Center" Width="94" Height="26">
<Button.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0">
......@@ -83,25 +119,25 @@
<RowDefinition Height="32"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Content="{res:ResMarker UserName,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
<Label Content="{res:ResMarker Password,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="1"/>
<Label Content="{res:ResMarker IsAdmin,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="2"/>
<Label Content="{res:ResMarker NewDatabase,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="3"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker UserName,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker Password,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="1"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker IsAdmin,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="2"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker NewDatabase,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="3"/>
<Label Content="{res:ResMarker Database,:}" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Grid.Row="4"/>
<TextBox VerticalContentAlignment="Center" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="300" Height="26" Grid.Column="1" KeyDown="TextBox_KeyDown" />
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker Database,:}" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Grid.Row="4"/>
<TextBox Background="#1FFFFFFF" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" VerticalContentAlignment="Center" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="300" Height="26" Grid.Column="1" KeyDown="TextBox_KeyDown" />
<!--<PasswordBox HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="10,0,0,0" VerticalAlignment="Center" Width="300" Height="26" Grid.Column="1" Password="123456" Grid.Row="1" PasswordChanged="PasswordBox_PasswordChanged"/>-->
<res:PasswordControl BorderBrush="Gray" BorderThickness="1" Password="{Binding Password,Mode=TwoWay}" Grid.Column="1" Grid.Row="1" Margin="10,0,0,0" Width="300" VerticalAlignment="Center" Height="26" HorizontalAlignment="Left"/>
<ListBox ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" IsEnabled="{Binding IsAdmin,Converter={StaticResource bic}}" ItemsSource="{Binding PermissionModel}" Grid.Column="1" Grid.Row="4" Margin="10,10,0,0" Width="300" HorizontalAlignment="Left" >
<res:PasswordControl BorderBrush="Gray" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" BorderThickness="1" Password="{Binding Password,Mode=TwoWay}" Grid.Column="1" Grid.Row="1" Margin="10,0,0,0" Width="300" VerticalAlignment="Center" Height="26" HorizontalAlignment="Left"/>
<ListBox Style="{DynamicResource ListBoxStyle1}" Background="#1FFFFFFF" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" IsEnabled="{Binding IsAdmin,Converter={StaticResource bic}}" ItemsSource="{Binding PermissionModel}" Grid.Column="1" Grid.Row="4" Margin="10,10,0,0" Width="300" HorizontalAlignment="Left" >
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Content="{Binding Name}" />
<CheckBox BorderBrush="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Content="{Binding Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<CheckBox Grid.Column="1" IsChecked="{Binding IsAdmin,Mode=TwoWay}" HorizontalAlignment="Left" Margin="10,0,0,0" Grid.Row="2" VerticalAlignment="Center"/>
<CheckBox Grid.Column="1" IsChecked="{Binding CanNewDatabase,Mode=TwoWay}" HorizontalAlignment="Left" Margin="10,0,0,0" Grid.Row="3" VerticalAlignment="Center"/>
<CheckBox BorderBrush="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Background="#1FFFFFFF" Grid.Column="1" IsChecked="{Binding IsAdmin,Mode=TwoWay}" HorizontalAlignment="Left" Margin="10,0,0,0" Grid.Row="2" VerticalAlignment="Center"/>
<CheckBox BorderBrush="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Background="#1FFFFFFF" Grid.Column="1" IsChecked="{Binding CanNewDatabase,Mode=TwoWay}" HorizontalAlignment="Left" Margin="10,0,0,0" Grid.Row="3" VerticalAlignment="Center"/>
</Grid>
......
......@@ -5,8 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DBInStudio.Desktop.View"
xmlns:res="clr-namespace:DBInStudio.Desktop"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Background="White">
mc:Ignorable="d" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=Window}}"
d:DesignHeight="450" d:DesignWidth="800" >
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="btv" />
......@@ -38,18 +38,18 @@
<RowDefinition Height="32"/>
</Grid.RowDefinitions>
<Border BorderBrush="Gray" BorderThickness="0,0,0,1"/>
<Label Content="{res:ResMarker UserList}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ListBox ItemsSource="{Binding Users}" HorizontalContentAlignment="Stretch" SelectedItem="{Binding CurrentSelectedUser}" Grid.Row="1" HorizontalAlignment="Left" Width="300" Margin="5,5,0,0">
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker UserList}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ListBox Background="#1FFFFFFF" ItemsSource="{Binding Users}" HorizontalContentAlignment="Stretch" SelectedItem="{Binding CurrentSelectedUser}" Grid.Row="1" HorizontalAlignment="Left" Width="300" Margin="5,5,0,0">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch" Height="26">
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" />
<TextBox Margin="-5,-1" Loaded="TextBox_Loaded" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Visibility="{Binding IsEdit,Converter={StaticResource btv}}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Keyboard.KeyDown="TextBox_KeyDown" />
<TextBlock Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Text="{Binding Name}" VerticalAlignment="Center" />
<TextBox Background="#1FFFFFFF" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="-5,-1" Loaded="TextBox_Loaded" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Visibility="{Binding IsEdit,Converter={StaticResource btv}}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Keyboard.KeyDown="TextBox_KeyDown" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Command="{Binding AddCommand}" Content="{res:ResMarker Add}" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="2" VerticalAlignment="Center" Width="94" Height="26">
<Button BorderBrush="Gray" Command="{Binding AddCommand}" Content="{res:ResMarker Add}" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="2" VerticalAlignment="Center" Width="94" Height="26">
<Button.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0">
......@@ -60,7 +60,7 @@
</DataTemplate>
</Button.ContentTemplate>
</Button>
<Button Command="{Binding RemoveCommand}" Content="{res:ResMarker Remove}" HorizontalAlignment="Left" Margin="110,0,0,0" Grid.Row="2" VerticalAlignment="Center" Width="94" Height="26">
<Button BorderBrush="Gray" Command="{Binding RemoveCommand}" Content="{res:ResMarker Remove}" HorizontalAlignment="Left" Margin="110,0,0,0" Grid.Row="2" VerticalAlignment="Center" Width="94" Height="26">
<Button.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0">
......@@ -81,16 +81,16 @@
<RowDefinition Height="32"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Content="{res:ResMarker UserName,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
<Label Content="{res:ResMarker Password,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="1"/>
<Label Content="{res:ResMarker Permission,:}" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Grid.Row="2"/>
<TextBox IsEnabled="{Binding IsNew}" VerticalContentAlignment="Center" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="300" Height="26" Grid.Column="1" />
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker UserName,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker Password,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="1"/>
<Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{res:ResMarker Permission,:}" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Grid.Row="2"/>
<TextBox Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Background="#1FFFFFFF" IsEnabled="{Binding IsNew}" VerticalContentAlignment="Center" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="300" Height="26" Grid.Column="1" />
<!--<PasswordBox HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="10,0,0,0" VerticalAlignment="Center" Width="300" Height="26" Grid.Column="1" Password="123456" Grid.Row="1" PasswordChanged="PasswordBox_PasswordChanged"/>-->
<res:PasswordControl BorderBrush="Gray" BorderThickness="1" Password="{Binding Password,Mode=TwoWay}" Grid.Column="1" Grid.Row="1" Margin="10,0,0,0" Width="300" VerticalAlignment="Center" Height="26" HorizontalAlignment="Left"/>
<ListBox ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" ItemsSource="{Binding PermissionModel}" Grid.Column="1" Grid.Row="2" Margin="10,10,0,0" Width="300" HorizontalAlignment="Left" >
<res:PasswordControl Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" BorderBrush="Gray" BorderThickness="1" Password="{Binding Password,Mode=TwoWay}" Grid.Column="1" Grid.Row="1" Margin="10,0,0,0" Width="300" VerticalAlignment="Center" Height="26" HorizontalAlignment="Left"/>
<ListBox Background="#1FFFFFFF" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" ItemsSource="{Binding PermissionModel}" Grid.Column="1" Grid.Row="2" Margin="10,10,0,0" Width="300" HorizontalAlignment="Left" >
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Content="{Binding Name}" />
<CheckBox Background="#1FFFFFFF" BorderBrush="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Content="{Binding Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
......
......@@ -79,6 +79,8 @@ namespace DBInStudio.Desktop
private System.Timers.Timer mCheckRunningTimer;
private MarInfoViewModel infoModel;
#endregion ...Variables...
#region ... Events ...
......@@ -96,6 +98,10 @@ namespace DBInStudio.Desktop
CurrentUserManager.Manager.RefreshNameEvent += Manager_RefreshNameEvent;
mCheckRunningTimer = new System.Timers.Timer(1000);
mCheckRunningTimer.Elapsed += MCheckRunningTimer_Elapsed;
infoModel = new MarInfoViewModel();
mContentViewModel = infoModel;
}
......@@ -810,7 +816,7 @@ namespace DBInStudio.Desktop
if (ContentViewModel != null)
ContentViewModel.Dispose();
ContentViewModel = null;
ContentViewModel = infoModel;
Database = string.Empty;
StopCheckDatabaseRunning();
}
......@@ -897,6 +903,8 @@ namespace DBInStudio.Desktop
if(mCurrentSelectTreeItem!=null)
ContentViewModel = mCurrentSelectTreeItem.GetModel(ContentViewModel);
if (ContentViewModel == null) ContentViewModel = infoModel;
if (ContentViewModel is IModeSwitch)
{
(ContentViewModel as IModeSwitch).Active();
......
//==============================================================
// Copyright (C) 2020 Inc. All rights reserved.
//
//==============================================================
// Create by 种道洋 at 2020/8/18 18:02:26.
// Version 1.0
// 种道洋
//==============================================================
using System;
using System.Collections.Generic;
using System.Text;
namespace DBInStudio.Desktop.ViewModel
{
/// <summary>
///
/// </summary>
public class MarInfoViewModel: ViewModelBase
{
#region ... Variables ...
private string mTimeString;
private System.Timers.Timer tim;
#endregion ...Variables...
#region ... Events ...
#endregion ...Events...
#region ... Constructor...
/// <summary>
///
/// </summary>
public MarInfoViewModel()
{
tim = new System.Timers.Timer();
tim.Interval = 1000;
tim.Elapsed += Tim_Elapsed;
tim.Start();
}
#endregion ...Constructor...
#region ... Properties ...
/// <summary>
///
/// </summary>
public string MarsTitle
{
get
{
return Res.Get("MarsTitle");
}
}
public string TimeString
{
get
{
return mTimeString;
}
set
{
mTimeString = value;
OnPropertyChanged("TimeString");
}
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Tim_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
TimeString = DateTime.Now.ToString();
}
#endregion ...Properties...
#region ... Methods ...
public override void Dispose()
{
tim.Stop();
tim.Dispose();
base.Dispose();
}
#endregion ...Methods...
#region ... Interfaces ...
#endregion ...Interfaces...
}
}
......@@ -1127,10 +1127,11 @@ namespace DBInStudio.Desktop
#endregion ...Constructor...
#region ... Properties ...
#endregion ...Properties...
#region ... Methods ...
/// <summary>
///
/// </summary>
......@@ -1150,6 +1151,11 @@ namespace DBInStudio.Desktop
{
return false;
}
public override void Dispose()
{
base.Dispose();
}
#endregion ...Methods...
#region ... Interfaces ...
......
......@@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
<PackageReference Include="Google.Protobuf" Version="3.12.2" />
<PackageReference Include="Grpc.Net.Client" Version="2.31.0" />
<PackageReference Include="Grpc.Tools" Version="2.31.0">
<PrivateAssets>all</PrivateAssets>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册