I am trying to use data-binding for creating a SFTabControl on the MainPage using the code provided in one of the help pages of syncfusion for sftabcontrol (https://help.syncfusion.com/uwp/sftabcontrol/populating-items).
However, I am getting a blank page (and not tabs created)
Following is my code:
<Page
x:Class="Man.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Man"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:syncfusion="using:Syncfusion.UI.Xaml.Grid"
xmlns:navigation="using:Syncfusion.UI.Xaml.Controls.Navigation"
RequestedTheme="Dark"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<navigation:SfTabControl Grid.Row="0" ItemsSource="{Binding Employees}"/>
</Grid>
</Page>
namespace Man
{
public class Employee
{
public string Name { get; set; }
public string Description { get; set; }
}
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
private List<Employee> employees;
public List<Employee> Employees
{
get { return employees; }
set { employees = value; }
}
public MainPage()
{
this.InitializeComponent();
Employees = new List<Employee>();
Employees.Add(new Employee() { Name = "James", Description = "Description about James" });
Employees.Add(new Employee() { Name = "Linda", Description = "Description about Linda" });
Employees.Add(new Employee() { Name = "Carl", Description = "Description about Carl" });
Employees.Add(new Employee() { Name = "Niko", Description = "Description about Niko" });
}
}
}
Can anyone tell me whats wrong with the code.
Also, I am not sure how this approach is supposed to work considering that there is no ObservableCollection implemented.
Is there a simpler working example for using ItemsSource/data-binding with SfTabControl