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

相关推荐
明耀3 小时前
WPF DataGrid 默认显示行号
wpf
lph19727 小时前
wpf的converter
wpf
fyifei05587 小时前
WPF学习PropertyChanged
wpf
爱炸薯条的小朋友7 小时前
C#由于获取WPF窗口名称造成的异常报错问题
windows·c#·wpf
baivfhpwxf20238 小时前
wpf ListBox 去除item 单击样式
wpf
诗仙&李白8 小时前
lnnovationHubTool,用prism+WPF编写的MVVM模式的快速上位机软件开发框架平台
wpf·mvvm·prism·上位机软件开发框架平台
程序员小刘11 小时前
【HarmonyOS 5】教育开发实践详解以及详细代码案例
华为·wpf·harmonyos
Java Fans1 天前
在WPF项目中集成Python:Python.NET深度实战指南
python·.net·wpf
布伦鸽1 天前
C# WPF 左右布局实现学习笔记(1)
笔记·学习·c#·wpf
code bean2 天前
【WPF】WPF 项目实战:构建一个可增删、排序的光源类型管理界面(含源码)
wpf