mirror of https://github.com/icsharpcode/ILSpy.git
6 changed files with 105 additions and 5 deletions
@ -0,0 +1,24 @@ |
|||||||
|
<Window |
||||||
|
x:Class="ICSharpCode.ILSpy.CreateListDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:ICSharpCode.ILSpy.Controls" |
||||||
|
Title="New list" |
||||||
|
Style="{DynamicResource DialogWindow}" |
||||||
|
WindowStartupLocation="CenterOwner" |
||||||
|
ResizeMode="NoResize" |
||||||
|
Width="300" |
||||||
|
Height="150" |
||||||
|
FocusManager.FocusedElement="{Binding ElementName=listView}"> |
||||||
|
<Grid Margin="12,8"> |
||||||
|
<Grid.RowDefinitions> |
||||||
|
<RowDefinition Height="Auto" /> |
||||||
|
<RowDefinition Height="Auto" /> |
||||||
|
</Grid.RowDefinitions> |
||||||
|
<StackPanel> |
||||||
|
<Label>Enter a list name:</Label> |
||||||
|
<TextBox Margin="8,8" Name="ListName" TextChanged="TextBox_TextChanged"></TextBox> |
||||||
|
</StackPanel> |
||||||
|
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="8,0"> |
||||||
|
<Button IsDefault="True" Margin="2,0" IsEnabled="False" Name="okButton" Click="OKButton_Click">Create</Button> |
||||||
|
<Button IsCancel="True" Margin="2,0">Cancel</Button> |
||||||
|
</StackPanel> |
||||||
|
</Grid> |
||||||
|
</Window> |
@ -0,0 +1,49 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
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.Navigation; |
||||||
|
using System.Windows.Shapes; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for Create.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class CreateListDialog : Window |
||||||
|
{ |
||||||
|
public CreateListDialog() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
} |
||||||
|
|
||||||
|
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) |
||||||
|
{ |
||||||
|
okButton.IsEnabled = !string.IsNullOrWhiteSpace(ListName.Text); |
||||||
|
} |
||||||
|
|
||||||
|
private void OKButton_Click(object sender, RoutedEventArgs e) |
||||||
|
{ |
||||||
|
if (!string.IsNullOrWhiteSpace(ListName.Text)) |
||||||
|
{ |
||||||
|
this.DialogResult = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public string NewListName |
||||||
|
{ |
||||||
|
get |
||||||
|
{ |
||||||
|
return ListName.Text; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue