Image converter not working in data template?

I need to change image source on tap in mvvm so i planned to use converter but i dont know why it is not working here?. In my project other places it is working fine.
My xaml code:

`<ContentPage

x:Class="Feelix.Views.SessionListPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  xmlns:converter="clr-namespace:Feelix.Converters"
Title="PATIENTS"
ControlTemplate="{StaticResource BackArrowPageTemplate}"
NavigationPage.HasNavigationBar="false">
<ContentPage.Resources>
    <ResourceDictionary>
    <converter:DownloadIconConverter x:Key="downloadiconconverter" />
    <converter:UploadIconConverter x:Key="uploadiconconverter" />
    </ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
    <StackLayout Padding="10" Spacing="10">
        <Label
            FontSize="Medium"
            HorizontalOptions="Center"
            Style="{StaticResource GroupLabel}"
            Text="{Binding FirstLastName}"
            TextColor="Black" />
        <ListView x:Name="listview"
            Grid.Row="1"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            IsGroupingEnabled="true"
            ItemsSource="{Binding UIUnionListWrapper}"
            SelectedItem="{Binding DeviceSession, Mode=TwoWay}">

            <ListView.GroupHeaderTemplate>

                <DataTemplate>

                    <ViewCell>

                        <StackLayout BackgroundColor="White" Orientation="Vertical">

                            <StackLayout Orientation="Horizontal">

                                <Label
                                    Style="{StaticResource GroupLabel}"
                                    Text="{Binding Heading}"
                                    TextColor="Purple" />


                            </StackLayout>

                        </StackLayout>

                    </ViewCell>

                </DataTemplate>

            </ListView.GroupHeaderTemplate>

            <ListView.ItemTemplate>

                <DataTemplate>

                    <ViewCell>
                        <StackLayout Orientation="Horizontal">
                        <!--<Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />

                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="auto" />
                            </Grid.ColumnDefinitions>-->
                            <Label
                                FontFamily="GothamRounded-Light.ttf#GothamRounded-Light"
                                Style="{StaticResource GroupsubLabel}"
                                Text="{Binding DateTime}" HeightRequest="150" WidthRequest="300" />
                            <Grid>
                           **     <ImageButton
                                HeightRequest="40"  
                                IsVisible="{Binding ToDownload}"
                                Source="cloud_download"
                                WidthRequest="35" Command ="{Binding BindingContext.Download, Source={x:Reference listview}}" CommandParameter="{Binding .}" />**

                             **   <ImageButton
                                HeightRequest="40" 
                                IsVisible="{Binding ToUpload}"
                              Source="{Binding UploadIcon, Converter={StaticResource uploadiconconverter}}"
                                WidthRequest="35"  Command ="{Binding BindingContext.Upload, Source={x:Reference listview}}" CommandParameter="{Binding .}" />**

                            </Grid>
                            <!--</Grid>-->
                        </StackLayout>
                    </ViewCell>

                </DataTemplate>

            </ListView.ItemTemplate>

        </ListView>


    </StackLayout>
</ContentPage.Content>


`

My converter code:
` public class UploadIconConverter :IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return ((bool)value) ? "progressicon" : "upload";
}

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return null;
    }
}`

` public class DownloadIconConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return ((bool)value) ? "progressicon" : "cloud_download";
}

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return null;
    }
}`
Sign In or Register to comment.