首次上传
This commit is contained in:
@@ -0,0 +1,217 @@
|
||||
<UserControl
|
||||
x:Class="MECF.Framework.UI.Client.CenterViews.LogOnOff.LogoffView"
|
||||
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="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:lex="http://wpflocalizeextension.codeplex.com"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
lex:LocalizeDictionary.DesignCulture="zh"
|
||||
lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_messagebox"
|
||||
mc:Ignorable="d">
|
||||
<Border
|
||||
Width="600"
|
||||
Height="480"
|
||||
Background="{DynamicResource Color_BG_Logoff}"
|
||||
BorderBrush="{DynamicResource Color_BD_Logoff}"
|
||||
BorderThickness="5">
|
||||
<Grid>
|
||||
<StackPanel
|
||||
Margin="0,0,0,25"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom"
|
||||
Orientation="Horizontal">
|
||||
<StackPanel.Effect>
|
||||
<DropShadowEffect
|
||||
BlurRadius="10"
|
||||
Opacity="0.7"
|
||||
ShadowDepth="0"
|
||||
Color="White" />
|
||||
</StackPanel.Effect>
|
||||
<Button
|
||||
x:Name="ID_BTN_Logoff_Content"
|
||||
Width="100"
|
||||
Height="40"
|
||||
Margin="0,0,6,0"
|
||||
Content="{lex:Loc}"
|
||||
ToolTip="{lex:Loc ID_BTN_Logoff_ToolTip}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Logoff" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="ID_BTN_Exit_UI_Content"
|
||||
Width="100"
|
||||
Height="40"
|
||||
Margin="0,0,6,0"
|
||||
Content="{lex:Loc}"
|
||||
ToolTip="{lex:Loc ID_BTN_Exit_UI_ToolTip}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Exit" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="ID_BTN_Shut_Down_Content"
|
||||
Width="100"
|
||||
Height="40"
|
||||
Margin="0,0,6,0"
|
||||
Content="{lex:Loc}"
|
||||
ToolTip="{lex:Loc ID_BTN_Shut_Down_ToolTip}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="ShutDown" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource ResourceKey={x:Type Button}}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Button.IsEnabled" Value="True" />
|
||||
<Style.Triggers>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding HasToken}" Value="True" />
|
||||
<Condition Binding="{Binding AllowShowDown}" Value="True" />
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Button.IsEnabled" Value="True" />
|
||||
</MultiDataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="ID_BTN_Cancel_Content"
|
||||
Width="100"
|
||||
Height="40"
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Content="{lex:Loc}"
|
||||
ToolTip="{lex:Loc ID_BTN_Cancel_ToolTip}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Cancel" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<Border
|
||||
Width="440"
|
||||
Height="200"
|
||||
Margin="0,0,0,50"
|
||||
Padding="1"
|
||||
BorderBrush="{DynamicResource Color_BD_Logoff_Info}"
|
||||
BorderThickness="5">
|
||||
<Grid Background="{DynamicResource Color_BG_Logoff_Info}" SnapsToDevicePixels="True">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="18"
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource Color_FG_TextBlack}"
|
||||
Text="{lex:Loc ID_TXT_Login_Information}" />
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="5,2"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource Color_FG_TextBlack}"
|
||||
Text="{lex:Loc ID_TXT_User}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBlock
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
FontWeight="Bold">
|
||||
:
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource Color_FG_InfoBar}"
|
||||
Text="{Binding LoginName}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBlock
|
||||
Margin="20,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource Color_FG_TextBlack}"
|
||||
Text="{lex:Loc ID_TXT_Logined_as}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBlock
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
FontWeight="Bold">
|
||||
:
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource Color_FG_InfoBar}"
|
||||
Text="{Binding RoleName}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="10,0,10,10"
|
||||
Padding="5,2"
|
||||
Background="{DynamicResource Color_BG_Logoff_Info}"
|
||||
BorderBrush="{DynamicResource Color_BD_Logoff_Info}"
|
||||
BorderThickness="1">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource Color_FG_TextBlack}"
|
||||
Text="{lex:Loc ID_TXT_Login_Date}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBlock
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
FontWeight="Bold">
|
||||
:
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock
|
||||
Margin="0,5,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource Color_FG_InfoBar}"
|
||||
Text="{Binding LoginTime}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.LogOnOff
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for LogoffView.xaml
|
||||
/// </summary>
|
||||
public partial class LogoffView : UserControl
|
||||
{
|
||||
public LogoffView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using OpenSEMI.ClientBase;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.LogOnOff
|
||||
{
|
||||
public class LogoffViewModel : DialogViewModel<UserMode>
|
||||
{
|
||||
public LogoffViewModel()
|
||||
{
|
||||
this.DisplayName = (string)Application.Current.Resources["AppName"];
|
||||
this.DialogResult = UserMode.None;
|
||||
this.LoginName = BaseApp.Instance.UserContext.LoginName;
|
||||
this.RoleName = BaseApp.Instance.UserContext.Role.RoleName;
|
||||
this.LoginTime = BaseApp.Instance.UserContext.LoginTime;
|
||||
}
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
//check some condition to set property AllowShowDown, system manual and PM busy
|
||||
// this.Token = BaseApp.Instance.UserContext.Token;
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
//this message can keep in resource file
|
||||
if (DialogBox.Confirm(string.Format("Are you sure that you want to {0}?", "exit")))
|
||||
{
|
||||
this.DialogResult = UserMode.Exit;
|
||||
this.TryClose(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShutDown()
|
||||
{
|
||||
if (DialogBox.Confirm(string.Format("Are you sure that you want to {0}?", "shutdown")))
|
||||
{
|
||||
this.DialogResult = UserMode.Shutdown;
|
||||
this.TryClose(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void Logoff()
|
||||
{
|
||||
this.DialogResult = UserMode.Logoff;
|
||||
this.TryClose();
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
this.DialogResult = UserMode.Normal;
|
||||
this.TryClose();
|
||||
}
|
||||
|
||||
private bool _AllowShowDown = false;
|
||||
public bool AllowShowDown
|
||||
{
|
||||
get { return _AllowShowDown; }
|
||||
set
|
||||
{
|
||||
_AllowShowDown = value;
|
||||
NotifyOfPropertyChange("AllowShowDown");
|
||||
}
|
||||
}
|
||||
|
||||
public string LoginName { get; private set; }
|
||||
public string RoleName { get; private set; }
|
||||
public DateTime LoginTime { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<Window x:Class="MECF.Framework.UI.Client.CenterViews.LogOnOff.ShutdownView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
WindowStyle="None"
|
||||
WindowStartupLocation="CenterScreen" ResizeMode="NoResize"
|
||||
Title="ShutdownView" Height="480" Width="600">
|
||||
<Grid Height="480" Width="600">
|
||||
<TextBlock Text="The system is in the process of shutting down."></TextBlock>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.LogOnOff
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ShutdownWindow.xaml
|
||||
/// </summary>
|
||||
public partial class ShutdownView : Window
|
||||
{
|
||||
public ShutdownView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using OpenSEMI.ClientBase;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.LogOnOff
|
||||
{
|
||||
public class ShutdownViewModel : BaseModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user