Skip to content

Commit 9088f55

Browse files
authored
Merge pull request #1160 from kentcb/issue1159
Use non-generic BindableProperty.Create.
2 parents b05941b + ee0da71 commit 9088f55

14 files changed

Lines changed: 93 additions & 39 deletions

src/ReactiveUI.XamForms/XamForms/ReactiveCarouselPage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ public TViewModel ViewModel {
1414
get { return (TViewModel)GetValue(ViewModelProperty); }
1515
set { SetValue(ViewModelProperty, value); }
1616
}
17-
public static readonly BindableProperty ViewModelProperty =
18-
BindableProperty.Create<ReactiveContentPage<TViewModel>, TViewModel>(x => x.ViewModel, default(TViewModel), BindingMode.OneWay);
17+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
18+
nameof(ViewModel),
19+
typeof(TViewModel),
20+
typeof(ReactiveCarouselPage<TViewModel>),
21+
default(TViewModel),
22+
BindingMode.OneWay);
1923

2024
object IViewFor.ViewModel {
2125
get { return ViewModel; }

src/ReactiveUI.XamForms/XamForms/ReactiveContentPage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ public TViewModel ViewModel {
1414
get { return (TViewModel)GetValue(ViewModelProperty); }
1515
set { SetValue(ViewModelProperty, value); }
1616
}
17-
public static readonly BindableProperty ViewModelProperty =
18-
BindableProperty.Create<ReactiveContentPage<TViewModel>, TViewModel>(x => x.ViewModel, default(TViewModel), BindingMode.OneWay);
17+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
18+
nameof(ViewModel),
19+
typeof(TViewModel),
20+
typeof(ReactiveContentPage<TViewModel>),
21+
default(TViewModel),
22+
BindingMode.OneWay);
1923

2024
object IViewFor.ViewModel {
2125
get { return ViewModel; }

src/ReactiveUI.XamForms/XamForms/ReactiveContentView.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ public TViewModel ViewModel {
1414
get { return (TViewModel)GetValue(ViewModelProperty); }
1515
set { SetValue(ViewModelProperty, value); }
1616
}
17-
public static readonly BindableProperty ViewModelProperty =
18-
BindableProperty.Create<ReactiveContentView<TViewModel>, TViewModel>(x => x.ViewModel, default(TViewModel), BindingMode.OneWay);
17+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
18+
nameof(ViewModel),
19+
typeof(TViewModel),
20+
typeof(ReactiveContentView<TViewModel>),
21+
default(TViewModel),
22+
BindingMode.OneWay);
1923

2024
object IViewFor.ViewModel {
2125
get { return ViewModel; }

src/ReactiveUI.XamForms/XamForms/ReactiveEntryCell.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ namespace ReactiveUI.XamForms
66
public class ReactiveEntryCell<TViewModel> : EntryCell, IViewFor<TViewModel>
77
where TViewModel : class
88
{
9-
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create<ReactiveEntryCell<TViewModel>, TViewModel>(
10-
x => x.ViewModel,
11-
null,
9+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
10+
nameof(ViewModel),
11+
typeof(TViewModel),
12+
typeof(ReactiveEntryCell<TViewModel>),
13+
default(TViewModel),
1214
BindingMode.OneWay);
1315

1416
public TViewModel ViewModel

src/ReactiveUI.XamForms/XamForms/ReactiveImageCell.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ namespace ReactiveUI.XamForms
66
public class ReactiveImageCell<TViewModel> : ImageCell, IViewFor<TViewModel>
77
where TViewModel : class
88
{
9-
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create<ReactiveImageCell<TViewModel>, TViewModel>(
10-
x => x.ViewModel,
11-
null,
9+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
10+
nameof(ViewModel),
11+
typeof(TViewModel),
12+
typeof(ReactiveImageCell<TViewModel>),
13+
default(TViewModel),
1214
BindingMode.OneWay);
1315

1416
public TViewModel ViewModel

src/ReactiveUI.XamForms/XamForms/ReactiveMasterDetailPage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ public TViewModel ViewModel {
1414
get { return (TViewModel)GetValue(ViewModelProperty); }
1515
set { SetValue(ViewModelProperty, value); }
1616
}
17-
public static readonly BindableProperty ViewModelProperty =
18-
BindableProperty.Create<ReactiveContentPage<TViewModel>, TViewModel>(x => x.ViewModel, default(TViewModel), BindingMode.OneWay);
17+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
18+
nameof(ViewModel),
19+
typeof(TViewModel),
20+
typeof(ReactiveMasterDetailPage<TViewModel>),
21+
default(TViewModel),
22+
BindingMode.OneWay);
1923

2024
object IViewFor.ViewModel {
2125
get { return ViewModel; }

src/ReactiveUI.XamForms/XamForms/ReactiveMultiPage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ public TViewModel ViewModel {
1515
get { return (TViewModel)GetValue(ViewModelProperty); }
1616
set { SetValue(ViewModelProperty, value); }
1717
}
18-
public static readonly BindableProperty ViewModelProperty =
19-
BindableProperty.Create<ReactiveContentPage<TViewModel>, TViewModel>(x => x.ViewModel, default(TViewModel), BindingMode.OneWay);
18+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
19+
nameof(ViewModel),
20+
typeof(TViewModel),
21+
typeof(ReactiveMultiPage<TPage, TViewModel>),
22+
default(TViewModel),
23+
BindingMode.OneWay);
2024

2125
object IViewFor.ViewModel {
2226
get { return ViewModel; }

src/ReactiveUI.XamForms/XamForms/ReactiveNavigationPage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ public TViewModel ViewModel {
1414
get { return (TViewModel)GetValue(ViewModelProperty); }
1515
set { SetValue(ViewModelProperty, value); }
1616
}
17-
public static readonly BindableProperty ViewModelProperty =
18-
BindableProperty.Create<ReactiveContentPage<TViewModel>, TViewModel>(x => x.ViewModel, default(TViewModel), BindingMode.OneWay);
17+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
18+
nameof(ViewModel),
19+
typeof(TViewModel),
20+
typeof(ReactiveNavigationPage<TViewModel>),
21+
default(TViewModel),
22+
BindingMode.OneWay);
1923

2024
object IViewFor.ViewModel {
2125
get { return ViewModel; }

src/ReactiveUI.XamForms/XamForms/ReactiveSwitchCell.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ namespace ReactiveUI.XamForms
66
public class ReactiveSwitchCell<TViewModel> : SwitchCell, IViewFor<TViewModel>
77
where TViewModel : class
88
{
9-
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create<ReactiveSwitchCell<TViewModel>, TViewModel>(
10-
x => x.ViewModel,
11-
null,
9+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
10+
nameof(ViewModel),
11+
typeof(TViewModel),
12+
typeof(ReactiveSwitchCell<TViewModel>),
13+
default(TViewModel),
1214
BindingMode.OneWay);
1315

1416
public TViewModel ViewModel

src/ReactiveUI.XamForms/XamForms/ReactiveTabbedPage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ public TViewModel ViewModel {
1414
get { return (TViewModel)GetValue(ViewModelProperty); }
1515
set { SetValue(ViewModelProperty, value); }
1616
}
17-
public static readonly BindableProperty ViewModelProperty =
18-
BindableProperty.Create<ReactiveContentPage<TViewModel>, TViewModel>(x => x.ViewModel, default(TViewModel), BindingMode.OneWay);
17+
public static readonly BindableProperty ViewModelProperty = BindableProperty.Create(
18+
nameof(ViewModel),
19+
typeof(TViewModel),
20+
typeof(ReactiveTabbedPage<TViewModel>),
21+
default(TViewModel),
22+
BindingMode.OneWay);
1923

2024
object IViewFor.ViewModel {
2125
get { return ViewModel; }

0 commit comments

Comments
 (0)