Develop Windows programs using C#

Use WebAPI.Client to develop WPF program.
  1. Use Visual Studio 2022 to develop software, create a new WPF Application project
  2. Add project reference: IoT.API.WebApi.Client.dll
  3. Create a new MainWindow.xaml window and add the following code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Reflection;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using IoT.API.WebApi.Client;
    namespace IoT.Example.WpfApp
        public partial class MainWindow : Window
            public string AppId { get; set; }
            public string AppKey { get; set; }
            public string AppSecret { get; set; }
            public MainWindow()
                AppClient.GetInstance().Initialize(AppId, AppKey, AppSecret);
  4. After completing the above operations, you can use AppClient.GetInstance() to call the Web API function in the program. Please refer to the sample program for details.

Download the WPF sample program

WPF sample program, the operating environment requirements are .Net Core 5

  1. Example Source Code: