Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sqlite Windows RT/8-单击listview项目并在页面之间传递数据_Sqlite_Windows Runtime_Windows Store Apps - Fatal编程技术网

Sqlite Windows RT/8-单击listview项目并在页面之间传递数据

Sqlite Windows RT/8-单击listview项目并在页面之间传递数据,sqlite,windows-runtime,windows-store-apps,Sqlite,Windows Runtime,Windows Store Apps,我正在使用SQLite开发一个WIndows RT应用程序。我有一个返回结果的搜索框。我需要做的是,当用户单击listview项目时,另一个屏幕将显示所选项目的详细信息。我在单击时打开了屏幕,但不知道如何在页面之间传递数据。将项目单击事件处理程序添加到listview private void lst_ItemClick(object sender, ItemClickEventArgs e) { SomeComplexObject item = e.ClickedIt

我正在使用SQLite开发一个WIndows RT应用程序。我有一个返回结果的搜索框。我需要做的是,当用户单击listview项目时,另一个屏幕将显示所选项目的详细信息。我在单击时打开了屏幕,但不知道如何在页面之间传递数据。

将项目单击事件处理程序添加到listview

private void lst_ItemClick(object sender, ItemClickEventArgs e)
     {
        SomeComplexObject item = e.ClickedItem as SomeComplexObject 

        if(item != null)
        {
          this.Frame.Navigate(typeof(PageName), item.ID);
        }
    }
考虑到您的对象是复杂类型的 然后在OnNavigatedTo事件中

页码

您可以获得参数值

希望这有帮助

例如,你可以有一个

public class NavigationParameter
{
 public string CustomerName {get; set;}
 public int CustomerID {get; set;}
}
然后单击ItemClick,您可以得到类似的内容

Customer item = e.ClickedItem as Customer;       
if(item != null)
{
  NavigationParameter p = new NavigationParameter();
  p.CustomerName = item.CustomerName;
  p.CustomerID = item.CustomerID;
  this.Frame.Navigate(typeof(PageName), p);
 }   

我对此还是新手,请解释complextype以及我如何在其他页面中引用它?您绑定到listview的itemsource是什么?string custSearch=tbxCustSearch.Text.ToString();var dbPath=Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path,dbName);使用(var db=new SQLite.SQLiteConnection(dbPath)){var query=db.Table().Where(x=>x.customerName.Contains(custSearch));listcustors.ItemsSource=query.ToList();db.Dispose();db.Close();}在这种情况下,用“Customers”,您可以将其作为参数传递到Navigate()函数中以代替item.Id。我可以使用同一个函数传递多个参数吗?