StrokeThicknessProperty

StrokeThicknessProperty

本文介绍了如何在窗口商店应用程序C#中创建分部类后定义依赖项属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望代码在Window Store App中创建分部类后定义依赖属性,C#(XAML)



我尝试过:



公共部分类MyControl:Control {public static readonly DependencyProperty StrokeThicknessProperty = DependencyProperty.Register(typeof(MyControl),new PropertyMetadata(2.0)); public double StrokeThickness {get {return(double)GetValue(StrokeThicknessProperty); } set {SetValue(StrokeThicknessProperty,value); }

I Want the codes to define a Dependency Property after creating a partial class in Window Store App, C#(XAML)

What I have tried:

public partial class MyControl : Control { public static readonly DependencyProperty StrokeThicknessProperty = DependencyProperty.Register( typeof(MyControl), new PropertyMetadata(2.0)); public double StrokeThickness { get { return (double)GetValue(StrokeThicknessProperty); } set { SetValue(StrokeThicknessProperty, value); } } }

推荐答案


这篇关于如何在窗口商店应用程序C#中创建分部类后定义依赖项属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 10:30