WPF窗体程序设置图标

1.WPF程序在XAML文件中设置任务栏图标<Window x:Class="ShAirportDataSync.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:ShAirportDataSync" mc...


阅读正文

WPF/Winform中使用异步处理

LblStatus.Content = "正在获取数据..."; BtnGetWeatherRegion.IsEnabled = false; try { var threadDelegate = new ThreadStart(delegate { //异步处理的逻辑代码 listAllRegion = GetRegionLevel1(); //Winform中用Invoke()方法 Dispatcher.Invoke(new MethodInvoker(() => { //异步处理完成之后,回调主线程的控件显示处理状态 LvRegion.ItemsSource = listAllRegion; LblStatus.Content = "数据获取完成,总记录行...


阅读正文

在WPF中使用XAML实现动画

通过XAML的Storyboard来实现元素的动画1.在Window节点下的<Window.Resources>节点中添加<Storyboard>节点,来创建一个动画行为<Window.Resources> <Storyboard x:Key="Image1In"> <DoubleAnimation Storyboard.TargetProperty="(Canvas.Top)" From="200" To="0" Duration="0:0:0.2"></DoubleAnimation> <DoubleAnimation Storyboard.TargetProperty="(Canvas.Opacity)" From="0.1" To="1"...


阅读正文