WPF Extended.Wpf.Toolkit 加载界面

1、NuGet 中安装 Extended.Wpf.Toolkit 。

2、在MainWindow.xaml中添加xmlns:tk="http://schemas.xceed.com/wpf/xaml/toolkit" 。

MainWindow.xaml 代码如下。

<Window x:Class="WPF_Extended_Wpf_Toolkit_Loading.MainWindow"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

xmlns:local="clr-namespace:WPF_Extended_Wpf_Toolkit_Loading"

xmlns:tk="http://schemas.xceed.com/wpf/xaml/toolkit"

mc:Ignorable="d"

Title="MainWindow" Height="300" Width="300">

<tk:BusyIndicator x:Name="BusyIndicator">

<Grid>

<Button x:Name="btnShowOrHideLoading" Width="100" Height="30" Content="显示加载框" Click="btnShowOrHideLoading_Click"/>

</Grid>

</tk:BusyIndicator>

</Window>

MainWindow.xaml.cs 代码如下。

using System;

using System.Collections.Generic;

using System.Linq;

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;

namespace WPF_Extended_Wpf_Toolkit_Loading

{

/// <summary>

/// Interaction logic for MainWindow.xaml

/// </summary>

public partial class MainWindow : Window

{

bool isBusy = false;

public MainWindow()

{

InitializeComponent();

}

private void btnShowOrHideLoading_Click(object sender, RoutedEventArgs e)

{

this.BusyIndicator.IsBusy = !isBusy;

if (this.BusyIndicator.IsBusy)

{

this.BusyIndicator.BusyContent = "正在加载";

}

}

}

}

3、这么简单应该不会还有人做不出来吧?做不出来的话那么下载一下我的资源吧。

https://download.csdn.net/download/xingchengaiwei/89146373

相关推荐
Scout-leaf8 天前
WPF新手村教程(三)—— 路由事件
c#·wpf
柒.梧.10 天前
基于SpringBoot+JWT 实现Token登录认证与登录人信息查询
wpf
十月南城13 天前
Flink实时计算心智模型——流、窗口、水位线、状态与Checkpoint的协作
大数据·flink·wpf
听麟16 天前
HarmonyOS 6.0+ 跨端会议助手APP开发实战:多设备接续与智能纪要全流程落地
分布式·深度学习·华为·区块链·wpf·harmonyos
@hdd16 天前
Kubernetes 可观测性:Prometheus 监控、日志采集与告警
云原生·kubernetes·wpf·prometheus
zls36536516 天前
C# WPF canvas中绘制缺陷分布map
开发语言·c#·wpf
专注VB编程开发20年16 天前
c#Redis扣款锁的设计,多用户,多台电脑操作
wpf
闲人编程17 天前
定时任务与周期性调度
分布式·python·wpf·调度·cron·定时人物·周期性
zls36536517 天前
C# WPF canvas中绘制缺陷分布map并实现缩放
开发语言·c#·wpf
数据知道18 天前
PostgreSQL:Citus 分布式拓展,水平分片,支持海量数据与高并发
分布式·postgresql·wpf