💎목표
⭐Project 생성
- WPF 애플리케이션
- G24W1402WPFDialog
MainWindow.xaml
<Window x:Class="G24W1402WPFDialog.MainWindow"
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:G24W1402WPFDialog"
mc:Ignorable="d"
Title="건담" Height="450" Width="800">
<Border Padding="5">
<DockPanel>
<Button
Content="MS 추가"
Margin="10"
Click="OnAdd"
DockPanel.Dock="Top"/>
<TextBox
x:Name="Result"
IsReadOnly="True"
AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"
Background="#eee"
DockPanel.Dock="Bottom"/>
</DockPanel>
</Border>
</Window>
MainWindows.xaml.cs
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 G24W1402WPFDialog
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
public void OnAdd(object sender, RoutedEventArgs e) {
}
}
}
⭐Gundam.xaml 추가
- 프로젝트 마우스 오른쪽 버튼 - 추가 - 창(WPF)
GundamDlg.xaml
<Window x:Class="G24W1402WPFDialog.GundamDlg"
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:G24W1402WPFDialog"
mc:Ignorable="d"
Title="건담 정보" Height="305" Width="300">
<Border Padding="10">
<DockPanel>
<StackPanel DockPanel.Dock="Top">
<TextBlock
Text="건담 입력"
FontWeight="Bold"
Margin="0, 10"/>
<TextBlock
Text="이름"/>
<TextBox
x:Name="Name2"
Padding="2"/>
<TextBlock
Text="모델"
Margin="0, 10, 0, 0"/>
<TextBox
x:Name="Model"
Padding="2"/>
<TextBlock
Text="소속"
Margin="0, 10, 0, 0"/>
<ComboBox
x:Name="Party"
Padding="2">
<ComboBoxItem>연방군</ComboBoxItem>
<ComboBoxItem>지온군</ComboBoxItem>
<ComboBoxItem>기타</ComboBoxItem>
</ComboBox>
<Button
Content="확인"
Margin="0, 20, 0, 0"/>
<Button
Content="취소"
Margin="0, 20, 0, 0"/>
</StackPanel>
</DockPanel>
</Border>
</Window>