Esempio n. 1
0
        /// <summary>
        ///     Show the watermark on the specified control
        /// </summary>
        /// <param name="control">Control to show the watermark on</param>
        private static void ShowWatermark(Control control)
        {
            // Remove the old watermark.
            control.TryRemoveAdorners <WatermarkAdorner>();

            // Add the new watermark.
            FrameworkElement content = GetContent(control);

            control.TryAddAdorner <WatermarkAdorner>(new WatermarkAdorner(control, content));
        }