11. ContractApp
1.
더보기
1.
2.
Title="NewContractWindow"
Height="300"
Width="260"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="4" />
</Grid.ColumnDefinitions>
<TextBlock Text="Name:"
Grid.Row="1"
Grid.Column="1" />
<TextBox x:Name="nameTextBox"
Grid.Row="3"
Grid.Column="1" />
<TextBlock Text="Email:"
Grid.Row="5"
Grid.Column="1" />
<TextBox x:Name="emailTextBox"
Grid.Row="7"
Grid.Column="1" />
<TextBlock Text="Phone:"
Grid.Row="9"
Grid.Column="1" />
<TextBox x:Name="PhoneTextBox"
Grid.Row="11"
Grid.Column="1" />
<Button Grid.Row="13"
Grid.Column="1"
Content="Add New Contact"/>
</Grid>
3.
2.
더보기
1.
Title="MainWindow"
Height="400" Width="400">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
<RowDefinition Height="auto" />
<RowDefinition Height="4" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="4" />
</Grid.ColumnDefinitions>
<Button Grid.Row="1" Grid.Column="1"
Content="New Contact"
Click="Button_Click"/>
</Grid>
2.
3.
// contact를 추가하기 위한 새로운 윈도우 객체를 만들고,
AddNewContactWindow newContactWindow = new AddNewContactWindow();
// 출력한다.
newContactWindow.Show();
4.
3.
더보기
1.
// contact를 추가하기 위한 새로운 윈도우 객체를 만들고,
AddNewContactWindow newContactWindow = new AddNewContactWindow();
// 출력한다. 화면 전환을 막도록 ShowDialog를 사용한다.
newContactWindow.ShowDialog();
2.
// AddNewContact 윈도우에서 "Save"버튼을 누르면 화면이 닫히도록 구현한다.
Close();
4.
5.
4.