IconPannel.xaml.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. InitializeComponent();
  26. }
  27. public static readonly DependencyProperty IconfontListProperty = DependencyProperty.Register("IconfontList", typeof(List<IconfontInfo>), typeof(IconPannel));
  28. public List<IconfontInfo> IconfontList
  29. {
  30. get
  31. {
  32. return (List<IconfontInfo>)GetValue(IconfontListProperty);
  33. }
  34. set
  35. {
  36. SetValue(IconfontListProperty, true);
  37. }
  38. }
  39. public static readonly DependencyProperty IconInfoProperty = DependencyProperty.Register("IconInfo", typeof(IconfontInfo), typeof(IconPannel));
  40. public IconfontInfo IconInfo
  41. {
  42. get
  43. {
  44. return (IconfontInfo)GetValue(IconInfoProperty);
  45. }
  46. set
  47. {
  48. SetValue(IconInfoProperty, true);
  49. }
  50. }
  51. private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  52. {
  53. IconfontInfo info = IconfontList[IconListBox.SelectedIndex];
  54. IconInfo = info;
  55. }
  56. }
  57. }