步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

3 years ago
using BBWY.Client.Models;
using BBWY.Controls;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
namespace BBWY.Client.Views
{
/// <summary>
/// SelectShop.xaml 的交互逻辑
/// </summary>
public partial class SelectShop : BWindow
{
public IList<Department> DepartmentList { get; set; }
3 years ago
public Shop Shop { get; set; }
public SelectShop(IList<Department> departmentList)
3 years ago
{
InitializeComponent();
this.DepartmentList = departmentList;
3 years ago
this.Loaded += SelectShop_Loaded;
}
private void SelectShop_Loaded(object sender, RoutedEventArgs e)
{
var d = cbx_department.SelectedItem as Department;
3 years ago
cbx_shop.ItemsSource = d.ShopList;
3 years ago
}
private void btn_ok_Click(object sender, RoutedEventArgs e)
{
3 years ago
Shop = cbx_shop.SelectedItem as Shop;
this.DialogResult = true;
this.Close();
}
3 years ago
3 years ago
private void cbx_department_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var d = cbx_department.SelectedItem as Department;
3 years ago
cbx_shop.ItemsSource = d.ShopList;
cbx_shop.SelectedIndex = 0;
3 years ago
}
}
}