@@ -28,7 +28,7 @@ namespace BPASmartClient.CustomResource.Pages.View | |||
{ | |||
InitializeComponent(); | |||
//grid.Visibility = Visibility.Collapsed; | |||
Username.Focus(); | |||
//Username.Focus(); | |||
Username.SelectionStart = Username.Text.Trim().Length; | |||
this.Loaded += LoginView_Loaded; | |||
ActionManage.GetInstance.Register(new Action(() => | |||
@@ -55,6 +55,8 @@ namespace BPASmartClient.CustomResource.Pages.View | |||
//player.Unloaded += new RoutedEventHandler(media_Unloaded);// 添加元素卸载完成事件 -- 停止播放 | |||
//player.MediaOpened += Player_MediaOpened;//已播放事件 | |||
} | |||
grid.Visibility = Visibility.Visible; | |||
Username.Focus(); | |||
} | |||
private void Player_MediaOpened(object sender, RoutedEventArgs e) | |||
@@ -0,0 +1,52 @@ | |||
<Window | |||
x:Class="BPASmartClient.CustomResource.Pages.View.PromptView" | |||
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:local="clr-namespace:BPASmartClient.CustomResource.Pages.View" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
Title="PromptView" | |||
Width="400" | |||
Height="200" | |||
AllowsTransparency="True" | |||
Background="{x:Null}" | |||
WindowStartupLocation="CenterScreen" | |||
WindowStyle="None" | |||
mc:Ignorable="d"> | |||
<Grid> | |||
<Grid.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹窗.png" Stretch="Fill" /> | |||
</Grid.Background> | |||
<Grid Margin="18,16"> | |||
<Button | |||
Width="30" | |||
Height="20" | |||
HorizontalAlignment="Right" | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
Click="Button_Click" /> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.2*" /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Red" FontFamily="../../Fonts/#iconfont"/> | |||
</Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
<RowDefinition Height="0.7*" /> | |||
</Grid.RowDefinitions> | |||
</Grid> | |||
</Grid> | |||
</Window> |
@@ -0,0 +1,33 @@ | |||
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.Shapes; | |||
namespace BPASmartClient.CustomResource.Pages.View | |||
{ | |||
/// <summary> | |||
/// PromptView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class PromptView : Window | |||
{ | |||
public PromptView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private void Button_Click(object sender, RoutedEventArgs e) | |||
{ | |||
this.DialogResult = false; | |||
this.Close(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,230 @@ | |||
<UserControl | |||
x:Class="BPASmartClient.CustomResource.UserControls.NumberTextBox" | |||
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:local="clr-namespace:BPASmartClient.CustomResource.UserControls" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
d:DesignHeight="35" | |||
d:DesignWidth="150" | |||
mc:Ignorable="d"> | |||
<UserControl.Resources> | |||
<ResourceDictionary> | |||
<ResourceDictionary.MergedDictionaries> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" /> | |||
<ResourceDictionary> | |||
<Style x:Key="TextBoxStyle" TargetType="TextBox"> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontSize" Value="22" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Width" Value="188" /> | |||
<Setter Property="Padding" Value="6,0,0,0" /> | |||
<Setter Property="Height" Value="37" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="Foreground" Value="#009dff" /> | |||
<Setter Property="BorderBrush" Value="#009dff" /> | |||
<Setter Property="CaretBrush" Value="#009dff" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Background"> | |||
<Setter.Value> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/textBox.png" Stretch="Fill" /> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</ResourceDictionary> | |||
</ResourceDictionary.MergedDictionaries> | |||
</ResourceDictionary> | |||
</UserControl.Resources> | |||
<Grid> | |||
<Viewbox> | |||
<Grid> | |||
<TextBox | |||
Name="outLoc" | |||
Width="180" | |||
Height="35" | |||
FontSize="20" | |||
GotFocus="outLoc_GotFocus" | |||
Style="{StaticResource TextBoxStyle}" /> | |||
<Popup | |||
Name="pp" | |||
AllowsTransparency="True" | |||
Focusable="False" | |||
Placement="Bottom" | |||
PlacementTarget="{Binding ElementName=outLoc}" | |||
StaysOpen="True"> | |||
<Border | |||
Width="260" | |||
Height="300" | |||
Background="#081424" | |||
ClipToBounds="True"> | |||
<Grid Margin="0"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="35" /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<TextBox | |||
Name="input" | |||
Width="267" | |||
Height="36" | |||
Margin="-4,0,0,0" | |||
VerticalContentAlignment="Center" | |||
FontSize="18" | |||
GotFocus="input_GotFocus" | |||
Style="{StaticResource TextBoxStyle}" /> | |||
<Grid Grid.Row="1"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<Button | |||
Grid.Row="0" | |||
Grid.Column="0" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="1" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="0" | |||
Grid.Column="1" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="2" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="0" | |||
Grid.Column="2" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="3" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="0" | |||
Grid.Column="3" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="ESC" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="1" | |||
Grid.Column="0" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="4" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="1" | |||
Grid.Column="1" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="5" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="1" | |||
Grid.Column="2" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="6" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="1" | |||
Grid.Column="3" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="BR" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="2" | |||
Grid.Column="0" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="7" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="2" | |||
Grid.Column="1" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="8" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="2" | |||
Grid.Column="2" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="9" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="2" | |||
Grid.Column="3" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="Clear" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="3" | |||
Grid.Column="0" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="0" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="3" | |||
Grid.Column="1" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="." | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Grid.Row="3" | |||
Grid.Column="2" | |||
Grid.ColumnSpan="2" | |||
Margin="2" | |||
Click="Button_Click" | |||
Content="Deter" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
</Grid> | |||
</Grid> | |||
</Border> | |||
</Popup> | |||
</Grid> | |||
</Viewbox> | |||
</Grid> | |||
</UserControl> |
@@ -0,0 +1,81 @@ | |||
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 BPASmartClient.CustomResource.UserControls | |||
{ | |||
/// <summary> | |||
/// NumberTextBox.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class NumberTextBox : UserControl | |||
{ | |||
public NumberTextBox() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private void outLoc_GotFocus(object sender, RoutedEventArgs e) | |||
{ | |||
this.pp.IsOpen = outLoc.Focusable; | |||
} | |||
private void Button_Click(object sender, RoutedEventArgs e) | |||
{ | |||
var obj = (Button)sender; | |||
switch (obj.Content) | |||
{ | |||
case "0": | |||
case "1": | |||
case "2": | |||
case "3": | |||
case "4": | |||
case "5": | |||
case "6": | |||
case "7": | |||
case "8": | |||
case "9": | |||
input.Text = input.Text.Trim() + obj.Content.ToString(); | |||
break; | |||
case ".": | |||
if (!string.IsNullOrEmpty(input.Text) && input.Text.Length > 0) | |||
input.Text = input.Text.Trim() + obj.Content.ToString(); | |||
break; | |||
case "ESC": | |||
this.pp.IsOpen = false; | |||
break; | |||
case "BR": | |||
if (!string.IsNullOrEmpty(input.Text) && input.Text.Length > 0) | |||
input.Text = input.Text.Remove(input.Text.Length - 1); | |||
break; | |||
case "Clear": | |||
input.Text = string.Empty; | |||
break; | |||
case "Deter": | |||
outLoc.Text = input.Text; | |||
this.pp.IsOpen = false; | |||
break; | |||
default: | |||
break; | |||
} | |||
} | |||
private void input_GotFocus(object sender, RoutedEventArgs e) | |||
{ | |||
} | |||
} | |||
} |
@@ -16,5 +16,8 @@ namespace BPASmartClient.SmallBatchingSystem | |||
public RelayCommand SaveCommand { get; set; } | |||
public RelayCommand<object> RemoveCommand { get; set; } | |||
public RelayCommand<object> DetailsCommand { get; set; } | |||
public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } } | |||
private string _mErrorInfo; | |||
} | |||
} |
@@ -38,18 +38,41 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
SiloInfos.ToList()?.ForEach(item => { SileNames.Add(item.RawMaterialName); }); | |||
if (Index >= 0 && Index < Json<ConfigInfoModel>.Data.OutletInfoModels.Count) | |||
{ | |||
var array = Json<ConfigInfoModel>.Data.OutletInfoModels.ToArray(); | |||
var res = Array.FindIndex(array, p => p.OutletName == OutletName); | |||
if (res >= 0 && res != Index) | |||
{ | |||
ErrorInfo = "出料口名称已经存在!"; | |||
return; | |||
} | |||
var temp = Array.FindIndex(array, p => p.OutletLoc == OutletLoc); | |||
if (temp >= 0 && temp != Index) | |||
{ | |||
ErrorInfo = "出料口位置已存在!"; | |||
return; | |||
} | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(Index).OutletName = OutletName; | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(Index).OutletLoc = OutletLoc; | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(Index).SiloInfos.Clear(); | |||
//SileNames.ToList()?.ForEach(temp => | |||
//{ | |||
// Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(Index).SiloInfos.Add(temp); | |||
//}); | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(Index).SiloInfos = SileNames; | |||
Control.GetInstance.OperationLog($"{OutletName} 编辑完成"); | |||
} | |||
else | |||
{ | |||
var res = Json<ConfigInfoModel>.Data.OutletInfoModels.FirstOrDefault(p => p.OutletName == OutletName); | |||
if (res != null) | |||
{ | |||
ErrorInfo = "出料口名称已经存在!"; | |||
return; | |||
} | |||
var temp = Json<ConfigInfoModel>.Data.OutletInfoModels.FirstOrDefault(p => p.OutletLoc == OutletLoc); | |||
if (temp != null) | |||
{ | |||
ErrorInfo = "出料口位置已存在!"; | |||
return; | |||
} | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.Add(new OutletInfoModel() | |||
{ | |||
OutletLoc = OutletLoc, | |||
@@ -34,6 +34,13 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
if (Index >= 0 && Index < Json<ConfigInfoModel>.Data.OutletInfoModels.Count) | |||
{ | |||
var res = Array.FindIndex(Json<ConfigInfoModel>.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName); | |||
if (res >= 0 && res != Index) | |||
{ | |||
ErrorInfo = "配方名称已经存在!"; | |||
return; | |||
} | |||
Json<ConfigInfoModel>.Data.Recipes.ElementAt(Index).RecipeName = RecipeName; | |||
Json<ConfigInfoModel>.Data.Recipes.ElementAt(Index).SiloInfoModels.Clear(); | |||
SiloInfos.ToList()?.ForEach(item => | |||
@@ -44,6 +51,13 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
} | |||
else | |||
{ | |||
var res = Json<ConfigInfoModel>.Data.Recipes.FirstOrDefault(p => p.RecipeName == RecipeName); | |||
if (res != null) | |||
{ | |||
ErrorInfo = "配方名称已经存在!"; | |||
return; | |||
} | |||
Json<ConfigInfoModel>.Data.Recipes.Add(new RecipeInfo() | |||
{ | |||
RecipeName = RecipeName, | |||
@@ -16,28 +16,43 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
CancelCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("SiloClose"); }); | |||
SaveCommand = new RelayCommand(() => | |||
{ | |||
var res = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloName == SiloInfoModelObj.SiloName); | |||
if (res != null) | |||
if (Index >= 0 && Index < Json<ConfigInfoModel>.Data.SiloInfoModels.Count) | |||
{ | |||
ErrorInfo = "料仓名称已经存在!"; | |||
return; | |||
} | |||
var array = Json<ConfigInfoModel>.Data.SiloInfoModels.ToArray(); | |||
var res = Array.FindIndex(array, p => p.SiloName == SiloInfoModelObj.SiloName); | |||
if (res >= 0 && res != Index) | |||
{ | |||
ErrorInfo = "料仓名称已经存在!"; | |||
return; | |||
} | |||
var temp = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloLoc == SiloInfoModelObj.SiloLoc); | |||
if (temp != null) | |||
{ | |||
ErrorInfo = "料仓位置已存在!"; | |||
return; | |||
} | |||
var temp = Array.FindIndex(array, p => p.SiloLoc == SiloInfoModelObj.SiloLoc); | |||
if (temp >= 0 && temp != Index) | |||
{ | |||
ErrorInfo = "料仓位置已存在!"; | |||
return; | |||
} | |||
if (Index >= 0 && Index < Json<ConfigInfoModel>.Data.SiloInfoModels.Count) | |||
{ | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.ElementAt(Index).SiloName = SiloInfoModelObj.SiloName; | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.ElementAt(Index).SiloLoc = SiloInfoModelObj.SiloLoc; | |||
Control.GetInstance.OperationLog($"{SiloInfoModelObj.SiloName} 编辑完成"); | |||
} | |||
else | |||
{ | |||
var res = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloName == SiloInfoModelObj.SiloName); | |||
if (res != null) | |||
{ | |||
ErrorInfo = "料仓名称已经存在!"; | |||
return; | |||
} | |||
var temp = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloLoc == SiloInfoModelObj.SiloLoc); | |||
if (temp != null) | |||
{ | |||
ErrorInfo = "料仓位置已存在!"; | |||
return; | |||
} | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.Add(new SiloInfoModel() | |||
{ | |||
SiloLoc = SiloInfoModelObj.SiloLoc, | |||
@@ -62,9 +77,5 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
public SiloInfoModel SiloInfoModelObj { get { return _mSiloInfoModelObj; } set { _mSiloInfoModelObj = value; OnPropertyChanged(); } } | |||
private SiloInfoModel _mSiloInfoModelObj = new SiloInfoModel(); | |||
public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } } | |||
private string _mErrorInfo; | |||
} | |||
} |
@@ -95,6 +95,14 @@ | |||
FontSize="20" | |||
Style="{StaticResource TextBoxStyle}" />--> | |||
<TextBlock | |||
Margin="0,0,5,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
FontSize="20" | |||
Foreground="#FFF53F62" | |||
Text="{Binding ErrorInfo}" /> | |||
<Button | |||
Width="90" | |||
Height="30" | |||
@@ -10,9 +10,9 @@ | |||
Title="NewPfView" | |||
Width="500" | |||
Height="300" | |||
Topmost="True" | |||
AllowsTransparency="True" | |||
Background="{x:Null}" | |||
Topmost="True" | |||
WindowStartupLocation="CenterScreen" | |||
WindowStyle="None" | |||
mc:Ignorable="d"> | |||
@@ -51,6 +51,14 @@ | |||
Style="{StaticResource TextBlockStyle}" | |||
Text="配方名称:" /> | |||
<TextBlock | |||
Margin="0,0,10,0" | |||
HorizontalAlignment="Right" | |||
VerticalAlignment="Center" | |||
FontSize="20" | |||
Foreground="#FFF53F62" | |||
Text="{Binding ErrorInfo}" /> | |||
<StackPanel | |||
Grid.Row="1" | |||
Margin="10,0,0,0" | |||
@@ -0,0 +1,22 @@ | |||
<Window | |||
x:Class="BPASmartClient.SmallBatchingSystem.Views.PromptView" | |||
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:local="clr-namespace:BPASmartClient.SmallBatchingSystem.Views" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
Title="PromptView" | |||
Width="400" | |||
Height="200" | |||
AllowsTransparency="True" | |||
Background="{x:Null}" | |||
WindowStartupLocation="CenterScreen" | |||
WindowStyle="None" | |||
mc:Ignorable="d"> | |||
<Grid> | |||
<Grid.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹窗.png" Stretch="Fill" /> | |||
</Grid.Background> | |||
</Grid> | |||
</Window> |
@@ -0,0 +1,27 @@ | |||
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.Shapes; | |||
namespace BPASmartClient.SmallBatchingSystem.Views | |||
{ | |||
/// <summary> | |||
/// PromptView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class PromptView : Window | |||
{ | |||
public PromptView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -3,6 +3,6 @@ | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:local="clr-namespace:WPFDemo" | |||
StartupUri="Window1.xaml"> | |||
StartupUri="Window2.xaml"> | |||
<Application.Resources /> | |||
</Application> |
@@ -0,0 +1,89 @@ | |||
<Window | |||
x:Class="WPFDemo.Window2" | |||
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:local="clr-namespace:WPFDemo" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:pru="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
Title="Window2" | |||
Width="800" | |||
Height="450" | |||
Topmost="True" | |||
mc:Ignorable="d"> | |||
<Grid> | |||
<pru:NumberTextBox Width="150" Height="30" /> | |||
<!--<Grid> | |||
<TextBox | |||
Name="outLoc" | |||
Width="180" | |||
Height="35" | |||
Margin="5,0,0,0" | |||
GotFocus="outLoc_GotFocus" | |||
FontSize="20" | |||
Text="{Binding OutletLoc}" /> | |||
<Popup | |||
Name="pp" | |||
AllowsTransparency="True" | |||
Focusable="False" | |||
Placement="Left" | |||
PlacementTarget="{Binding ElementName=outLoc}" | |||
StaysOpen="True"> | |||
<Border Background="#081424" ClipToBounds="True"> | |||
<Grid Margin="0" > | |||
<Grid.RowDefinitions> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<TextBox Text="125"/> | |||
<Grid Grid.Row="1"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition/> | |||
<ColumnDefinition/> | |||
<ColumnDefinition/> | |||
<ColumnDefinition/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Foreground="White" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="1"/> | |||
<TextBlock Foreground="White" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Text="2"/> | |||
<TextBlock Foreground="White" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="3"/> | |||
<TextBlock Foreground="White" Grid.Row="0" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Text="4"/> | |||
<TextBlock Foreground="White" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="5"/> | |||
<TextBlock Foreground="White" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Text="6"/> | |||
<TextBlock Foreground="White" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="7"/> | |||
<TextBlock Foreground="White" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Text="8"/> | |||
<TextBlock Foreground="White" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="9"/> | |||
<TextBlock Foreground="White" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Text="0"/> | |||
<TextBlock Foreground="White" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="."/> | |||
<TextBlock Foreground="White" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Text="br"/> | |||
<TextBlock Foreground="White" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="enter"/> | |||
<TextBlock Foreground="White" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Text="a"/> | |||
<TextBlock Foreground="White" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="b"/> | |||
<TextBlock Foreground="White" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Text="c"/> | |||
</Grid> | |||
</Grid> | |||
</Border> | |||
</Popup> | |||
</Grid>--> | |||
</Grid> | |||
</Window> |
@@ -0,0 +1,32 @@ | |||
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.Shapes; | |||
namespace WPFDemo | |||
{ | |||
/// <summary> | |||
/// Window2.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class Window2 : Window | |||
{ | |||
public Window2() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private void outLoc_GotFocus(object sender, RoutedEventArgs e) | |||
{ | |||
//this.pp.IsOpen = this.outLoc.Focusable; | |||
} | |||
} | |||
} |