@@ -375,7 +375,6 @@ using Syncfusion.Maui.Kanban;
375375SfKanban kanban = new SfKanban();
376376KanbanViewModel viewModel = new KanbanViewModel();
377377kanban.AutoGenerateColumns = false;
378- kanban.ItemsSource = viewModel.Cards;
379378
380379kanban.Columns.Add(new KanbanColumn
381380{
@@ -401,6 +400,7 @@ kanban.Columns.Add(new KanbanColumn
401400 Categories = new List<object >() { "Done" },
402401});
403402
403+ kanban.ItemsSource = viewModel.Cards;
404404this.Content = kanban;
405405
406406{% endhighlight %}
@@ -529,13 +529,51 @@ Let’s look at the practical code example:
529529SfKanban kanban = new SfKanban();
530530KanbanViewModel viewModel = new KanbanViewModel();
531531kanban.ColumnMappingPath = "Status";
532+ kanban.CardTemplate = new DataTemplate(() =>
533+ {
534+ StackLayout root = new StackLayout()
535+ {
536+ WidthRequest = 250,
537+ Orientation = StackOrientation.Vertical,
538+ Padding = new Thickness(10),
539+ BackgroundColor = Colors.Gray
540+ };
541+
542+ HorizontalStackLayout titleLayout = new HorizontalStackLayout();
543+ Label title = new Label()
544+ {
545+ TextColor = Colors.Silver,
546+ HorizontalOptions = LayoutOptions.Start
547+ };
548+ title.SetBinding(Label.TextProperty, new Binding("Title"));
549+ titleLayout.Children.Add(title);
550+
551+ StackLayout contentLayout = new StackLayout()
552+ {
553+ Orientation = StackOrientation.Horizontal
554+ };
555+ Label desc = new Label()
556+ {
557+ WidthRequest = 150,
558+ FontSize = 14,
559+ TextColor = Colors.Silver,
560+ LineBreakMode = LineBreakMode.WordWrap
561+ };
562+ desc.SetBinding(Label.TextProperty, new Binding("Description"));
563+ contentLayout.Children.Add(desc);
564+
565+ root.Children.Add(titleLayout);
566+ root.Children.Add(contentLayout);
567+ return root;
568+ });
569+
532570kanban.ItemsSource = viewModel.Cards;
533571this.Content = kanban;
534572
535573{% endhighlight %}
536574{% highlight C# tabtitle="TaskDetails.cs" %}
537575
538- public class TaskDetails : INotifyPropertyChanged
576+ public class TaskDetails
539577{
540578 public string Title { get; set; }
541579 public string Description { get; set; }
0 commit comments