6 changed files with 209 additions and 1 deletions
@ -0,0 +1,122 @@ |
|||||
|
<Window x:Class="SunlightAggregationManager.UserWindow.MachineSet" |
||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
|
xmlns:local="clr-namespace:SunlightAggregationManager.UserWindow" |
||||
|
xmlns:ConvertMoels="clr-namespace:SunlightAggregationManager.ConvertMoels" |
||||
|
xmlns:lang="clr-namespace:SunlightAggregationManager" |
||||
|
xmlns:viewmodel="clr-namespace:SunlightAggregationManager.ViewModel" |
||||
|
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}" |
||||
|
mc:Ignorable="d" |
||||
|
Title="MachineSet" |
||||
|
Loaded="Window_Loaded" |
||||
|
ResizeMode="NoResize" |
||||
|
Height="900" Width="1440" MinHeight="900" MinWidth="1440"> |
||||
|
<Grid> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition Height="5"/> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition Height="100"/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" Background="#FFCECECE"/> |
||||
|
<Grid Grid.Row="0"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition MinWidth="200" MaxWidth="500"/> |
||||
|
<ColumnDefinition Width="5"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch" Background="#FFCECECE"/> |
||||
|
<Grid Grid.Column="0"> |
||||
|
<!--用户--> |
||||
|
<TextBox x:Name="_User" Height="30" Margin="105,10,10,100" VerticalAlignment="Top" FontSize="16" MaxLines="1" InputMethod.IsInputMethodEnabled="False" /> |
||||
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,10,0,100" TextWrapping="Wrap" |
||||
|
Text="{x:Static lang:ResourceLanguage.user}" VerticalAlignment="Top" Width="85" FontSize="20"/> |
||||
|
|
||||
|
<!--组--> |
||||
|
<ComboBox x:Name="GROUP" Height="30" Margin="105,190,10,100" VerticalAlignment="Top" FontSize="16" IsReadOnly="True"> |
||||
|
<ComboBoxItem Content="CHIEF"></ComboBoxItem> |
||||
|
<ComboBoxItem Content="ENGINEER"></ComboBoxItem> |
||||
|
<ComboBoxItem Content="POWERUSER"></ComboBoxItem> |
||||
|
<ComboBoxItem Content="USER"></ComboBoxItem> |
||||
|
</ComboBox> |
||||
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,190,0,50" TextWrapping="Wrap" |
||||
|
Text="{x:Static lang:ResourceLanguage.Groups}" VerticalAlignment="Top" Width="80" FontSize="20"/> |
||||
|
</Grid> |
||||
|
<Grid Grid.Column="2" Margin="0"> |
||||
|
<ScrollViewer Margin="0" VerticalScrollBarVisibility="Auto"> |
||||
|
<WrapPanel Orientation="Horizontal" x:Name="Capacity" > |
||||
|
</WrapPanel> |
||||
|
</ScrollViewer> |
||||
|
</Grid> |
||||
|
</Grid> |
||||
|
<!--表--> |
||||
|
<DataGrid Grid.Row="2" x:Name="DataGridm" MouseDoubleClick="DataGridm_MouseDoubleClick" |
||||
|
SelectionMode="Single" AlternationCount="2" IsReadOnly="True" |
||||
|
ItemsSource="{Binding Machines.DefaultView}" |
||||
|
AutoGenerateColumns="False" MinColumnWidth="30" |
||||
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" |
||||
|
GridLinesVisibility="All" BorderBrush="{x:Null}" |
||||
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" |
||||
|
HorizontalContentAlignment="Right" Grid.ColumnSpan="2" |
||||
|
CanUserResizeRows="False" CanUserAddRows="False" |
||||
|
CanUserDeleteRows="False" CanUserReorderColumns="False" |
||||
|
CanUserResizeColumns="False" CanUserSortColumns="False" |
||||
|
HeadersVisibility ="Column" Background="{x:Null}"> |
||||
|
<DataGrid.RowStyle > |
||||
|
<Style TargetType="{x:Type DataGridRow}"> |
||||
|
<Style.Triggers> |
||||
|
<Trigger Property="ItemsControl.AlternationIndex" Value="0"> |
||||
|
<Setter Property="Background" Value="#FFFFFFFF" /> |
||||
|
</Trigger> |
||||
|
<Trigger Property="ItemsControl.AlternationIndex" Value="1"> |
||||
|
<Setter Property="Background" Value="#FFF0F0F0" /> |
||||
|
</Trigger> |
||||
|
<Trigger Property="IsMouseOver" Value="False"> |
||||
|
</Trigger> |
||||
|
</Style.Triggers> |
||||
|
</Style> |
||||
|
</DataGrid.RowStyle> |
||||
|
<DataGrid.CellStyle> |
||||
|
<Style TargetType="DataGridCell"> |
||||
|
<Setter Property="BorderThickness" Value="0"/> |
||||
|
<Setter Property="MinWidth" Value="20"/> |
||||
|
<Style.Triggers> |
||||
|
<Trigger Property="IsSelected" Value="True"> |
||||
|
<Setter Property="Background" Value="#FFC0C0C0"/> |
||||
|
<Setter Property="BorderBrush" Value="#FFC0C0C0"/> |
||||
|
<Setter Property="Foreground" Value="#000000"/> |
||||
|
</Trigger> |
||||
|
</Style.Triggers> |
||||
|
</Style> |
||||
|
</DataGrid.CellStyle> |
||||
|
<DataGrid.Columns> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.information}" Width="200" FontSize="26" |
||||
|
Binding="{Binding Name}" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.machine}" Width="200" FontSize="26" |
||||
|
Binding="{Binding Machine}" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.state}" Width="150" FontSize="26" |
||||
|
Binding="{Binding State}" MinWidth="150" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.Mode}" Width="150" FontSize="26" |
||||
|
Binding="{Binding Model}" MinWidth="150" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="IP" Width="150" FontSize="26" |
||||
|
Binding="{Binding IP}" MinWidth="150" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="用户" Width="150" FontSize="26" |
||||
|
Binding="{Binding MachineUser}" MinWidth="150" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="密码" Width="150" FontSize="26" |
||||
|
Binding="{Binding MachinePassword}" MinWidth="150" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.information}" Width="*" FontSize="26" |
||||
|
Binding="{Binding Information}" MinWidth="200" CanUserReorder="False"/> |
||||
|
</DataGrid.Columns> |
||||
|
</DataGrid> |
||||
|
<!--存储按钮--> |
||||
|
<Button Grid.Row="3" Content="存储" HorizontalAlignment="Right" Height="50" VerticalAlignment="Center" Width="100" FontSize="30" |
||||
|
Click="Button_Preservation" Margin="0,0,200,0"> |
||||
|
</Button> |
||||
|
<!--删除按钮--> |
||||
|
<Button Grid.Row="3" Content="删除" HorizontalAlignment="Right" Height="50" VerticalAlignment="Center" Width="100" FontSize="30" |
||||
|
Click="Button_Delete" Margin="0,0,50,0"> |
||||
|
</Button> |
||||
|
</Grid> |
||||
|
</Window> |
||||
@ -0,0 +1,45 @@ |
|||||
|
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.Shapes; |
||||
|
|
||||
|
namespace SunlightAggregationManager.UserWindow |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// MachineSet.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class MachineSet : Window |
||||
|
{ |
||||
|
public MachineSet() |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
private void Button_Preservation(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void Button_Delete(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void DataGridm_MouseDoubleClick(object sender, MouseButtonEventArgs e) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void Window_Loaded(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue