forked from microsoft/react-native-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReactProgressBarViewManager.cs
52 lines (45 loc) · 1.38 KB
/
ReactProgressBarViewManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using ReactNative.UIManager;
using ReactNative.UIManager.Annotations;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
namespace ReactNative.Views.Progress
{
class ReactProgressBarViewManager : BaseViewManager<ProgressBar, ProgressBarShadowNode>
{
public override string Name
{
get
{
return "WindowsProgressBar";
}
}
[ReactProp("indeterminate")]
public void SetIndeterminate(ProgressBar view, bool value)
{
view.IsIndeterminate = value;
}
[ReactProp("progress")]
public void SetProgress(ProgressBar view, double value)
{
view.Value = value;
}
[ReactProp(ViewProps.Color, CustomType = "Color")]
public void SetColor(ProgressBar view, uint? color)
{
view.Foreground = color.HasValue
? new SolidColorBrush(ColorHelpers.Parse(color.Value))
: null;
}
public override ProgressBarShadowNode CreateShadowNodeInstance()
{
return new ProgressBarShadowNode();
}
public override void UpdateExtraData(ProgressBar root, object extraData)
{
}
protected override ProgressBar CreateViewInstance(ThemedReactContext reactContext)
{
return new ProgressBar();
}
}
}