12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using FurnaceUI.Views.Recipes;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- 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 FurnaceUI.Controls
- {
- /// <summary>
- /// PaginationList.xaml 的交互逻辑
- /// </summary>
- partial class SlotsList : UserControl, INotifyPropertyChanged
- {
- public List<BoatWaferItem> Items
- {
- get { return (List<BoatWaferItem>)GetValue(ItemsProperty); }
- set { SetValue(ItemsProperty, value); }
- }
- public static readonly DependencyProperty ItemsProperty =
- DependencyProperty.Register("Items", typeof(List<BoatWaferItem>), typeof(SlotsList), new PropertyMetadata(null, new PropertyChangedCallback(RenderUpdateByPropertyChanged)));
- public bool IsListEnable
- {
- get { return (bool)GetValue(IsListEnableProperty); }
- set { SetValue(IsListEnableProperty, value); }
- }
- public static readonly DependencyProperty IsListEnableProperty =
- DependencyProperty.Register("IsListEnable", typeof(bool), typeof(SlotsList), new UIPropertyMetadata(true, new PropertyChangedCallback(RenderUpdateByPropertyChanged)));
- public int CurrentItemIndex
- {
- get { return (int)GetValue(CurrentItemIndexProperty); }
- set { SetValue(CurrentItemIndexProperty, value); }
- }
- public static readonly DependencyProperty CurrentItemIndexProperty =
- DependencyProperty.Register("CurrentItemIndex", typeof(int), typeof(SlotsList), new PropertyMetadata(-1, new PropertyChangedCallback(RenderUpdateByPropertyChanged)));
- public SlotsList()
- {
- InitializeComponent();
- }
- public void UpdateSlotsList()
- {
- list.ItemsSource = Items;
- //list.IsEnabled = IsListEnable;
- }
- public event PropertyChangedEventHandler PropertyChanged;
- public static void RenderUpdateByPropertyChanged(DependencyObject dependency, DependencyPropertyChangedEventArgs e)
- {
- if (dependency is SlotsList hslThermometer)
- {
- hslThermometer.UpdateSlotsList();
- }
- }
- private void Button_Click_1(object sender, RoutedEventArgs e)
- {
- Button btn = sender as Button;
- CurrentItemIndex = (int)btn.Tag;
- }
- }
-
- }
|