Use injetion wher epossible for services
parent
a57b87eeb2
commit
a006599675
|
@ -7,7 +7,7 @@ public partial class Player : ContentView
|
||||||
public Player()
|
public Player()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.playerService = ServicesProvider.GetService<PlayerService>();
|
this.playerService = this.Handler.MauiContext.Services.GetService<PlayerService>();
|
||||||
this.IsVisible = false;
|
this.IsVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,15 @@
|
||||||
|
|
||||||
public class WifiOptionsService
|
public class WifiOptionsService
|
||||||
{
|
{
|
||||||
|
#if __MACCATALYST__
|
||||||
|
Platforms.MacCatalyst.ConnectivityService connectivity;
|
||||||
|
public WifiOptionsService(Platforms.MacCatalyst.ConnectivityService connectivity) => this.connectivity = connectivity;
|
||||||
|
#endif
|
||||||
|
|
||||||
public async Task<bool> HasWifiOrCanPlayWithOutWifiAsync()
|
public async Task<bool> HasWifiOrCanPlayWithOutWifiAsync()
|
||||||
{
|
{
|
||||||
|
|
||||||
#if __MACCATALYST__
|
#if __MACCATALYST__
|
||||||
var connectivity = ServicesProvider.GetService<Platforms.MacCatalyst.ConnectivityService>();
|
|
||||||
return await connectivity.IsConnected();
|
return await connectivity.IsConnected();
|
||||||
#else
|
#else
|
||||||
if (Config.Desktop)
|
if (Config.Desktop)
|
||||||
|
|
Loading…
Reference in New Issue