DialogContent.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_Master.CustomControl
  16. {
  17. /// <summary>
  18. /// 不能使用usercontrol来实现该模块 会导致content里的控件无法命名
  19. /// 需要创建自定义控件 customcontrol类型
  20. ///
  21. /// Content里暂时不能包含region 会注册不上,需要留意
  22. /// </summary>
  23. public class DialogContent : ContentControl
  24. {
  25. static DialogContent()
  26. {
  27. DefaultStyleKeyProperty.OverrideMetadata(typeof(DialogContent), new FrameworkPropertyMetadata(typeof(DialogContent)));
  28. }
  29. /// <summary>
  30. /// 弹窗标题
  31. /// </summary>
  32. public string Header
  33. {
  34. get { return (string)GetValue(HeaderProperty); }
  35. set { SetValue(HeaderProperty, value); }
  36. }
  37. // Using a DependencyProperty as the backing store for Header. This enables animation, styling, binding, etc...
  38. public static readonly DependencyProperty HeaderProperty =
  39. DependencyProperty.Register("Header", typeof(string), typeof(DialogContent), new PropertyMetadata(""));
  40. public object BottmBar
  41. {
  42. get { return (object)GetValue(BottmBarProperty); }
  43. set { SetValue(BottmBarProperty, value); }
  44. }
  45. // Using a DependencyProperty as the backing store for BottmBar. This enables animation, styling, binding, etc...
  46. public static readonly DependencyProperty BottmBarProperty =
  47. DependencyProperty.Register("BottmBar", typeof(object), typeof(DialogContent), new PropertyMetadata(null));
  48. }
  49. }