Hi Boris,
Greetings from Syncfusion.
We are currently working in the sample. We will update the
details by 17th December 2019.
Please let us know if you have any concern.
Regards,
Sakthivel P.
public class ComboBoxDataBase
{
static object locker = new object();
ISQLiteService SQLite
{
get
{
return DependencyService.Get<ISQLiteService>();
}
}
readonly SQLiteConnection connection;
readonly string DatabaseName;
public ComboBoxDataBase(string databaseName)
{
DatabaseName = databaseName;
connection = SQLite.GetConnection(DatabaseName);
}
public void CreateTable<T>()
{
lock (locker)
{
connection.CreateTable<T>();
}
}
public int SaveItem<T>(T item)
{
lock (locker)
{
var id = ((Employee)(object)item).ID;
return connection.Insert(item);
}
}
public IEnumerable<T> GetItems<T>() where T : new()
{
lock (locker)
{
return (from i in connection.Table<T>() select i).ToList();
}
}
public int DeleteAll<T>()
{
lock (locker)
{
return connection.DeleteAll<T>();
}
}
} |
<combobox:SfComboBox
x:Name="comboBox"
DataSource="{Binding EmployeeCollection}"
DisplayMemberPath="ZeeBoot" /> |
public partial class MainPage : ContentPage
{
ViewModel comboBoxData = new ViewModel();
public ObservableCollection<Employee> EmployeeCollection { get; set; }
public MainPage()
{
InitializeComponent();
EmployeeCollection = new ObservableCollection<Employee>();
var employee = comboBoxData.ItemsSource.GetItems<Employee>();
foreach (Employee emp in employee)
{
EmployeeCollection.Add(emp);
}
comboBox.BindingContext = this;
}
} |