Skip to content

Commit 0819fad

Browse files
committed
Rename BindableElementsWrapper to BindableElementsFactory.
1 parent 5b06aaa commit 0819fad

22 files changed

+47
-47
lines changed

samples/Unity.Mvvm.Counter/Assets/Scripts/AppContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void Construct()
2222
RegisterInstance<IThemeService>(_themeService);
2323
RegisterInstance(new CounterViewModel());
2424
RegisterInstance<IDataStoreService>(new DataStoreService(this));
25-
RegisterInstance<IBindableElementsWrapper>(new CounterBindableElementsWrapper());
25+
RegisterInstance<IBindableElementsFactory>(new CounterBindableElementsFactory());
2626
RegisterInstance(GetValueConverters());
2727
}
2828

samples/Unity.Mvvm.Counter/Assets/Scripts/CounterBindableElementsWrapper.cs renamed to samples/Unity.Mvvm.Counter/Assets/Scripts/CounterBindableElementsFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
using UnityMvvmToolkit.Core.Interfaces;
44
using UnityMvvmToolkit.UITK;
55

6-
public class CounterBindableElementsWrapper : BindableElementsWrapper
6+
public class CounterBindableElementsFactory : BindableElementsFactory
77
{
8-
public override IBindableElement Wrap(IBindableUIElement bindableUiElement, IObjectProvider objectProvider)
8+
public override IBindableElement Create(IBindableUIElement bindableUiElement, IObjectProvider objectProvider)
99
{
1010
return bindableUiElement switch
1111
{
@@ -14,7 +14,7 @@ public override IBindableElement Wrap(IBindableUIElement bindableUiElement, IObj
1414
BindableThemeSwitcher themeSwitcher => new BindableThemeSwitcherWrapper(themeSwitcher, objectProvider),
1515
BindableAnimationLabel animationLabel => new BindableAnimationLabelWrapper(animationLabel, objectProvider),
1616

17-
_ => base.Wrap(bindableUiElement, objectProvider)
17+
_ => base.Create(bindableUiElement, objectProvider)
1818
};
1919
}
2020
}

samples/Unity.Mvvm.Counter/Assets/Scripts/Views/BaseView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ protected override IValueConverter[] GetValueConverters()
2929
return _appContext.Resolve<IValueConverter[]>();
3030
}
3131

32-
protected override IBindableElementsWrapper GetBindableElementsWrapper()
32+
protected override IBindableElementsFactory GetBindableElementsFactory()
3333
{
34-
return _appContext.Resolve<IBindableElementsWrapper>();
34+
return _appContext.Resolve<IBindableElementsFactory>();
3535
}
3636
}
3737
}

samples/Unity.Mvvm.ToDoList/Assets/Scripts/AppContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void Construct()
3131
RegisterInstance(new AddTaskDialogViewModel(this));
3232

3333
RegisterInstance<IDataStoreService>(new DataStoreService(this));
34-
RegisterInstance<IBindableElementsWrapper>(new ToDoListBindableElementsWrapper(_taskItemAsset));
34+
RegisterInstance<IBindableElementsFactory>(new ToDoListBindableElementsFactory(_taskItemAsset));
3535
RegisterInstance(GetValueConverters());
3636
}
3737

samples/Unity.Mvvm.ToDoList/Assets/Scripts/ToDoListBindableElementsWrapper.cs renamed to samples/Unity.Mvvm.ToDoList/Assets/Scripts/ToDoListBindableElementsFactory.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
using UnityMvvmToolkit.UITK;
66
using UnityMvvmToolkit.UITK.BindableUIElements;
77

8-
public class ToDoListBindableElementsWrapper : BindableElementsWrapper
8+
public class ToDoListBindableElementsFactory : BindableElementsFactory
99
{
1010
private readonly VisualTreeAsset _taskItemAsset;
1111

12-
public ToDoListBindableElementsWrapper(VisualTreeAsset taskItemAsset)
12+
public ToDoListBindableElementsFactory(VisualTreeAsset taskItemAsset)
1313
{
1414
_taskItemAsset = taskItemAsset;
1515
}
1616

17-
public override IBindableElement Wrap(IBindableUIElement bindableUiElement, IObjectProvider objectProvider)
17+
public override IBindableElement Create(IBindableUIElement bindableUiElement, IObjectProvider objectProvider)
1818
{
1919
return bindableUiElement switch
2020
{
2121
BindableScrollView scrollView => new BindableTaskScrollViewWrapper(scrollView, _taskItemAsset, objectProvider),
2222
BindablePageBlocker pageBlocker => new BindableBinaryStateButtonWrapper(pageBlocker, objectProvider),
2323
BindableAddTaskButton addTaskButton => new BindableBinaryStateButtonWrapper(addTaskButton, objectProvider),
2424

25-
_ => base.Wrap(bindableUiElement, objectProvider)
25+
_ => base.Create(bindableUiElement, objectProvider)
2626
};
2727
}
2828
}

samples/Unity.Mvvm.ToDoList/Assets/Scripts/Views/BaseView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ protected override IValueConverter[] GetValueConverters()
2323
return _appContext.Resolve<IValueConverter[]>();
2424
}
2525

26-
protected override IBindableElementsWrapper GetBindableElementsWrapper()
26+
protected override IBindableElementsFactory GetBindableElementsFactory()
2727
{
28-
return _appContext.Resolve<IBindableElementsWrapper>();
28+
return _appContext.Resolve<IBindableElementsFactory>();
2929
}
3030
}
3131
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace UnityMvvmToolkit.Core.Interfaces
2+
{
3+
public interface IBindableElementsFactory
4+
{
5+
IBindableElement Create(IBindableUIElement bindableUiElement, IObjectProvider objectProvider);
6+
}
7+
}

src/UnityMvvmToolkit.Core/Interfaces/IBindableElementsWrapper.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)