silverlight 中的busyIndicator 加载控件

silverlight 中的busyIndicator 加载控件,第1张

概述XAML代码 <UserControl x:Class="SilverlightApplication9.MainPage"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmln

XAML代码

<UserControl x:Class="SilverlightApplication9.MainPage"
    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"
    mc:Ignorable="d"
    d:DesignHeight="598" d:DesignWIDth="825" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">

    <GrID x:name="LayoutRoot" Background="White" Height="528" WIDth="743">
        <Canvas Height="506" HorizontalAlignment="left" margin="10,10,0" name="canvas1" VerticalAlignment="top" WIDth="733">
            <TextBox Canvas.left="185" Canvas.top="36" Height="157" name="textBox1" WIDth="301" />
            <button Canvas.left="293" Canvas.top="264" Content="填入数据" Height="23" name="button1" WIDth="75" Click="button1_Click" />
          
        </Canvas>
        <Canvas Canvas.left="10" Canvas.top="10" name="canvas2" margin="13,19,0"  Background="White" Visibility="Collapsed">
                <toolkit:BusyIndicator Canvas.left="207" Canvas.top="211" Height="95"  name="busyIndicator1" WIDth="304" BusyContent="正在加载数据,请稍后!" IsBusy="False" />
            </Canvas>
    </GrID>
</UserControl>

 

CS代码

using System;
using System.Collections.Generic;
using System.linq;
using System.Net;
using System.windows;
using System.windows.Controls;
using System.windows.documents;
using System.windows.input;
using System.windows.Media;
using System.windows.Media.Animation;
using System.windows.Shapes;
using System.Threading;

namespace SilverlightApplication9
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private voID button1_Click(object sender,RoutedEventArgs e)
        {

            busyIndicator1.IsBusy = true;
            textBox1.Text = "123333333333333333333333333333333334566666666666666";
            canvas2.Visibility = Visibility.Visible;
            ThreadPool.QueueUserWorkItem((threadState) =>
            {
                Thread.Sleep(5000);
                dispatcher.BeginInvoke(() =>
                 canvas2.Visibility = Visibility.Collapsed);
                dispatcher.BeginInvoke(() =>
                              busyIndicator1.IsBusy = false);
            });
        }
    }
}

 实例下载http://download.csdn.net/detail/bychentufeiyang/3914725

总结

以上是内存溢出为你收集整理的silverlight 中的busyIndicator 加载控件全部内容,希望文章能够帮你解决silverlight 中的busyIndicator 加载控件所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1071104.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存