DialogContent.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. ///
  21. /// Content里暂时不能包含region 会注册不上,需要留意
  22. /// </summary>
  23. public class DialogContent : Control
  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. public object Content
  49. {
  50. get { return (object)GetValue(ContentProperty); }
  51. set { SetValue(ContentProperty, value); }
  52. }
  53. // Using a DependencyProperty as the backing store for Content. This enables animation, styling, binding, etc...
  54. public static readonly DependencyProperty ContentProperty =
  55. DependencyProperty.Register("Content", typeof(object), typeof(DialogContent), new PropertyMetadata(null));
  56. }
  57. }