Skip to content

Commit 3d5141c

Browse files
977013 - Kanban Getting Started md file review corrections addressed (code snippet modified properly)
1 parent 594340e commit 3d5141c

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

MAUI/Kanban-Board/Cards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var cardTemplate = new DataTemplate(() =>
8080
WidthRequest = 250,
8181
Orientation = StackOrientation.Vertical,
8282
Padding = new Thickness(10),
83-
BackgroundColor = Color.Gray
83+
BackgroundColor = Colors.Gray
8484
};
8585

8686
HorizontalStackLayout titleLayout = new HorizontalStackLayout();

MAUI/Kanban-Board/Getting-Started.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ using Syncfusion.Maui.Kanban;
375375
SfKanban kanban = new SfKanban();
376376
KanbanViewModel viewModel = new KanbanViewModel();
377377
kanban.AutoGenerateColumns = false;
378-
kanban.ItemsSource = viewModel.Cards;
379378

380379
kanban.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;
404404
this.Content = kanban;
405405

406406
{% endhighlight %}
@@ -529,13 +529,51 @@ Let’s look at the practical code example:
529529
SfKanban kanban = new SfKanban();
530530
KanbanViewModel viewModel = new KanbanViewModel();
531531
kanban.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+
532570
kanban.ItemsSource = viewModel.Cards;
533571
this.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

Comments
 (0)