- App Todoist
- To Do List App
- To Do List App Windows 10
- App To Do List Move Task To Next Day
- App To Do List Iphone
- To Do List On Desktop
To Do is integrated with Outlook Tasks, making it easier to manage all your tasks in one place. Access from anywhere Microsoft To Do is available for free, and syncs across iPhone, Android, Windows 10, and the web.
- After the app is running, visit the new Todo page by selecting the Todo link in the app's navigation bar, which loads the page at /todo. Leave the app running the command shell. Each time a file is saved, the app is automatically rebuilt. The browser temporarily loses its connection to the app while compiling and restarting.
- Microsoft To Do. To Do gives you focus, from work to play.
App Todoist
This tutorial shows you how to build and modify a Blazor app. You learn how to:
- Create a todo list Blazor app project
- Modify Razor components
- Use event handling and data binding in components
- Use routing in a Blazor app
At the end of this tutorial, you'll have a working todo list app.
Prerequisites
Create a todo list Blazor app
To Do List App
Create a new Blazor app named
TodoList
in a command shell:The preceding command creates a folder named
TodoList
with the-o|--output
option to hold the app. TheTodoList
folder is the root folder of the project. Change directories to theTodoList
folder with the following command:Add a new
Todo
Razor component to the app using the following command:The
-n|--name
option in the preceding command specifies the name of the new Razor component. The new component is created in the project'sPages
folder with the-o|--output
option.Important
Razor component file names require a capitalized first letter. Open the
Pages
folder and confirm that theTodo
component file name starts with a capital letterT
. The file name should beTodo.razor
.Open the
Todo
component in any file editor and add an@page
Razor directive to the top of the file with a relative URL of/todo
.Pages/Todo.razor
:Save the
Pages/Todo.razor
file.Add the
Todo
component to the navigation bar.The
NavMenu
component is used in the app's layout. Layouts are components that allow you to avoid duplication of content in an app. TheNavLink
component provides a cue in the app's UI when the component URL is loaded by the app.In the unordered list (
<ul>...</ul>
) of theNavMenu
component, add the following list item (<li>...</li>
) andNavLink
component for theTodo
component.In
Shared/NavMenu.razor
:Save the
Shared/NavMenu.razor
file.Build and run the app by executing the
dotnet watch run
command in the command shell from theTodoList
folder. After the app is running, visit the new Todo page by selecting theTodo
link in the app's navigation bar, which loads the page at/todo
.Leave the app running the command shell. Each time a file is saved, the app is automatically rebuilt. The browser temporarily loses its connection to the app while compiling and restarting. The page in the browser is automatically reloaded when the connection is re-established.
Add a
TodoItem.cs
file to the root of the project (theTodoList
folder) to hold a class that represents a todo item. Use the following C# code for theTodoItem
class.TodoItem.cs
:Note
If using Visual Studio to create the
TodoItem.cs
file andTodoItem
class, use either of the following approaches:- Remove the namespace that Visual Studio generates for the class.
- Use the Copy button in the preceding code block and replace the entire contents of the file that Visual Studio generates.
Return to the
Todo
component and perform the following tasks:- Add a field for the todo items in the
@code
block. TheTodo
component uses this field to maintain the state of the todo list. - Add unordered list markup and a
foreach
loop to render each todo item as a list item (<li>
).
Pages/Todo.razor
:- Add a field for the todo items in the
The app requires UI elements for adding todo items to the list. Add a text input (
<input>
) and a button (<button>
) below the unordered list (<ul>...</ul>
):Save the
TodoItem.cs
file and the updatedPages/Todo.razor
file. In the command shell, the app is automatically rebuilt when the files are saved. The browser temporarily loses its connection to the app and then reloads the page when the connection is re-established.When the
Add todo
button is selected, nothing happens because an event handler isn't attached to the button.Add an
AddTodo
method to theTodo
component and register the method for the button using the@onclick
attribute. TheAddTodo
C# method is called when the button is selected:To get the title of the new todo item, add a
newTodo
string field at the top of the@code
block:Modify the text
<input>
element to bindnewTodo
with the@bind
attribute:Update the
AddTodo
method to add theTodoItem
with the specified title to the list. Clear the value of the text input by settingnewTodo
to an empty string:Save the
Pages/Todo.razor
file. The app is automatically rebuilt in the command shell. The page reloads in the browser after the browser reconnects to the app.The title text for each todo item can be made editable, and a check box can help the user keep track of completed items. Add a check box input for each todo item and bind its value to the
IsDone
property. Change@todo.Title
to an<input>
element bound totodo.Title
with@bind
:Update the
<h3>
header to show a count of the number of todo items that aren't complete (IsDone
isfalse
).The completed
Todo
component (Pages/Todo.razor
):Save the
Pages/Todo.razor
file. The app is automatically rebuilt in the command shell. The page reloads in the browser after the browser reconnects to the app.Add items, edit items, and mark todo items done to test the component.
When finished, shut down the app in the command shell. Many command shells accept the keyboard command Ctrl+c to stop an app.
To Do List App Windows 10
Next steps
App To Do List Move Task To Next Day
In this tutorial, you learned how to:
App To Do List Iphone
- Create a todo list Blazor app project
- Modify Razor components
- Use event handling and data binding in components
- Use routing in a Blazor app
To Do List On Desktop
Learn about tooling for ASP.NET Core Blazor: