DialogContent.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace PDF_Office.CustomControl
  16. {
  17. /// <summary>
  18. /// 不能使用usercontrol来实现该模块 会导致content里的控件无法命名
  19. /// 需要创建自定义控件 customcontrol类型
  20. /// </summary>
  21. public class DialogContent : Control
  22. {
  23. static DialogContent()
  24. {
  25. DefaultStyleKeyProperty.OverrideMetadata(typeof(DialogContent), new FrameworkPropertyMetadata(typeof(DialogContent)));
  26. }
  27. /// <summary>
  28. /// 弹窗标题
  29. /// </summary>
  30. public string Header
  31. {
  32. get { return (string)GetValue(HeaderProperty); }
  33. set { SetValue(HeaderProperty, value); }
  34. }
  35. // Using a DependencyProperty as the backing store for Header. This enables animation, styling, binding, etc...
  36. public static readonly DependencyProperty HeaderProperty =
  37. DependencyProperty.Register("Header", typeof(string), typeof(DialogContent), new PropertyMetadata(""));
  38. public object BottmBar
  39. {
  40. get { return (object)GetValue(BottmBarProperty); }
  41. set { SetValue(BottmBarProperty, value); }
  42. }
  43. // Using a DependencyProperty as the backing store for BottmBar. This enables animation, styling, binding, etc...
  44. public static readonly DependencyProperty BottmBarProperty =
  45. DependencyProperty.Register("BottmBar", typeof(object), typeof(DialogContent), new PropertyMetadata(null));
  46. public object Content
  47. {
  48. get { return (object)GetValue(ContentProperty); }
  49. set { SetValue(ContentProperty, value); }
  50. }
  51. // Using a DependencyProperty as the backing store for Content. This enables animation, styling, binding, etc...
  52. public static readonly DependencyProperty ContentProperty =
  53. DependencyProperty.Register("Content", typeof(object), typeof(DialogContent), new PropertyMetadata(null));
  54. }
  55. }