WPF Extended.Wpf.Toolkit 加载界面

ops/2024/9/23 3:30:55/

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


http://www.ppmy.cn/ops/3698.html

相关文章

CentOS常见的命令

CentOS&#xff08;Community ENTerprise Operating System&#xff09;是一个基于Red Hat Enterprise Linux源代码构建的开源企业级Linux发行版。在日常的系统管理和维护中&#xff0c;掌握一些常见的CentOS命令是非常必要的。本文将介绍一些CentOS系统中常用的命令&#xff0…

python爬虫-----深入了解 requests 库(第二十五天)

&#x1f388;&#x1f388;作者主页&#xff1a; 喔的嘛呀&#x1f388;&#x1f388; &#x1f388;&#x1f388;所属专栏&#xff1a;python爬虫学习&#x1f388;&#x1f388; ✨✨谢谢大家捧场&#xff0c;祝屏幕前的小伙伴们每天都有好运相伴左右&#xff0c;一定要天天…

5G网络开通与调测ipv4

要求如下&#xff1a; 1. 勘站规划 1. 【重】首先观察NR频点&#xff0c;完成设备选型 2645--选择N41 3455--选择N78 4725--选择N79 设备选型如下&#xff1a;观察AAU的通道数&#xff0c;最大发射功率&#xff1b;选择N41的选型频段也要选41 2. …

百度文心一言API4.0 Python调用ERNIE-4.0-8K详细教程

ERNIE 4.0是百度自研的旗舰级超大规模⼤语⾔模型&#xff0c;相较ERNIE 3.5实现了模型能力全面升级&#xff0c;广泛适用于各领域复杂任务场景&#xff1b;支持自动对接百度搜索插件&#xff0c;保障问答信息时效&#xff0c;支持5K tokens输入2K tokens输出。ERNIE-4.0-8K是模…

科技小知识-显卡

科技小知识 显卡&#xff0c;也称为图形处理器&#xff08;Graphics Processing Unit&#xff0c;简称GPU&#xff09;&#xff0c;是一种专门用于处理图像和视频数据的硬件设备。它的主要作用是将计算机中的数字信号转换为可以在显示器上显示的图像信号&#xff0c;从而让我们…

ESP32S3在VScode中使用USB口调试

ESP32S3在VScode中使用USB口调试 安装USB驱动修改工程的配置文件launch.jsonsettings.json 启动GDB Server 安装USB驱动 在powershell中输入下面指令&#xff1a; Invoke-WebRequest https://dl.espressif.com/dl/idf-env/idf-env.exe -OutFile .\idf-env.exe; .\idf-env.exe…

AWS-ECR 使用python一键删除ecr所有存储库

注意事项: 创建aksk请确保你拥有删除ECR资源的权限。删除ECR资源是不可逆的操作&#xff0c;请谨慎使用此脚本 import boto3 import json# 设置AKK和SKK access_key_id "YOUR_ACCESS_KEY_ID" secret_access_key "YOUR_SECRET_ACCESS_KEY"# 创建ECR客户…

MacOS Python版本管理(pyenv)

1. 通过 homebrew 安装 pyenv brew update brew install pyenv 2. 修改 zsh profile 否则通过pyenv切换python版本会不生效 # 编辑 .zshrc or ~/.bash_profile vim ~/.zshrc# 在配置下面增加 export PYENV_ROOT"$HOME/.pyenv" export PATH"$PYENV_ROOT/shi…