<UserControl x:Class="myControl.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid> <TextBlock Name="_innerCaption" > Hello</TextBlock> </Grid> </UserControl>
namespace myControl { /// <summary> /// Interaction logic for UserControl1.xaml /// </summary> public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); } public TextBlock InnerCaption { get { return (TextBlock)this.GetValue(InnerCaptionProperty); } set { this.SetValue(InnerCaptionProperty, value); } } public static readonly DependencyProperty InnerCaptionProperty = DependencyProperty.Register( "InnerCaption", typeof(TextBlock), typeof(UserControl1),new PropertyMetadata(false)); } }
TextBlock
UIElement
Text
FontSize
Foregroung
InnerTextText
InnerTextFontSize
InnerTextForegroung
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)