Microsoft introduced support for implementing MS Teams applications in Visual Studio 2022 version 17.3. This blog walks you through the steps for creating a Microsoft Teams app in Blazor and integrating the Syncfusion Blazor component into it.
The Syncfusion Blazor component library offers over 70 responsive and lightweight UI controls for building modern web apps.
Let’s get started!
Please refer to the Microsoft docs guide, with step-by-step instructions for installing workloads in Visual Studio, creating a Microsoft Teams tenant, and enabling sideloading to test the app.
Now, the application has been added to MS Teams as a Tab.
@using Syncfusion.Blazor
using MyTeamsApp1.Interop.TeamsSDK; using Syncfusion.Blazor; var builder = WebApplication.CreateBuilder(args); ... builder.Services.AddHttpContextAccessor(); builder.Services.AddSyncfusionBlazor(); ...
<head> ... <link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" /> <script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script> </head>
@using Syncfusion.Blazor.Kanban @using Syncfusion.Blazor.Buttons @using Syncfusion.Blazor.Notifications @using System.Collections.ObjectModel; @using System.ComponentModel; <div class="col-lg-12 control-section"> <div class="content-wrapper" id="toast-kanban-observable"> <div class="row"> <SfKanban KeyField="Status" DataSource="@ObservableData"> <KanbanColumns> @foreach (ColumnModel item in columnData) { <KanbanColumn HeaderText="@item.HeaderText" KeyField="@item.KeyField" AllowAdding="true" /> } </KanbanColumns> <KanbanCardSettings HeaderField="Id" ContentField="Summary" /> <KanbanSwimlaneSettings KeyField="Assignee"></KanbanSwimlaneSettings> </SfKanban> </div> </div> </div>
public ObservableCollection<ObservableDatas> ObservableData { get; set; } List<ObservableDatas> Tasks = new List<ObservableDatas>(); private List<ColumnModel> columnData = new List<ColumnModel>() { new ColumnModel(){ HeaderText= "To Do", KeyField= new List<string>() { "Open" } }, new ColumnModel(){ HeaderText= "In Progress", KeyField= new List<string>() { "In Progress" } }, new ColumnModel(){ HeaderText= "Testing", KeyField= new List<string>() { "Testing" } }, new ColumnModel(){ HeaderText= "Done", KeyField=new List<string>() { "Close" } } }; protected override void OnInitialized() { Tasks = Enumerable.Range(1, 20).Select(x => new ObservableDatas() { Id = "Task 1000" + x, Status = (new string[] { "Open", "In Progress", "Testing", "Close" })[new Random().Next(4)], Summary = (new string[] { "Analyze the new requirements gathered from the customer.", "Improve application performance", "Fix the issues reported in the IE browser.", "Validate new requirements", "Test the application in the IE browser." })[new Random().Next(5)], Assignee = (new string[] { "Nancy Davloio", "Andrew Fuller", "Janet Leverling", "Steven walker", "Margaret hamilt", "Michael Suyama", "Robert King" })[new Random().Next(7)], }).ToList(); ObservableData = new ObservableCollection<ObservableDatas>(Tasks); } public class ObservableDatas : INotifyPropertyChanged { public string Id { get; set; } private string status { get; set; } public string Status { get { return status; } set { this.status = value; NotifyPropertyChanged("Status"); } } public string Summary { get; set; } public string Assignee { get; set; } public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(string propertyName) { var handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(propertyName)); } } }
Output:
View the complete example of the Microsoft Teams app with Blazor Syncfusion controls on GitHub.
Thanks for reading! In this blog, we have seen the creation of a Microsoft Teams application with Syncfusion Blazor UI components. Try out the steps in this blog post and leave your feedback in the comments section below!
Try our Blazor components by downloading a free 30-day trial or downloading our NuGet package. Feel free to have a look at our online examples and documentation to explore other available features.
For questions, you can contact us through our support forum, support portal, or feedback portal. We are always happy to assist you!