更改V1
This commit is contained in:
173
OrpaonEMS.App/Views/ControlConfigView.xaml
Normal file
173
OrpaonEMS.App/Views/ControlConfigView.xaml
Normal file
@@ -0,0 +1,173 @@
|
||||
<UserControl
|
||||
x:Class="OrpaonEMS.App.Views.ControlConfigView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:keyboard="clr-namespace:KeyBoard.WPF.Behavior;assembly=KeyBoard.WPF"
|
||||
xmlns:local="clr-namespace:OrpaonEMS.App.Views"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
d:DesignHeight="708"
|
||||
d:DesignWidth="1024"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
Margin="5,5,5,5"
|
||||
Background="White"
|
||||
CornerRadius="10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect
|
||||
BlurRadius="20"
|
||||
Direction="280"
|
||||
Opacity="0.4"
|
||||
ShadowDepth="0"
|
||||
Color="DarkGray" />
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.Resources>
|
||||
<Style x:Key="TextIco" TargetType="TextBlock">
|
||||
<Setter Property="Margin" Value="0,2,10,2" />
|
||||
<Setter Property="FontSize" Value="20" />
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
<Setter Property="FontFamily" Value="../Assets/Fonts/#iconfont" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
</Style>
|
||||
<Style x:Key="StackPanelText" TargetType="StackPanel">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="5"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="../Assets/Fonts/#iconfont"
|
||||
FontSize="24"
|
||||
Foreground="Black"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
Margin="5"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="20"
|
||||
Foreground="#596B75"
|
||||
Text="Mqtt配置" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Style="{StaticResource StackPanelText}">
|
||||
<TextBlock Style="{StaticResource TextIco}" Text="" />
|
||||
<TextBox
|
||||
Width="100"
|
||||
VerticalAlignment="Center"
|
||||
materialDesign:HintAssist.Hint="IP地址"
|
||||
FontSize="14"
|
||||
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
|
||||
Text="{Binding ConfigDataService.MqttServerUrl}">
|
||||
<i:Interaction.Behaviors>
|
||||
<keyboard:NumericKeyboardBehavior />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource StackPanelText}">
|
||||
<TextBlock Style="{StaticResource TextIco}" Text="" />
|
||||
<TextBox
|
||||
Width="100"
|
||||
VerticalAlignment="Center"
|
||||
materialDesign:HintAssist.Hint="端口号"
|
||||
FontSize="14"
|
||||
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
|
||||
Text="{Binding ConfigDataService.MqttServerPort}">
|
||||
<i:Interaction.Behaviors>
|
||||
<keyboard:NumericKeyboardBehavior />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource StackPanelText}">
|
||||
<TextBlock Style="{StaticResource TextIco}" Text="" />
|
||||
<TextBox
|
||||
Width="100"
|
||||
VerticalAlignment="Center"
|
||||
materialDesign:HintAssist.Hint="用户名"
|
||||
FontSize="14"
|
||||
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
|
||||
Text="{Binding ConfigDataService.MqttUser}">
|
||||
<i:Interaction.Behaviors>
|
||||
<keyboard:KeyboardBehavior />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource StackPanelText}">
|
||||
<TextBlock Style="{StaticResource TextIco}" Text="" />
|
||||
<TextBox
|
||||
Width="100"
|
||||
VerticalAlignment="Center"
|
||||
materialDesign:HintAssist.Hint="密码"
|
||||
FontSize="14"
|
||||
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
|
||||
Text="{Binding ConfigDataService.MqttPwd}">
|
||||
<i:Interaction.Behaviors>
|
||||
<keyboard:KeyboardBehavior />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="3"
|
||||
Grid.ColumnSpan="2"
|
||||
Style="{StaticResource StackPanelText}">
|
||||
<TextBlock Style="{StaticResource TextIco}" Text="" />
|
||||
<TextBox
|
||||
Width="260"
|
||||
VerticalAlignment="Center"
|
||||
materialDesign:HintAssist.Hint="客户端标识"
|
||||
FontSize="14"
|
||||
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
|
||||
Text="{Binding ConfigDataService.MqttClientId}">
|
||||
<i:Interaction.Behaviors>
|
||||
<keyboard:KeyboardBehavior />
|
||||
</i:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="4"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,0,20,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center">
|
||||
<Button Command="{Binding BtnMqttConfigSave}" Content="保存配置" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
OrpaonEMS.App/Views/ControlConfigView.xaml.cs
Normal file
28
OrpaonEMS.App/Views/ControlConfigView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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 OrpaonEMS.App.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// ControlConfigView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ControlConfigView : UserControl
|
||||
{
|
||||
public ControlConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user