public override void OnApplyTemplate() { base.OnApplyTemplate(); DatePickerTextBox box = base.GetTemplateChild("PART_TextBox") as DatePickerTextBox; box.ApplyTemplate(); ContentControl watermark = box.Template.FindName("PART_Watermark", box) as ContentControl; watermark.Content = WatermarkText; }
public override void OnApplyTemplate() { base.OnApplyTemplate(); DatePickerTextBox box = GetTemplateChild("PART_TextBox") as DatePickerTextBox; box.ApplyTemplate(); ContentControl watermark = box.Template.FindName("PART_Watermark", box) as ContentControl; watermark.Content = DateTime.Now.ToString("yyyy/MM/dd"); }
/// <summary> /// /// </summary>d public override void OnApplyTemplate() { base.OnApplyTemplate(); SetDateFormat(); DatePickerTextBox box = base.GetTemplateChild("PART_TextBox") as DatePickerTextBox; box.ApplyTemplate(); ContentControl watermark = box.Template.FindName("PART_Watermark", box) as ContentControl; string datePattern = CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern; watermark.Content = datePattern.ToUpper(); }