IconPannel.xaml.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using GeekDesk.ViewModel;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace GeekDesk.Control.UserControls.IconFont
  17. {
  18. /// <summary>
  19. /// IconPannel.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class IconPannel : UserControl
  22. {
  23. public IconPannel()
  24. {
  25. //DataContext = this;
  26. InitializeComponent();
  27. }
  28. public static readonly DependencyProperty IconfontListProperty = DependencyProperty.Register("IconfontList", typeof(List<IconfontInfo>), typeof(IconPannel));
  29. public List<IconfontInfo> IconfontList
  30. {
  31. get
  32. {
  33. return (List<IconfontInfo>)GetValue(IconfontListProperty);
  34. }
  35. set
  36. {
  37. SetValue(IconfontListProperty, true);
  38. }
  39. }
  40. public static readonly DependencyProperty IconInfoProperty = DependencyProperty.Register("IconInfo", typeof(IconfontInfo), typeof(IconPannel));
  41. public IconfontInfo IconInfo
  42. {
  43. get
  44. {
  45. return (IconfontInfo)GetValue(IconInfoProperty);
  46. }
  47. set
  48. {
  49. SetValue(IconInfoProperty, true);
  50. }
  51. }
  52. private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  53. {
  54. IconfontInfo info = IconfontList[IconListBox.SelectedIndex];
  55. IconInfo = info;
  56. }
  57. }
  58. }