-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stéphane Mitermite
committed
Apr 18, 2021
1 parent
27f25b4
commit a1b220e
Showing
7 changed files
with
68 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
using CommonServiceLocator; | ||
using GalaSoft.MvvmLight.Ioc; | ||
using Microsoft.Toolkit.Mvvm.DependencyInjection; | ||
|
||
namespace GoogleCast.SampleApp | ||
{ | ||
class ViewModelLocator | ||
{ | ||
static ViewModelLocator() | ||
{ | ||
var simpleIoc = SimpleIoc.Default; | ||
simpleIoc.Reset(); | ||
ServiceLocator.SetLocatorProvider(() => simpleIoc); | ||
simpleIoc.Register<IDeviceLocator, DeviceLocator>(); | ||
simpleIoc.Register<ISender>(() => new Sender()); | ||
simpleIoc.Register<MainViewModel>(); | ||
} | ||
|
||
public MainViewModel Main | ||
{ | ||
get { return ServiceLocator.Current.GetInstance<MainViewModel>(); } | ||
} | ||
/// <summary> | ||
/// Gets the main view model | ||
/// </summary> | ||
public static MainViewModel Main => Ioc.Default.GetRequiredService<MainViewModel>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters