twintechs / TwinTechsFormsLib

Apache License 2.0
193 stars 73 forks source link

FastCell ContextAction #23

Open schmidan opened 9 years ago

schmidan commented 9 years ago

We are trying to switch to your Fastcell implementation. So far we are pretty impressed. I did stumble over Context Actions so far. Taken from a working ListView implementation, they don't show up under iOS (Android not tested yet)

I hope it might be a "simple" change in the renderer. Could you point me in the right direction ?

<?xml version="1.0" encoding="UTF-8"?>
<controls:FastCell
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:controls="clr-namespace:TwinTechs.Controls;assembly=TwinTechsForms"
    xmlns:i18n="clr-namespace:I18n.Extension;assembly=I18n"
    x:Class="Controls.PasswordSafeCell">

    <ViewCell.ContextActions>
        <MenuItem   Command="{Binding Source={x:Reference passwordsListView}, Path=BindingContext.CopyPasswordCommand}}" 
                    CommandParameter="{Binding .}" Text="{i18n:TranslateExtension Text=LABEL_COPY}" />
        <MenuItem   Command="{Binding Source={x:Reference passwordsListView}, Path=BindingContext.EditPasswordCommand}}" 
                    CommandParameter="{Binding .}" Text="{i18n:TranslateExtension Text=LABEL_EDIT}" />
        <MenuItem   Command="{Binding Source={x:Reference passwordsListView}, Path=BindingContext.DeletePasswordCommand}}" 
                    CommandParameter="{Binding .}" Text="{i18n:TranslateExtension Text=LABEL_DELETE}" IsDestructive="true" />
    </ViewCell.ContextActions>
<!--    <ContentView>-->
        <StackLayout HorizontalOptions="StartAndExpand" Orientation="Horizontal">
            <StackLayout Padding="15,10,15,10" VerticalOptions="StartAndExpand" Orientation="Vertical" Spacing="0">
                <Label x:Name="LabelTitle" Text="TTT" YAlign="Center" FontSize="Medium" FontAttributes="Bold" />
                <Label x:Name="LabelUrl" Text="UUU" YAlign="Center" FontSize="Small" />
            </StackLayout>
        </StackLayout>
<!--    </ContentView>-->

</controls:FastCell>