private static object CoerceTransform(DependencyObject d, object value) { if ((Transform)value != (Transform)TransformProperty.GetDefaultValue(typeof(BitmapCacheBrush))) { throw new InvalidOperationException(SR.Get(SRID.BitmapCacheBrush_TransformChanged)); } return(null); }
private void Tween(Transform element, TransformProperty property, Vector3 from, Vector3 to, float duration, float delay, TweenerEaseType easeType, Action onTweenCompleteCallback) { m_Transform = element; m_TweenProperty = property; m_From = from; m_To = to; m_EaseType = easeType; m_OnTweenCompleteCallback += onTweenCompleteCallback; m_Timer -= delay; m_Duration = duration; m_Init = true; }
public ViewEditTransformProperty(TransformProperty prop) { InitializeComponent(); EditProperty = prop; txtM11.Text = EditProperty.Matrix[0].ToString(); txtM12.Text = EditProperty.Matrix[1].ToString(); txtM13.Text = EditProperty.Matrix[2].ToString(); txtM21.Text = EditProperty.Matrix[3].ToString(); txtM22.Text = EditProperty.Matrix[4].ToString(); txtM23.Text = EditProperty.Matrix[5].ToString(); txtM31.Text = EditProperty.Matrix[6].ToString(); txtM32.Text = EditProperty.Matrix[7].ToString(); txtM33.Text = EditProperty.Matrix[8].ToString(); txtM41.Text = EditProperty.Matrix[9].ToString(); txtM42.Text = EditProperty.Matrix[10].ToString(); txtM43.Text = EditProperty.Matrix[11].ToString(); txtFlags.Text = EditProperty.Flags.ToString(); txtUnkown.Text = EditProperty.Unknown.ToString(); }
set => SetValue(TransformProperty, value);
private void Button_Click(object sender, RoutedEventArgs e) { if (this.DataContext is Vector2Property) { Vector2Property prop = this.DataContext as Vector2Property; ViewEditVector2Property editWindow = new ViewEditVector2Property(prop); if (editWindow.ShowDialog().GetValueOrDefault(false)) { prop = editWindow.EditProperty; prop.OnPropertyChanged(new EventArgs()); } } if (this.DataContext is Vector3Property) { Vector3Property prop = this.DataContext as Vector3Property; ViewEditVector3Property editWindow = new ViewEditVector3Property(prop); if (editWindow.ShowDialog().GetValueOrDefault(false)) { prop = editWindow.EditProperty; prop.OnPropertyChanged(new EventArgs()); } } if (this.DataContext is Vector4Property) { Vector4Property prop = this.DataContext as Vector4Property; ViewEditVector4Property editWindow = new ViewEditVector4Property(prop); if (editWindow.ShowDialog().GetValueOrDefault(false)) { prop = editWindow.EditProperty; prop.OnPropertyChanged(new EventArgs()); } } if (this.DataContext is BoundingBoxProperty) { BoundingBoxProperty prop = this.DataContext as BoundingBoxProperty; ViewEditBoundingBoxProperty editWindow = new ViewEditBoundingBoxProperty(prop); if (editWindow.ShowDialog().GetValueOrDefault(false)) { prop = editWindow.EditProperty; prop.OnPropertyChanged(new EventArgs()); } } if (this.DataContext is TextProperty) { TextProperty prop = this.DataContext as TextProperty; ViewEditTextProperty editWindow = new ViewEditTextProperty(prop); if (editWindow.ShowDialog().GetValueOrDefault(false)) { prop = editWindow.EditProperty; prop.OnPropertyChanged(new EventArgs()); } } if (this.DataContext is TransformProperty) { TransformProperty prop = this.DataContext as TransformProperty; ViewEditTransformProperty editWindow = new ViewEditTransformProperty(prop); if (editWindow.ShowDialog().GetValueOrDefault(false)) { prop = editWindow.EditProperty; prop.OnPropertyChanged(new EventArgs()); } } var expression = txtValue.GetBindingExpression(TextBlock.TextProperty); if (expression != null) { expression.UpdateTarget(); } }
set => this.SetValue(TransformProperty, value);
private static void StaticInitialize(Type typeofThis) { OpacityProperty.OverrideMetadata(typeofThis, new IndependentlyAnimatedPropertyMetadata(1.0, /* PropertyChangedHandle */ null, CoerceOpacity)); TransformProperty.OverrideMetadata(typeofThis, new UIPropertyMetadata(null, /* PropertyChangedHandle */ null, CoerceTransform)); RelativeTransformProperty.OverrideMetadata(typeofThis, new UIPropertyMetadata(null, /* PropertyChangedHandle */ null, CoerceRelativeTransform)); }