■ DesignInstance 태그 확장을 사용하는 방법을 보여준다.
▶ Customer.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
/// <summary> /// 고객 /// </summary> public class Customer { //////////////////////////////////////////////////////////////////////////////////////////////////// Property ////////////////////////////////////////////////////////////////////////////////////////// Public #region 이름 - FirstName /// <summary> /// 이름 /// </summary> public string FirstName { get; set; } #endregion #region 성 - LastName /// <summary> /// 성 /// </summary> public string LastName { get; set; } #endregion } |
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<Grid x:Name="grid" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:DataBindingApplication" d:DataContext="{d:DesignInstance Type=local:Customer}" Background="White"> <TextBox x:Name="textBox" Width="200" Height="25" BorderBrush="Black" FontFamily="Times New Roman" FontSize="16" Text="{Binding Path=FirstName, Mode=TwoWay}" /> </Grid> |