|
|
|
xmlns:tools="clr-namespace:Syncfusion.Windows.Tools.Controls.Resources;assembly=Syncfusion.Tools.Wpf"
|
I managed to get the desired result. Thanks a lot for the help.
Roberto
|
public static readonly DependencyProperty UserNameTextProperty =
DependencyProperty.Register("UserNameText", typeof(string), typeof(TitleBar), new FrameworkPropertyMetadata("TEST1”,new PropertyChangedCallback(OnSetTextChanged))); public string UserNameText
{
get { return (string)GetValue(UserNameText); }
set { SetValue(UserNameText, value); }
}
private static void OnSetTextChanged(DependencyObject d,
DependencyPropertyChangedEventArgs e)
{
// add your code
}
private void OnSetTextChanged(DependencyPropertyChangedEventArgs e)
{
textbox.Text = e.NewValue.ToString();
}
|
|
private void RibbonWindow_Loaded(object sender, RoutedEventArgs e)
{
TitleBar bar = this.Template.FindName("PART_TitleBar", this) as TitleBar;
if (bar != null)
{
// Accessing the textblock maintained in titlebar.
TextBlock text = Syncfusion.Windows.Shared.VisualUtils.FindDescendant(bar, typeof(TextBlock)) as TextBlock;
// set text for the textblock
text.Text = "Ribbon";
}
}
|
TitleBar bar = this.Template.FindName("PART_TitleBar", this) as TitleBar;
if (bar != null)
{
TextBlock text = bar.Template.FindName("PART_UserName", bar) as TextBlock;
text.Text = "Ribbon";
}
Thanks for your availability.
Roberto