private async Task Init() { try { // Initialize Azure azureClient = new SampleMobileClient(mobileAppUri, supportLocalDatabase); await azureClient.InitializeLocalStore(); // Retrieve the items from the server todoTableDAO = new AppServiceTableDAO <TodoItem>(azureClient); todoItems = await todoTableDAO.FindAll(); // Populate the UI for (int i = 0; i < todoItems.Count; i++) { TodoItem item = todoItems[i]; float x = (i % listColumns) * 1.2f; float y = (i / listColumns) * 1.2f; float z = listDistance; HoloLensClickableElement obj = Instantiate(tile, new Vector3(x, y, z), Quaternion.identity); obj.Setup(item); obj.OnClick += Item_Click; } log.gameObject.SetActive(false); } catch (Exception ex) { log.text = ex.ToString(); } }
private async void Item_Click(object sender, EventArgs e) { HoloLensClickableElement source = sender as HoloLensClickableElement; await todoTableDAO.Delete(source.Item); }