12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Controls.Primitives;
- namespace Venus_Themes.CustomControls
- {
- public class CommonValveControl : Button
- {
- public CommonValveControl()
- {
-
- }
- static CommonValveControl()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(CommonValveControl), new FrameworkPropertyMetadata(typeof(CommonValveControl)));
- }
-
-
-
-
- public override void OnApplyTemplate()
- {
- var devBtn = GetTemplateChild("mainBody") as Grid;
- devBtn.MouseLeftButtonDown += DevBtn_Click;
- base.OnApplyTemplate();
- }
- private void DevBtn_Click(object sender, RoutedEventArgs e)
- {
-
-
-
-
- }
- public bool Status
- {
- get => (bool)GetValue(StatusProperty);
- set => SetValue(StatusProperty, value);
- }
- public static readonly DependencyProperty StatusProperty = DependencyProperty.Register(
- "Status",
- typeof(bool),
- typeof(CommonValveControl));
- public Orientation ValveOrientation
- {
- get => (Orientation)GetValue(CommonValveOrientationProperty);
- set => SetValue(CommonValveOrientationProperty, value);
- }
- public static readonly DependencyProperty CommonValveOrientationProperty = DependencyProperty.Register(
- "ValveOrientation",
- typeof(Orientation),
- typeof(CommonValveControl));
- public static readonly DependencyProperty IsCanEditProperty = DependencyProperty.Register("IsCanEdit"
- , typeof(bool), typeof(CommonValveControl));
-
-
-
- public bool IsCanEdit
- {
- get { return (bool)GetValue(IsCanEditProperty); }
- set { SetValue(IsCanEditProperty, value); }
- }
- }
- }
|