|
<xforms:SfListView x:Name="listView" ItemsSource="{Binding MyList}">
<xforms:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Margin="10">
<syncfusion:SfNumericTextBox x:Name="numericTextBox" Value="45" >
<syncfusion:SfNumericTextBox.Behaviors>
<local:EventToCommandBehavior EventName="Completed" Command="{Binding BindingContext.CompletedCommand, Source={x:Reference Name=listView}}" />
<local:EventToCommandBehavior EventName="FocusChanged" Command="{Binding BindingContext.FocusChangedCommand, Source={x:Reference Name=listView}}" />
</syncfusion:SfNumericTextBox.Behaviors>
</syncfusion:SfNumericTextBox>
</StackLayout>
</ViewCell>
</DataTemplate>
</xforms:SfListView.ItemTemplate>
</xforms:SfListView> |
|
public class ViewModel : INotifyPropertyChanged
{
...
private ICommand completedCommand;
public ICommand CompletedCommand
{
get { return completedCommand; }
set
{
completedCommand = value;
OnPropertyChanged("CompletedCommand");
}
}
private ICommand focusChangedCommand;
public ICommand FocusChangedCommand
{
get { return focusChangedCommand; }
set
{
focusChangedCommand = value;
OnPropertyChanged("FocusChangedCommand");
}
}
void CompletedMethod(object obj)
{
}
void FocusChangedMethod(object obj)
{
}
} |