首页 新闻 会员 周边

xamarinform框架里Clicked事件取消任务,调用接口,

0
悬赏园豆:20 [待解决问题]

xamarinform框架里前端用imagebutton里的Clicked事件取消任务,调用接口,如何写方法,
下面是我写的前端后端和接口,这个方法怎么写
前端: <StackLayout Spacing="5" Orientation="Horizontal" HorizontalOptions="Start">
<Label WidthRequest="65" FontAttributes="Bold" HorizontalTextAlignment="Center" BackgroundColor="Blue">起点</Label>
<Label WidthRequest="65" FontAttributes="Bold" HorizontalTextAlignment="Center" BackgroundColor="Blue">终点</Label>
<Label WidthRequest="70" FontAttributes="Bold" HorizontalTextAlignment="Center" BackgroundColor="Blue" >执行状态</Label>
<Label WidthRequest="70" FontAttributes="Bold" HorizontalTextAlignment="Center" BackgroundColor="Blue">取消任务</Label>
</StackLayout>
<StackLayout>
<ListView x:Name="lvAgvTask" ItemsSource="{Binding AgvTaskDataSource, Mode=OneWay}" CachingStrategy="RecycleElement" RowHeight="35" SelectionMode="None">
<!--Custom View Cells-->
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" Spacing="5" VerticalOptions="Center">
<Label WidthRequest="65" Text="{Binding SaddrEx}" HorizontalTextAlignment="Center" FontSize="14" />
<Label ClassId="{Binding ID} " WidthRequest="65" Text="{Binding EaddrEx}" HorizontalTextAlignment="Center" FontSize="14"/>
<Label WidthRequest="70" Text="{Binding TaskStatus }" HorizontalTextAlignment="Center" FontSize="14"/>
<ImageButton Source="delete.jpeg" WidthRequest="50" HeightRequest="20" BackgroundColor="Green" Clicked="AgvTask_Delete"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</StackLayout>
接口名:CancelAgvTask
后台的clicked事件,怎么搞,这是我写的
private async void AgvTask_Delete(object sender, EventArgs e)
{
var result = new ResultEntity { ResultCode = 1 };
result = AgvApiHelper.CallEmiApi("CancelAgvTask", string.Empty, 1);
List<WMSTask> lstTask = JsonConvert.DeserializeObject<List<WMSTask>>(result.ResultMsg.ToString());

    }
}
简单,的主页 简单, | 初学一级 | 园豆:55
提问于:2022-08-31 17:16
< >
分享
所有回答(1)
0

看你最近的问题都是xamarinform,你这么写出现什么问题?

MrNice | 园豆:3450 (老鸟四级) | 2022-08-31 17:57

我写的,这个效果不显示,不报错,但是也没有实现

支持(0) 反对(0) 简单, | 园豆:55 (初学一级) | 2022-09-01 09:17

@简单,:页面的后台代码应该有一个viewmodal的初始化或者类似变量的初始化 你也没把数据bind上去啊

支持(0) 反对(0) MrNice | 园豆:3450 (老鸟四级) | 2022-09-01 09:19

@MrNice: 大哥能不能,解决一下另一个判断的问题【捂脸】

支持(0) 反对(0) 简单, | 园豆:55 (初学一级) | 2022-09-01 10:09
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册