4 changed files with 104 additions and 4 deletions
@ -0,0 +1,14 @@ |
|||||
|
<Window x:Class="DyeingComputer.Windows.InputBox" |
||||
|
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:DyeingComputer.Windows" |
||||
|
mc:Ignorable="d" |
||||
|
Title="InputBox" Height="200" Width="400"> |
||||
|
<Grid> |
||||
|
<TextBox x:Name="Boxx" HorizontalAlignment="Left" Height="36" Margin="39,31,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="319"/> |
||||
|
<Button Content="Button" HorizontalAlignment="Left" Height="35" Margin="58,104,0,0" VerticalAlignment="Top" Width="96" Click="YES_Click"/> |
||||
|
<Button Content="Button" HorizontalAlignment="Left" Height="35" Margin="158,104,0,0" VerticalAlignment="Top" Width="96" Click="NO_Click"/> |
||||
|
</Grid> |
||||
|
</Window> |
@ -0,0 +1,55 @@ |
|||||
|
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 DyeingComputer.Windows |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// InputBox.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class InputBox : Window |
||||
|
{ |
||||
|
public InputBox() |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
public string InputValue |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
return Boxx.Text; |
||||
|
} |
||||
|
set |
||||
|
{ |
||||
|
this.Boxx.Text = value; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public event EventHandler Accept; |
||||
|
|
||||
|
private void YES_Click(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
if (Accept != null) |
||||
|
{ |
||||
|
Accept(this, EventArgs.Empty); |
||||
|
} |
||||
|
this.Close(); //为了测试效果,点击Done以后先不关闭窗口
|
||||
|
} |
||||
|
|
||||
|
private void NO_Click(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
this.Close(); //为了测试效果,点击Done以后先不关闭窗口
|
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue