|
|
|
@ -0,0 +1,51 @@ |
|
|
|
|
<Window x:Class="MVVMwithWPF.Views.ConverterWindoew" |
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
|
xmlns:converters="clr-namespace:MVVMwithWPF.Converters" |
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
|
|
|
xmlns:local="clr-namespace:MVVMwithWPF.Views" |
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
|
|
|
xmlns:viewModels="clr-namespace:MVVMwithWPF.ViewModels" |
|
|
|
|
Title="ConverterWindoew" |
|
|
|
|
Width="800" |
|
|
|
|
Height="450" |
|
|
|
|
mc:Ignorable="d"> |
|
|
|
|
<Window.DataContext> |
|
|
|
|
<viewModels:ConverterViewModel /> |
|
|
|
|
</Window.DataContext> |
|
|
|
|
<Window.Resources> |
|
|
|
|
<converters:InvertedBooleanConverter x:Key="ReverseBConverter" /> |
|
|
|
|
<converters:BoolToStringConverter x:Key="B2SConverter" /> |
|
|
|
|
<converters:BoolToVisibilityConverter x:Key="B2VConverter" /> |
|
|
|
|
<converters:BoolToVisibilityConverter x:Key="ReverseB2VConverter" |
|
|
|
|
FalseValue="Visible" TrueVlaue="Collapsed" /> |
|
|
|
|
<converters:ParameterContainValueConverter x:Key="ParamContainConverter" /> |
|
|
|
|
</Window.Resources> |
|
|
|
|
<Grid> |
|
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
|
<ColumnDefinition /> |
|
|
|
|
<ColumnDefinition /> |
|
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True" |
|
|
|
|
ItemsSource="{Binding Person}"> |
|
|
|
|
<DataGrid.Columns> |
|
|
|
|
<DataGridTextColumn Binding="{Binding Id}" Header="Id" /> |
|
|
|
|
<DataGridTextColumn Binding="{Binding Name}" Header="이름" /> |
|
|
|
|
<DataGridTextColumn Binding="{Binding Sex}" Header="성별" /> |
|
|
|
|
<DataGridTextColumn Binding="{Binding DepartmentCode}" Header="부서" /> |
|
|
|
|
</DataGrid.Columns> |
|
|
|
|
</DataGrid> |
|
|
|
|
<StackPanel Grid.Column="1" Margin="5"> |
|
|
|
|
<CheckBox Content="IsEdit" IsChecked="{Binding IsEdit, Mode=TwoWay}" /> |
|
|
|
|
<TextBlock Text="IsEnable Binding" /> |
|
|
|
|
<TextBox IsEnabled="{Binding IsEdit}" /> |
|
|
|
|
<TextBlock Text="IsReadOnly Reverse Binding" /> |
|
|
|
|
<TextBox IsReadOnly="{Binding IsEdit, Converter={StaticResource ReverseBConverter}}" /> |
|
|
|
|
<TextBlock Text="IsEdit Visibility" Visibility="{Binding IsEdit, Converter={StaticResource B2VConverter}}" /> |
|
|
|
|
<TextBlock Text="IsEdit Reverse Visibility" Visibility="{Binding IsEdit, Converter={StaticResource ReverseB2VConverter}}" /> |
|
|
|
|
<TextBlock Text="Parameter Contain Value Test" /> |
|
|
|
|
<TextBox x:Name="tbxParam" /> |
|
|
|
|
<CheckBox IsEnabled="False" Content="apple|banana|strawberry" IsChecked="{Binding ElementName=tbxParam, Path=Text, Converter={StaticResource ParamContainConverter}, ConverterParameter=apple|banana|strawberry}" /> |
|
|
|
|
</StackPanel> |
|
|
|
|
</Grid> |
|
|
|
|
</Window> |