Hello Guys,
I have been trying to change the gray background <Border ReadOnlyVisualElement to white, but I would like to do by code behind,the problem is when I try to get the element <Border ReadOnlyVisualElement using Border border = this.txtDatePickerIdle.ParentOfType<Border>(); didn't work because get the parent above, I tried Child as well and didn't work, I tried to using Immediate Window and navegate in the control but when I try to find the border is always 'NULL'.
I am running the code in the LayoutUpdated event.
The xaml is below, and I attached a file with the print of structure:
<
RadWatermarkTextBox
x:Name
=
"txtDatePickerIdle"
xmlns
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
AllowDrop
=
"True"
Background
=
"#00FFFFFF"
BorderBrush
=
"#00FFFFFF"
BorderThickness
=
"1, 1, 1, 1"
Foreground
=
"#FF000000"
HorizontalContentAlignment
=
"Left"
HorizontalScrollBarVisibility
=
"Hidden"
IsHitTestVisible
=
"False"
IsReadOnly
=
"True"
IsTabStop
=
"False"
Margin
=
"0, 0, 15, 0"
MinHeight
=
"15"
SelectedText
=
""
SelectionBackground
=
"#FF444444"
SelectionForeground
=
"#FFFFFFFF"
SelectionLength
=
"0"
SelectionStart
=
"0"
TabNavigation
=
"Once"
Text
=
"dd/MM/yyyy"
UseLayoutRounding
=
"False"
VerticalScrollBarVisibility
=
"Hidden"
>
<
Grid
x:Name
=
"RootElement"
AllowDrop
=
"True"
Cursor
=
"IBeam"
UseLayoutRounding
=
"False"
>
<
Border
x:Name
=
"Border"
AllowDrop
=
"True"
Background
=
"#00FFFFFF"
BorderBrush
=
"#00FFFFFF"
BorderThickness
=
"1, 1, 1, 1"
CornerRadius
=
"1, 1, 1, 1"
UseLayoutRounding
=
"False"
/>
<
Border
x:Name
=
"ReadOnlyVisualElement"
AllowDrop
=
"True"
Background
=
"#5EC9C9C9"
CornerRadius
=
"1, 1, 1, 1"
UseLayoutRounding
=
"False"
/>
<
Border
x:Name
=
"MouseOverVisual"
Grid.ColumnSpan
=
"2"
Grid.RowSpan
=
"2"
AllowDrop
=
"True"
BorderBrush
=
"#FFFFC92B"
BorderThickness
=
"1, 1, 1, 1"
CornerRadius
=
"1, 1, 1, 1"
IsHitTestVisible
=
"False"
Opacity
=
"0"
UseLayoutRounding
=
"False"
Visibility
=
"Collapsed"
/>
<
Border
x:Name
=
"DisabledVisualElement"
AllowDrop
=
"True"
Background
=
"#FFE0E0E0"
BorderBrush
=
"#FF989898"
BorderThickness
=
"1, 1, 1, 1"
CornerRadius
=
"1, 1, 1, 1"
IsHitTestVisible
=
"False"
Opacity
=
"0"
UseLayoutRounding
=
"False"
/>
<
ScrollViewer
x:Name
=
"ContentElement"
AllowDrop
=
"True"
Background
=
"#00FFFFFF"
BorderBrush
=
"#FF848484"
Cursor
=
"Arrow"
Foreground
=
"#FF000000"
HorizontalContentAlignment
=
"Stretch"
HorizontalScrollBarVisibility
=
"Hidden"
IsTabStop
=
"False"
Margin
=
"1, 1, 1, 1"
UseLayoutRounding
=
"False"
VerticalAlignment
=
"Center"
VerticalContentAlignment
=
"Stretch"
VerticalScrollBarVisibility
=
"Hidden"
>
<
Border
AllowDrop
=
"True"
Background
=
"#00FFFFFF"
BorderBrush
=
"#FF848484"
UseLayoutRounding
=
"False"
>
<
Grid
AllowDrop
=
"True"
Background
=
"#00FFFFFF"
UseLayoutRounding
=
"False"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
ScrollContentPresenter
x:Name
=
"ScrollContentPresenter"
AllowDrop
=
"True"
CanHorizontallyScroll
=
"True"
CanVerticallyScroll
=
"True"
Cursor
=
"Arrow"
UseLayoutRounding
=
"False"
>
<
ScrollContentPresenter.Clip
>
<
RectangleGeometry
Rect
=
"-1, 0, 103, 16"
/>
</
ScrollContentPresenter.Clip
>
<
TextBoxView
/>
</
ScrollContentPresenter
>
<
Border
Grid.Column
=
"1"
Grid.Row
=
"1"
AllowDrop
=
"True"
Margin
=
"0, 0, -1, -1"
UseLayoutRounding
=
"False"
Visibility
=
"Collapsed"
>
<
Border
AllowDrop
=
"True"
BorderBrush
=
"#FF848484"
BorderThickness
=
"0, 0, 1, 1"
UseLayoutRounding
=
"False"
Visibility
=
"Collapsed"
>
<
Border.Background
>
<
RadialGradientBrush
Center
=
"0, 0"
GradientOrigin
=
"0, 0"
RadiusX
=
"1"
RadiusY
=
"1"
>
<
GradientStopCollection
>
<
GradientStop
Offset
=
"0.066"
>#FF848484</
GradientStop
>
<
GradientStop
Offset
=
"0.066"
>#FFBFBFBF</
GradientStop
>
<
GradientStop
Offset
=
"0.29"
>#FFF0F0F0</
GradientStop
>
</
GradientStopCollection
>
</
RadialGradientBrush
>
</
Border.Background
>
</
Border
>
</
Border
>
<
ScrollBar
x:Name
=
"VerticalScrollBar"
Grid.Column
=
"1"
AllowDrop
=
"True"
BorderBrush
=
"#FF848484"
BorderThickness
=
"1, 0, 1, 0"
Foreground
=
"#FF000000"
IsTabStop
=
"False"
Margin
=
"0, 0, -1, 0"
Maximum
=
"0"
MinHeight
=
"15"
MinWidth
=
"15"
UseLayoutRounding
=
"False"
ViewportSize
=
"16"
Visibility
=
"Collapsed"
>
<
ScrollBar.Background
>
<
LinearGradientBrush
EndPoint
=
"1, 0.5"
StartPoint
=
"0, 0.5"
>
<
GradientStopCollection
>
<
GradientStop
Offset
=
"0.257"
>#FFF0F0F0</
GradientStop
>
<
GradientStop
>#FFBFBFBF</
GradientStop
>
</
GradientStopCollection
>
</
LinearGradientBrush
>
</
ScrollBar.Background
>
</
ScrollBar
>
<
ScrollBar
x:Name
=
"HorizontalScrollBar"
Grid.Row
=
"1"
AllowDrop
=
"True"
BorderBrush
=
"#FF848484"
BorderThickness
=
"0, 1, 0, 1"
Foreground
=
"#FF000000"
IsTabStop
=
"False"
Margin
=
"0, 0, 0, -1"
Maximum
=
"0"
MinHeight
=
"15"
MinWidth
=
"15"
Orientation
=
"Horizontal"
UseLayoutRounding
=
"False"
ViewportSize
=
"101"
Visibility
=
"Collapsed"
>
<
ScrollBar.Background
>
<
LinearGradientBrush
EndPoint
=
"1, 0.5"
StartPoint
=
"0, 0.5"
>
<
GradientStopCollection
>
<
GradientStop
Offset
=
"0.257"
>#FFF0F0F0</
GradientStop
>
<
GradientStop
>#FFBFBFBF</
GradientStop
>
</
GradientStopCollection
>
</
LinearGradientBrush
>
</
ScrollBar.Background
>
</
ScrollBar
>
</
Grid
>
</
Border
>
</
ScrollViewer
>
<
Border
x:Name
=
"FocusVisual"
Grid.ColumnSpan
=
"2"
Grid.RowSpan
=
"2"
AllowDrop
=
"True"
BorderBrush
=
"#FFFFC92B"
BorderThickness
=
"1, 1, 1, 1"
CornerRadius
=
"1, 1, 1, 1"
IsHitTestVisible
=
"False"
Opacity
=
"0"
UseLayoutRounding
=
"False"
>
<
Border
AllowDrop
=
"True"
BorderBrush
=
"#00FFFFFF"
BorderThickness
=
"1, 1, 1, 1"
UseLayoutRounding
=
"False"
/>
</
Border
>
<
ContentControl
x:Name
=
"WatermarkVisualElement"
AllowDrop
=
"True"
BorderThickness
=
"1, 1, 1, 1"
FontStyle
=
"Italic"
Foreground
=
"#FF000000"
HorizontalAlignment
=
"Left"
HorizontalContentAlignment
=
"Left"
IsHitTestVisible
=
"False"
IsTabStop
=
"False"
Margin
=
"2, 0, 0, 0"
Opacity
=
"0.5"
UseLayoutRounding
=
"False"
VerticalAlignment
=
"Center"
VerticalContentAlignment
=
"Top"
>
<
Border
AllowDrop
=
"True"
BorderThickness
=
"1, 1, 1, 1"
UseLayoutRounding
=
"False"
>
<
ContentPresenter
AllowDrop
=
"True"
UseLayoutRounding
=
"False"
/>
</
Border
>
</
ContentControl
>
<
ValidationTooltip
x:Name
=
"ValidationTooltip"
Grid.ColumnSpan
=
"2"
AllowDrop
=
"True"
BorderBrush
=
"#FFCB576E"
BorderThickness
=
"1, 1, 1, 1"
CornerRadius
=
"1, 1, 1, 1"
Foreground
=
"#FF000000"
IsTabStop
=
"False"
UseLayoutRounding
=
"False"
Visibility
=
"Collapsed"
>
<
ValidationTooltip.TooltipContent
/>
</
ValidationTooltip
>
</
Grid
>
</
RadWatermarkTextBox
>
Thanks