July 2017
Beginner
466 pages
9h 37m
English
Now let us customize our control to have two properties exposed which, when filled, will show in the UI. To do this, open the MyCustomControl.cs file and create two dependency properties named FirstName and LastName. As every custom control derives from a Control having base class as DependencyObject, you can create dependency properties in it.
Here's the implementation of our class:
namespace Demo.UWP.CustomControls.Library
{
public sealed class MyCustomControl : Control
{
public static readonly DependencyProperty FirstNameProperty = DependencyProperty.Register("FirstName", typeof(string), typeof(MyCustomControl), new PropertyMetadata(string.Empty)); public static readonly DependencyProperty LastNameProperty ...Read now
Unlock full access