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

相关推荐
中土 不易17 小时前
WPF中XAML的优点
wpf
无所谓จุ๊บ1 天前
使用AI整理知识点--WPF动画核心知识
c#·wpf
xcLeigh2 天前
WPF在特定领域的应用:打造一款专业的图像编辑工具
c#·wpf
吾与谁归in3 天前
WPF给ListBox中的每一项添加右键菜单功能
c#·wpf
千里码!3 天前
RocketMQ延迟消息深度解析:原理、实践与性能调优
wpf·rocketmq
de之梦-御风4 天前
【.NET】WinForms 和 WPF 在性能方面的对比
.net·wpf
Zzu_zzx4 天前
c# wpf 开发中安装使用SqlSugar操作MySql数据库具体操作步骤保姆级教程
mysql·c#·wpf
白白白白纸呀4 天前
WPF框架---MvvmLight介绍
开发语言·c#·wpf
battlestar4 天前
WPF 解决加载顺序,Combox 增加属性,并关联text
windows·wpf
xcLeigh5 天前
WPF高级 | WPF 3D 图形编程基础:创建立体的用户界面元素
ui·3d·c#·wpf