Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update ch4/02_lucky_draw_app.md
  • Loading branch information
KscireGamer committed Aug 10, 2015
1 parent 2d7f8da commit c371297
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions ch4/02_lucky_draw_app.md
Expand Up @@ -268,18 +268,18 @@

namespace LuckyDraw
{
public class GenderToColorConverter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, string language)
{
return (int)value == 1 ? Colors.Navy : Colors.DarkRed;
}

object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
public class GenderToColorConverter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, string language)
{
return (int)value == 1 ? Colors.Navy : Colors.DarkRed;
}

object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}
```

Expand All @@ -289,9 +289,9 @@

```xml
<Application.Resources>
<ResourceDictionary>
<local:GenderToColorConverter x:Key="GenderToColor" />
</ResourceDictionary>
<ResourceDictionary>
<local:GenderToColorConverter x:Key="GenderToColor" />
</ResourceDictionary>
</Application.Resources>
```

Expand All @@ -301,13 +301,13 @@

```xml
<Border.Background>
<SolidColorBrush Color="{Binding Gender, Converter={StaticResource GenderToColor}}" />
<SolidColorBrush Color="{Binding Gender, Converter={StaticResource GenderToColor}}" />
</Border.Background>
<StackPanel Margin="12">
<TextBlock Text="{Binding Name}" Foreground="White"
Style="{StaticResource TitleTextBlockStyle}" />
<TextBlock Text="{Binding Department}" Foreground="White"
Style="{StaticResource SubtitleTextBlockStyle}" />
<TextBlock Text="{Binding Name}" Foreground="White"
Style="{StaticResource TitleTextBlockStyle}" />
<TextBlock Text="{Binding Department}" Foreground="White"
Style="{StaticResource SubtitleTextBlockStyle}" />
</StackPanel>
```

Expand Down

0 comments on commit c371297

Please sign in to comment.