68 lines
2.2 KiB
C#
68 lines
2.2 KiB
C#
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.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace _20230724_MBJC_upperpc.Views
|
|
{
|
|
/// <summary>
|
|
/// BuoyModel.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class BuoyModel : UserControl
|
|
{
|
|
|
|
//包装器
|
|
public float Rotate_X
|
|
{
|
|
get { return (float)this.GetValue(Rotate_XProperty); }
|
|
set { this.SetValue(Rotate_XProperty, value); }
|
|
}
|
|
|
|
public static readonly DependencyProperty Rotate_XProperty = DependencyProperty.Register("Rotate_X", typeof(float), typeof(BuoyModel), new PropertyMetadata(default(float), new PropertyChangedCallback(OnPropertyChanged)));
|
|
|
|
public float Rotate_Y
|
|
{
|
|
get { return (float)this.GetValue(Rotate_YProperty); }
|
|
set { this.SetValue(Rotate_YProperty, value); }
|
|
}
|
|
|
|
public static readonly DependencyProperty Rotate_YProperty = DependencyProperty.Register("Rotate_Y", typeof(float), typeof(BuoyModel), new PropertyMetadata(default(float), new PropertyChangedCallback(OnPropertyChanged)));
|
|
|
|
public float Rotate_Z
|
|
{
|
|
get { return (float)this.GetValue(Rotate_ZProperty); }
|
|
set { this.SetValue(Rotate_ZProperty, value); }
|
|
}
|
|
|
|
public static readonly DependencyProperty Rotate_ZProperty = DependencyProperty.Register("Rotate_Z", typeof(float), typeof(BuoyModel), new PropertyMetadata(default(float), new PropertyChangedCallback(OnPropertyChanged)));
|
|
|
|
public static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
(d as BuoyModel).Refresh();
|
|
}
|
|
|
|
public BuoyModel()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
|
|
private void Refresh()
|
|
{
|
|
this.rotateX.Angle = Rotate_X;
|
|
this.rotateY.Angle = Rotate_Y;
|
|
this.rotateZ.Angle = Rotate_Z;
|
|
}
|
|
}
|
|
}
|