Skip to content

Commit 49fa06e

Browse files
erikschlegelrozele
authored andcommitted
Motivation: Exposed the background color property of the TextInput na… (microsoft#419)
* Motivation: Exposed the background color property of the TextInput native UWP component. Test Plan: validated the newly added feature through the VS emulator in the playground. * Setting white as the default color for the Background color of the TextInput control
1 parent c4f9f78 commit 49fa06e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ReactWindows/ReactNative/Views/TextInput/ReactTextInputManager.cs

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88
using Windows.System;
9+
using Windows.UI;
910
using Windows.UI.Text;
1011
using Windows.UI.Xaml;
1112
using Windows.UI.Xaml.Controls;
@@ -211,6 +212,19 @@ public void SetPlaceholder(ReactTextBox view, string placeholder)
211212
view.PlaceholderText = placeholder;
212213
}
213214

215+
/// <summary>
216+
/// Sets the background color for the <see cref="ReactTextBox"/>.
217+
/// </summary>
218+
/// <param name="view">The view instance.</param>
219+
/// <param name="color">The masked color value.</param>
220+
[ReactProp(ViewProps.BackgroundColor, CustomType = "Color")]
221+
public void SetBackgroundColor(ReactTextBox view, uint? color)
222+
{
223+
view.Background = color.HasValue
224+
? new SolidColorBrush(ColorHelpers.Parse(color.Value))
225+
: new SolidColorBrush(Colors.White);
226+
}
227+
214228
/// <summary>
215229
/// Sets the selection color for the <see cref="ReactTextBox"/>.
216230
/// </summary>

0 commit comments

Comments
 (0)