资源简介
WPF-省市县3级联动,非专业WPF/C#人员,只是在网上没找到特别合适的,所以自己做了一个。
代码片段和文件信息
using Baolaitong.baseService.ViewModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
namespace Baolaitong.WpfShellPlugin.Content
{
///
/// AreaSelect.xaml 的交互逻辑
///
public partial class AreaSelect : UserControl INotifyPropertyChanged
{
private IList _provinces = new List();
public static readonly DependencyProperty ProvinceProperty = DependencyProperty.Register(“Province“ typeof(string) typeof(AreaSelect) new frameworkPropertymetadata(string.Empty));
public static readonly DependencyProperty CityProperty = DependencyProperty.Register(“City“ typeof(string) typeof(AreaSelect) new frameworkPropertymetadata(string.Empty));
public static readonly DependencyProperty CountyProperty = DependencyProperty.Register(“County“ typeof(string) typeof(AreaSelect) new frameworkPropertymetadata(string.Empty));
public IList Provinces
{
get
{
return _provinces;
}
set
{
_provinces.Clear();
if (value != null)
{
foreach (Province province in value)
{
_provinces.Add(province);
}
}
}
}
public AreaSelect()
{
InitializeComponent();
this.Content.DataContext = this;
this.PropertyChanged += SelectedArea_PropertyChanged;
}
private void SelectedArea_PropertyChanged(object sender PropertyChangedEventArgs e)
{
Console.WriteLine(Province + “ “ + City + “ “ + County);
}
private string _province;
private string _city;
private string _county;
public string Province
{
get { return _province; }
set
{
_province = value;
_city = string.Empty;
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this new PropertyChangedEventArgs(“Province“));
}
}
}
public string City
{
get { return _city; }
set
{
_city = value;
_county = string.Empty;
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this new PropertyChangedEventArgs(“City“));
}
}
}
public string County
{
get { return _county; }
set
{
_county = value;
if (PropertyChanged !
相关资源
- WPF自定义文本下拉框模仿百度搜索
- 自定义时间轴,Custom Slider,WPF编程
- WPF DataGrid绑定DataTable demo
- WPF开发框架源码适合新手.txt
- WPF查看Word文档应用程序源码C#源码
- WPFMVVMDemo订餐系统源代码
- WPF中支持检索的双列下拉框
- WPF-DataGrid中CheckBox实现全选与非全选
- wpf ruler 标尺控件 源码
- WPF DataGrid数据复制
- wpf 漂亮Treeview
- wpf Expander 动画效果
- 基本WPF的缩略图
- WPF模拟迅雷TabControl界面
- Ab3d.PowerToys破解版
- WPF 环形菜单控件
- WPF C# 轮播图
- WPF导入导出Excel
- 用WPF实现的加载数据的Loading动画...
- wpf treeview checkbox
- WPF环形图表
- wpf实现Socket通信
- VisiFire for Wpf 3.6.8 去水印版本
-
PWPF原理及仿真含simuli
nk模型和m文件 - wpf socket
-
Wpf下fr
ame、MDI、TabControl简单应用 - 语音聊天WPF
- Wpf 加载 Cur资源
- WPF开发的仪表盘
- WPF 环形进度条
评论
共有 条评论