Ejemplo n.º 1
0
        async void PopulateDevice()
        {
            try
            {
                var ctx = await RemoteDatabase.GetDbContextAsync();

                var lstDev = ctx.Devices.ToList();
                EditedDevice = new Device();
                DataDevice.Clear();
                foreach (var dv in lstDev)
                {
                    DataDevice.Add(dv);
                }
                ctx.Database.Connection.Close();
                ctx.Dispose();
            }
            catch (Exception error)
            {
                await mainview0.Dispatcher.BeginInvoke(new System.Action(() =>
                {
                    ExceptionMessageBox exp = new ExceptionMessageBox(error, "Error in Populate Device");
                    exp.ShowDialog();
                }));
            }
        }