简体   繁体   English

如何为Xamarin Forms ListView创建消息框?

[英]How do I create a message box for Xamarin Forms ListView?

The question is simple. 问题很简单。 I Need to have an message box for the cells in a listview app that was created. 我需要为已创建的listview应用程序中的单元格提供一个消息框。 However I failed, because the one time I did it, it was in a not XamarinForms App. 但是我失败了,因为有一次,它是在非XamarinForms应用程序中进行的。 Now I don't know how to create a message box that responds to each cell. 现在,我不知道如何创建一个响应每个单元格的消息框。

Code; 码;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;

namespace IconsApp
{
public partial class ListViewPage : ContentPage
{
    public ListViewPage()
    {
        InitializeComponent();

        MainListView.ItemsSource = new List<Element>
        {
            new Element {new Title = "ok", Description= "ok"},new Element {Title = "ok", Description = "ok"},
    }
MainListView.ItemSelected += (sender, e) => { 
  var item = (Element) e.SelectedItem;
  DisplayAlert(item.Title,item.Description,"OK");
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin.Forms 如何禁用 ListView 上的单击动画 - Xamarin.Forms How do I disable click animation on ListView 如何在具有ReactiveUI和Xamarin表单的ListView ItemTemplate中使用ViewModelViewHost? - How do I use ViewModelViewHost in a ListView ItemTemplate with ReactiveUI and Xamarin Forms? 如何在列表视图的项目中引用控件或视图-Xamarin Forms - How do I refer a control or view in an item of listview - xamarin forms 如何在Xamarin Forms中向ListView添加BackgroundImage? - How do I add a BackgroundImage to a ListView in Xamarin Forms? 如何在 Xamarin.Forms ListView 中创建手风琴 - How to create an accordion in Xamarin.Forms ListView 如何在Xamarin Forms for iOS中创建导航栏? - How do I create a Navigation Bar in Xamarin Forms for iOS? 如何创建和初始化自定义Xamarin表单控件 - How Do I Create and Initialize a Custom Xamarin Forms Control 创建具有3列Xamarin表单的ListView - Create a ListView With 3 Columns Xamarin Forms 如何在Xamarin Forms中的字符串(Listview分组字母)上更改textcolor? - How do I change textcolor on a string (Listview grouping letters) in Xamarin Forms? 如何使用 MVVM 和 Xamarin.Forms ListView ItemSelected 事件来检索所选项目的绑定属性? - How do I use MVVM and Xamarin.Forms ListView ItemSelected event to to retrieve a bound property of the item selected?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM