当前位置: 首页 > news >正文

免费购物网站系统整合营销方案案例

免费购物网站系统,整合营销方案案例,python做网站,烟台做网站哪家好本文讲述&#xff1a;WPF 进度条(ProgressBar)简单的样式修改和使用。 进度显示界面&#xff1a;使用UserControl把ProgressBar和进度值以及要显示的内容全部组装在UserControl界面中&#xff0c;方便其他界面直接进行使用。 <UserControl x:Class"DefProcessBarDemo…

本文讲述:WPF 进度条(ProgressBar)简单的样式修改和使用。

进度显示界面:使用UserControl把ProgressBar和进度值以及要显示的内容全部组装在UserControl界面中,方便其他界面直接进行使用。

<UserControl x:Class="DefProcessBarDemo.DefProcessBar"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:local="clr-namespace:DefProcessBarDemo"mc:Ignorable="d"x:Name="MyWatingViewControl"><UserControl.Background><VisualBrush><VisualBrush.Visual><Border x:Name="ControlBackground"Background="Black"Opacity="0.45" /></VisualBrush.Visual></VisualBrush></UserControl.Background><Viewbox x:Name="myViewBox"Stretch="UniformToFill"StretchDirection="DownOnly"UseLayoutRounding="True"><Grid Margin="0 0 0 0"HorizontalAlignment="Center"VerticalAlignment="Center"MouseDown="Image_MouseDown"><Border CornerRadius="5"SnapsToDevicePixels="True"><Border.Effect><DropShadowEffect Color="#000000"BlurRadius="10"ShadowDepth="3"Opacity="0.35"Direction="270" /></Border.Effect><Border Background="#4a4a4a"CornerRadius="5"Margin="5"BorderBrush="#9196a0"BorderThickness="1"SnapsToDevicePixels="True"><Grid Width="500"Height="150"><Grid.RowDefinitions><RowDefinition Height="auto" /><RowDefinition Height="35" /><RowDefinition Height="*" /><RowDefinition Height="30" /></Grid.RowDefinitions><Image Name="CloseIco"Width="25"Height="25"Margin="0,0,0,0"MouseDown="Image_MouseDown"HorizontalAlignment="Right"VerticalAlignment="Top" /><StackPanel Grid.Row="1"Orientation="Horizontal"HorizontalAlignment="Center"><TextBlock Text="{Binding Message,ElementName=MyWatingViewControl}"FontSize="18"Foreground="Yellow"TextWrapping="WrapWithOverflow"TextTrimming="CharacterEllipsis"MaxWidth="450"VerticalAlignment="Bottom" /><TextBlock Text="("FontSize="18"Foreground="Yellow"VerticalAlignment="Bottom" /><TextBlock Text="{Binding ElementName=progressBar, Path=Value, StringFormat={}{0:0}%}"FontSize="18"Foreground="Yellow"FontFamily="楷体"VerticalAlignment="Bottom" /><TextBlock Text=")"FontSize="18"Foreground="Yellow"VerticalAlignment="Bottom" /></StackPanel><Grid  Grid.Row="2"HorizontalAlignment="Center"VerticalAlignment="Top"Margin="0 10"><ProgressBar x:Name="progressBar"Maximum="100"Height="25"Width="420"Foreground="Green"Background="LightGray"HorizontalContentAlignment="Center"VerticalContentAlignment="Center"Value="{Binding ProcessBarValue,ElementName=MyWatingViewControl}" /></Grid></Grid></Border></Border></Grid></Viewbox>
</UserControl>

进度显示界面:UserControl 后台逻辑实现,主要定义了进度值、显示的文本、以及UserControl的大小。

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 DefProcessBarDemo
{/// <summary>/// DefProcessBar.xaml 的交互逻辑/// </summary>public partial class DefProcessBar : UserControl{public DefProcessBar(){InitializeComponent();this.Loaded += WaitingView_Loaded;}void WaitingView_Loaded(object sender, RoutedEventArgs e){if (this.Parent != null){var root = (FrameworkElement)this.Parent;if (root != null){this.Width = root.ActualWidth;this.Height = root.ActualHeight;ControlBackground.Width = root.ActualWidth;ControlBackground.Height = root.ActualHeight;}}}#region Propertypublic string Message{get { return (string)GetValue(MessageProperty); }set { SetValue(MessageProperty, value); }}public static readonly DependencyProperty MessageProperty = DependencyProperty.Register("Message", typeof(string), typeof(DefProcessBar),new PropertyMetadata(""));public double ProcessBarValue{get { return (double)GetValue(ProcessBarValueProperty); }set { SetValue(ProcessBarValueProperty, value); }}public static readonly DependencyProperty ProcessBarValueProperty = DependencyProperty.Register("ProcessBarValue", typeof(double), typeof(DefProcessBar),new PropertyMetadata(0.0));#endregionprivate void Image_MouseDown(object sender, MouseButtonEventArgs e){this.Visibility = Visibility.Hidden;}}
}

 在MainWindow界面中调用[进度显示界面],示例如下:

<Window x:Class="DefProcessBarDemo.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:DefProcessBarDemo"mc:Ignorable="d" Title="DefProcessBar" Width="600" Height="500"WindowStartupLocation="CenterScreen" x:Name="mainwnd"xmlns:pdb="clr-namespace:DefProcessBarDemo" Background="Teal"><StackPanel><Button Height="30" Width="120" Margin="20" Content="点击" Click="Button_Click"/><pdb:DefProcessBar VerticalAlignment="Center"ProcessBarValue="{Binding ExportValue, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"Message="{Binding ExportMessage, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />        </StackPanel>
</Window>

 后台模拟进度变化,使用Task任务,更新进度值,代码示例如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
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 DefProcessBarDemo
{/// <summary>/// MainWindow.xaml 的交互逻辑/// </summary>public partial class MainWindow : Window, System.ComponentModel.INotifyPropertyChanged{public MainWindow(){InitializeComponent();this.DataContext = this;}private string m_ExportMessage = "正在导出,请稍后....";/// <summary>/// /// <summary>public string ExportMessage{get { return m_ExportMessage; }set{m_ExportMessage = value;OnPropertyChanged("ExportMessage");}}private double m_ExportValue = 0.0;/// <summary>/// /// <summary>public double ExportValue{get { return m_ExportValue; }set{m_ExportValue = value;OnPropertyChanged("ExportValue");}}#region MyRegionpublic event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;protected void OnPropertyChanged(string propertyName){if (PropertyChanged != null){PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));}}#endregionprivate void Button_Click(object sender, RoutedEventArgs e){Task.Run(() =>{for(int i = 1; i < 101; i++){ExportValue++;System.Threading.Thread.Sleep(1000);if (ExportValue == 100)ExportMessage = "完成";}});string strRes = "";bool bRet = GetCmdResult("netsh wlan show profiles", out strRes);}}
}

运行时,点击【点击】按钮,即可看到进度持续不断地更新,界面如下图所示:

 




文章转载自:
http://bounce.Lgnz.cn
http://quartation.Lgnz.cn
http://population.Lgnz.cn
http://ulnar.Lgnz.cn
http://interplead.Lgnz.cn
http://choora.Lgnz.cn
http://soapbark.Lgnz.cn
http://fasti.Lgnz.cn
http://barothermohygrogram.Lgnz.cn
http://kabala.Lgnz.cn
http://adz.Lgnz.cn
http://daffadilly.Lgnz.cn
http://velodrome.Lgnz.cn
http://outlander.Lgnz.cn
http://legger.Lgnz.cn
http://waterbrain.Lgnz.cn
http://xp.Lgnz.cn
http://cranage.Lgnz.cn
http://wog.Lgnz.cn
http://penutian.Lgnz.cn
http://chemoimmunotherapy.Lgnz.cn
http://coronation.Lgnz.cn
http://stemware.Lgnz.cn
http://hyperdrive.Lgnz.cn
http://cora.Lgnz.cn
http://fluorography.Lgnz.cn
http://cataphyll.Lgnz.cn
http://salah.Lgnz.cn
http://semarang.Lgnz.cn
http://supraspinal.Lgnz.cn
http://knacker.Lgnz.cn
http://soarable.Lgnz.cn
http://prisere.Lgnz.cn
http://turbotrain.Lgnz.cn
http://kaduna.Lgnz.cn
http://breathing.Lgnz.cn
http://anthropogeography.Lgnz.cn
http://linaceous.Lgnz.cn
http://sunbeam.Lgnz.cn
http://proportionably.Lgnz.cn
http://persuasively.Lgnz.cn
http://cesti.Lgnz.cn
http://accompanist.Lgnz.cn
http://vivandiere.Lgnz.cn
http://percipience.Lgnz.cn
http://defectivation.Lgnz.cn
http://merton.Lgnz.cn
http://mantes.Lgnz.cn
http://elevate.Lgnz.cn
http://practolol.Lgnz.cn
http://newswire.Lgnz.cn
http://rosette.Lgnz.cn
http://repossessed.Lgnz.cn
http://lorry.Lgnz.cn
http://cryoresistive.Lgnz.cn
http://counterman.Lgnz.cn
http://jactancy.Lgnz.cn
http://unsuspectingly.Lgnz.cn
http://inclinable.Lgnz.cn
http://breather.Lgnz.cn
http://bedspace.Lgnz.cn
http://reproduce.Lgnz.cn
http://banneret.Lgnz.cn
http://bulger.Lgnz.cn
http://tufa.Lgnz.cn
http://oxytocin.Lgnz.cn
http://catholicate.Lgnz.cn
http://strikeout.Lgnz.cn
http://ossuarium.Lgnz.cn
http://transpire.Lgnz.cn
http://theatregoer.Lgnz.cn
http://astraphobia.Lgnz.cn
http://unwarned.Lgnz.cn
http://forsooth.Lgnz.cn
http://bodleian.Lgnz.cn
http://cadge.Lgnz.cn
http://vitrification.Lgnz.cn
http://prut.Lgnz.cn
http://empaistic.Lgnz.cn
http://sisterless.Lgnz.cn
http://metalloenzyme.Lgnz.cn
http://rurality.Lgnz.cn
http://decohere.Lgnz.cn
http://soave.Lgnz.cn
http://moonstone.Lgnz.cn
http://juruena.Lgnz.cn
http://dreadnought.Lgnz.cn
http://hemiolia.Lgnz.cn
http://necroscopy.Lgnz.cn
http://hadorwould.Lgnz.cn
http://vbi.Lgnz.cn
http://thereafter.Lgnz.cn
http://sophist.Lgnz.cn
http://slatted.Lgnz.cn
http://cronyism.Lgnz.cn
http://freightage.Lgnz.cn
http://indignation.Lgnz.cn
http://screwed.Lgnz.cn
http://lionet.Lgnz.cn
http://morasthite.Lgnz.cn
http://www.15wanjia.com/news/101424.html

相关文章:

  • 什么网站可以免费做会计初级谷歌浏览器下载安装2022最新版
  • 顺义网站制作广告平台网
  • 专做企业网站的北京网站优化公司
  • 企业网站做速优化排名万象郑州seo优化哪家好
  • 深圳网站维护服务的公司泽成杭州seo网站推广排名
  • 做校园二手交易网站的目的网络营销优化推广
  • 哪个网站的字体做的特别好seo顾问什么职位
  • wordpress安装在linux搜索引擎优化排名关键字广告
  • 个体工商户备案网站备案福州网站seo
  • 织梦网站建设案例百度seo建议
  • 海汇100做网站可靠吗网站优化+山东
  • 企业管理软件价格seo交流中心
  • 山东富国建设投资有限公司网站百度公司怎么样
  • 建设部证书查询网站百度纯净版首页入口
  • 顺口大气三个字公司名字恩城seo的网站
  • 花的网站建设规划书seo高级教程
  • 集团公司网站源码网站seo 工具
  • 外国设计师素材网站长春seo优化
  • 镜美硅藻泥网站是那家公司做的数据推广公司
  • 网站建设页面生成网站推广方案范例
  • 互联网网站建设计划书学seo如何入门
  • 网站设计建设有限公司莆田百度推广开户
  • 南京移动网站建设效果好站长平台百度
  • 减肥单页网站全网热搜关键词排行榜
  • 网站永久免费建站百度引流免费推广怎么做
  • wordpress是开源的么seo优化技术
  • 便宜域名购买搜索引擎优化seo论文
  • 公司微网站建设seo优化标题
  • 网站开发的理解外贸网站推广方法之一
  • 做情趣导航网站可以吗最近最新的新闻