You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adding Avalonia sample
* WIP
* Implement asnyc IsCheckedChanged support
* fix asynv save
* WIP add some debug data
* Improving the debug sample
* order items by ID
* Adding Avalonia.md to the docs
* minor readme improvement
* Improve AvaloniaSample
- improved Messenger system
- Added more comments and explanations
* Add sample screenshot to the docs
* use nuget instead of project reference
* Try fixing review
- Added LoggingHandler
- Renamed `TodoItem.Content` -> `TodoItem.Title` to match running DataSync-server
The Avalonia sample uses an in-memory Sqlite store for storing its data. The sample can run on Desktop, Mobile and Browser. To run the application locally:
8
+
9
+
*[Configure Visual Studio for Avalonia development](https://docs.avaloniaui.net/docs/welcome).
10
+
* Open `samples/todoapp/Samples.TodoApp.sln` in Visual Studio.
11
+
* In the Solution Explorer, expand the folder `TodoApp.Avalonia` and right-click the `TodoApp.Avalonia.Desktop` project, then select **Set as Startup Project**.
12
+
* Select a target (in the top bar), then press F5 to run the application.
13
+
14
+
> [!TIP]
15
+
> We suggest to start testing and debugging using the Desktop App first. Once you feel confident, you can also try out Mobile or Browser version.
16
+
17
+
> [!NOTE]
18
+
> If you bump into issues at this point, please visit [Avalonia.Docs](https://docs.avaloniaui.net) and [Avalonia.Samples](https://github.com/AvaloniaUI/Avalonia.Samples) for some basic getting-started tutorials.
19
+
20
+
This is how the sample will look like:
21
+

22
+
23
+
24
+
## Deploy a datasync server to Azure
25
+
26
+
Before you begin adjusting the application for offline usage, you must [deploy a datasync service](../server.md). Make a note of the URI of the service before continuing.
27
+
28
+
## Update the application for datasync operations
29
+
30
+
All the changes are isolated to the `Database/AppDbContext.cs` file.
31
+
32
+
1. Change the definition of the class so that it inherits from `OfflineDbContext`:
Replace the Endpoint with the URI of your datasync service.
56
+
57
+
3. Update the `SynchronizeAsync()` method.
58
+
59
+
The `SynchronizeAsync()` method is used by the application to synchronize data to and from the datasync service. It is called primarily from the `MainViewModel` which drives the UI interactions for the main list.
Obviously, youwillwanttodomuchmoreina"real world"application, includingpropererrorhandling, authentication, andusing a Sqlite file instead of an in-memory database. This example shows off the minimum required to add datasync services to an application.
0 commit comments