- 
      
- 
        Save HeathHopkins/637b10c9a844fbb2874235c75895b22e to your computer and use it in GitHub Desktop. 
    Reuse converters by chaining them together with a custom converter.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class ValueConverterGroup : List<IValueConverter>, IValueConverter | |
| { | |
| public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | |
| { | |
| return this.Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture)); | |
| } | |
| public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | |
| { | |
| throw new NotImplementedException(); | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="utf-8" ?> | |
| <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
| x:Class="someclass"> | |
| <ContentPage.Resources> | |
| <ResourceDictionary> | |
| <!-- Converters --> | |
| <ValueConverterGroup x:Key="SelectionBackgroundColorConverter"> | |
| <EqualsConverter></EqualsConverter> | |
| <BooleanToColorConverter TrueColor="{StaticResource GreenBackgroundColor}" | |
| FalseColor="{StaticResource GraySeperatorColor}"/> | |
| </ValueConverterGroup> | |
| </ResourceDictionary> | |
| </ContentPage.Resources> | |
| </ContentPage> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment