commit be694ed458f0c4acc0340ad3d0af6457dc7a3d39
Author: Martin Toutant <martin.toutant@inrae.fr>
Date:   Wed Aug 24 14:16:21 2022 +0200

    bugix

diff --git a/TestXamConnections/TestXamConnections.Android/Connection/BluetoothConnectionService.cs b/TestXamConnections/TestXamConnections.Android/Connection/BluetoothConnectionService.cs
index 5cc087f..1dc91bf 100644
--- a/TestXamConnections/TestXamConnections.Android/Connection/BluetoothConnectionService.cs
+++ b/TestXamConnections/TestXamConnections.Android/Connection/BluetoothConnectionService.cs
@@ -31,13 +31,12 @@ namespace TestXamConnections.Droid.Connection
         private readonly string sppUUID = "00001101-0000-1000-8000-00805f9b34fb";
 
         public BluetoothConnectionService()
-        { 
+        {
             bluetoothAdapter = BluetoothAdapter.DefaultAdapter;
         }
 
         // Pour le bluetooth, le paramètre de connection est l'addresse MAC
-        public EventHandler<string> ConnectionFailedEvent { get; set; }
-        public async Task Connect(Dictionary<string, string> param)
+        public async Task<bool> Connect(Dictionary<string, string> param)
         {
             try
             {
@@ -45,7 +44,7 @@ namespace TestXamConnections.Droid.Connection
                 // On annule le scan
                 if (bluetoothAdapter.IsDiscovering)
                 {
-                    bluetoothAdapter.CancelDiscovery();
+                    _ = bluetoothAdapter.CancelDiscovery();
                 }
 
                 if (param.ContainsKey(ConnectionConstants.MAC_ADDR_KEY))
@@ -57,7 +56,7 @@ namespace TestXamConnections.Droid.Connection
                         // On ferme la connexion existante
                         if (socket != null)
                         {
-                            await CloseConnection();
+                            _ = await CloseConnection();
                         }
 
                         // Creation du canal RFCOMM (non sécurisé)
@@ -76,12 +75,17 @@ namespace TestXamConnections.Droid.Connection
                         listeningThread = new Thread(async delagate => await ListeningAsync());
                         listeningThread.Start();
                     }
+                } else
+                {
+                    // L'addresse MAC n'a pas été spécifiée
+                    return false;
                 }
             }
             catch (Exception)
             {
-                Application.SynchronizationContext.Post(_ => { ConnectionFailedEvent.Invoke(this, param[ConnectionConstants.MAC_ADDR_KEY]); }, null);
+                return false;
             }
+            return true;
         }
 
         public EventHandler<byte[]> DataReceivedEvent { get; set; }
diff --git a/TestXamConnections/TestXamConnections.Android/Connection/InternConnectionService.cs b/TestXamConnections/TestXamConnections.Android/Connection/InternConnectionService.cs
index ff87dc7..e7e53f5 100644
--- a/TestXamConnections/TestXamConnections.Android/Connection/InternConnectionService.cs
+++ b/TestXamConnections/TestXamConnections.Android/Connection/InternConnectionService.cs
@@ -23,7 +23,6 @@ namespace TestXamConnections.Droid.Connection
     public class InternConnectionService : IConnectionService
     {
         public EventHandler<byte[]> DataReceivedEvent { get; set; }
-        public EventHandler<string> ConnectionFailedEvent { get; set; }
 
         private readonly IntentReceiver intentReceiver;
         private readonly Context appContext;
@@ -31,7 +30,7 @@ namespace TestXamConnections.Droid.Connection
         /* La fonction connect dans le cas du connexion en interne
         *  Est en fait, la configuration de l'IntentReceiver
         */
-        public async Task Connect(Dictionary<string, string> param)
+        public Task<bool> Connect(Dictionary<string, string> param)
         {
             if (param.ContainsKey(ConnectionConstants.RECEIVABLE_INTENTS_KEY))
             {
@@ -42,13 +41,13 @@ namespace TestXamConnections.Droid.Connection
                 IntentFilter intentFilter = new IntentFilter();
                 intents.ForEach(intent => intentFilter.AddAction(intent));
 
-                await Task.Run( () => appContext.RegisterReceiver(intentReceiver, intentFilter) );
+                appContext.RegisterReceiver(intentReceiver, intentFilter);
             }
             else
             {
-                ConnectionFailedEvent.Invoke(this, null);
+                return Task.FromResult(false);
             }
-            return;
+            return Task.FromResult(true);
         }
 
         public Task<bool> SendCommand(string command)
@@ -80,7 +79,15 @@ namespace TestXamConnections.Droid.Connection
                     break;
 
                 case AgridentConstants.ACTION_AGRIDENT_ERROR:
-                    DataReceivedEvent.Invoke(this, Encoding.ASCII.GetBytes("ERROR"));
+                    DataReceivedEvent.Invoke(this, Encoding.ASCII.GetBytes(AgridentConstants.ACTION_AGRIDENT_ERROR));
+                    break;
+
+                case AgridentConstants.ACTION_AGRIDENT_SERVICE_START:
+                    DataReceivedEvent.Invoke(this, Encoding.ASCII.GetBytes(AgridentConstants.ACTION_AGRIDENT_SERVICE_START));
+                    break;
+
+                case AgridentConstants.ACTION_AGRIDENT_SERVICE_STOP:
+                    DataReceivedEvent.Invoke(this, Encoding.ASCII.GetBytes(AgridentConstants.ACTION_AGRIDENT_SERVICE_STOP));
                     break;
 
                 default:
diff --git a/TestXamConnections/TestXamConnections.Android/Connection/WifiConnectionService.cs b/TestXamConnections/TestXamConnections.Android/Connection/WifiConnectionService.cs
index dc7fb5d..2296ffb 100644
--- a/TestXamConnections/TestXamConnections.Android/Connection/WifiConnectionService.cs
+++ b/TestXamConnections/TestXamConnections.Android/Connection/WifiConnectionService.cs
@@ -20,19 +20,18 @@ namespace TestXamConnections.Droid.Connection
     public class WifiConnectionService : IConnectionService
     {
         public EventHandler<byte[]> DataReceivedEvent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-        public EventHandler<string> ConnectionFailedEvent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
 
-        public Task<bool> SendCommand(byte[] hexValues)
+        public Task<bool> Connect(Dictionary<string, string> connectParam)
         {
             throw new NotImplementedException();
         }
 
-        public Task<bool> SendCommand(string command)
+        public Task<bool> SendCommand(byte[] hexValues)
         {
             throw new NotImplementedException();
         }
 
-        public Task Connect(Dictionary<string, string> connectParam)
+        public Task<bool> SendCommand(string command)
         {
             throw new NotImplementedException();
         }
diff --git a/TestXamConnections/TestXamConnections.Android/Receivers/IntentReceiver.cs b/TestXamConnections/TestXamConnections.Android/Receivers/IntentReceiver.cs
index d80e137..d7e4111 100644
--- a/TestXamConnections/TestXamConnections.Android/Receivers/IntentReceiver.cs
+++ b/TestXamConnections/TestXamConnections.Android/Receivers/IntentReceiver.cs
@@ -18,7 +18,7 @@ namespace TestXamConnections.Droid.Receivers
 
         public override void OnReceive(Context context, Intent intent)
         {
-            OnIntentReceived(this, intent);
+            OnIntentReceived.Invoke(this, intent);
         }
     }
 }
\ No newline at end of file
diff --git a/TestXamConnections/TestXamConnections/Connection/IConnectionService.cs b/TestXamConnections/TestXamConnections/Connection/IConnectionService.cs
index 5812c16..61dc5ba 100644
--- a/TestXamConnections/TestXamConnections/Connection/IConnectionService.cs
+++ b/TestXamConnections/TestXamConnections/Connection/IConnectionService.cs
@@ -16,7 +16,7 @@ namespace TestXamConnections.Connection
          * --> Ajout à un IntentFilter
          * Déclenche ConnectionFailedEvent si la connection échoue
          */
-        Task Connect(Dictionary<string, string> connectParam);
+        Task<bool> Connect(Dictionary<string, string> connectParam);
 
         /*
          * Fonction d'envoi de commande
@@ -31,9 +31,5 @@ namespace TestXamConnections.Connection
          * Renvoi les données sur forme d'un tableau d'octets
          */
         EventHandler<byte[]> DataReceivedEvent { get; set; }
-
-        /* Evenement déclenché quand la connexion échoue
-         */
-        EventHandler<string> ConnectionFailedEvent { get; set; }
     }
 }
diff --git a/TestXamConnections/TestXamConnections/Models/AgridentReader.cs b/TestXamConnections/TestXamConnections/Models/AgridentReader.cs
index 0262105..1e383f6 100644
--- a/TestXamConnections/TestXamConnections/Models/AgridentReader.cs
+++ b/TestXamConnections/TestXamConnections/Models/AgridentReader.cs
@@ -23,55 +23,57 @@ namespace TestXamConnections.Models
     {
         private IConnectionService ConnectionService { get; set; }
         public EventHandler<string> AgridentDataReceivedEvent { get; set; }
-        public EventHandler<string> AgridentNORFIDEvent { get; set; }
-        public EventHandler AgridentConnectionFailedEvent { get; set; }
+        public EventHandler AgridentNORFIDEvent { get; set; }
+        public EventHandler<bool> AgridentScanStatusChangedEvent { get; set; }
 
         public AgridentReader()
         {
             ConnectionService = DependencyService.Get<IConnectionServiceProvider>().GetConnectionInstance(ConnectionType.Intern);
-            ConnectionService.DataReceivedEvent += (s, args) => InternDataReceived(args);
-            ConnectionService.ConnectionFailedEvent += AgridentConnectionFailed;
+            ConnectionService.DataReceivedEvent += InternDataReceived;
         }
 
         ~AgridentReader()
         {
-            ConnectionService.DataReceivedEvent -= (s, args) => InternDataReceived(args);
-            ConnectionService.ConnectionFailedEvent += AgridentConnectionFailed;
-        }
-
-        /* Fonction déclenchée à l'échec de la connexion
-         */
-        private void AgridentConnectionFailed(object sender, string e)
-        {
-            AgridentConnectionFailedEvent.Invoke(this, null);
+            ConnectionService.DataReceivedEvent -= InternDataReceived;
         }
 
         /* Fonction déclenchée à la reception de données Agrident
          * Trigger l'évènement AgridentDataReceivedEvent
          */
-        private void InternDataReceived(byte[] intent)
+        private void InternDataReceived(object sender, byte[] intent)
         {
             string data = Encoding.ASCII.GetString(intent);
-            // Si pas de valeur scannée
-            // Evenement error
-            if (data.Equals("ERROR"))
-            {
-                AgridentNORFIDEvent.Invoke(this, null);
-            } 
-            // Sinon c'est une valeur rfid -- NON, TODO
-            else
+
+            switch (data)
             {
-                AgridentDataReceivedEvent.Invoke(this, data);
+                case AgridentConstants.ACTION_AGRIDENT_ERROR:
+                    AgridentNORFIDEvent.Invoke(this, null);
+                    break;
+
+                case AgridentConstants.ACTION_AGRIDENT_SERVICE_START:
+                    AgridentScanStatusChangedEvent.Invoke(this, true);
+                    break;
+
+                case AgridentConstants.ACTION_AGRIDENT_SERVICE_STOP:
+                    AgridentScanStatusChangedEvent.Invoke(this, false);
+                    break;
+
+                default:
+                    AgridentDataReceivedEvent.Invoke(this, data);
+                    break;
             }
         }
 
         public async Task<bool> EnableServiceAsync()
         {
+            bool ret;
             // Enregistrement des intents recevable par Agrident
             List<string> intentsList = new List<string>()
             {
                 AgridentConstants.ACTION_AGRIDENT_SUCCESS,
-                AgridentConstants.ACTION_AGRIDENT_ERROR
+                AgridentConstants.ACTION_AGRIDENT_ERROR,
+                AgridentConstants.ACTION_AGRIDENT_SERVICE_START,
+                AgridentConstants.ACTION_AGRIDENT_SERVICE_STOP
             };
             string intents = string.Join(',', intentsList);
 
@@ -81,8 +83,8 @@ namespace TestXamConnections.Models
                 { ConnectionConstants.RECEIVABLE_INTENTS_KEY, intents }
             };
 
-            await ConnectionService.Connect(param);
-            return true;
+            ret = await ConnectionService.Connect(param);
+            return ret;
         }
 
         public async Task<bool> StartScanAsync()
diff --git a/TestXamConnections/TestXamConnections/Models/TeoBalance.cs b/TestXamConnections/TestXamConnections/Models/TeoBalance.cs
index fb25d7d..5772c2b 100644
--- a/TestXamConnections/TestXamConnections/Models/TeoBalance.cs
+++ b/TestXamConnections/TestXamConnections/Models/TeoBalance.cs
@@ -33,21 +33,18 @@ namespace TestXamConnections.Models
         private IConnectionService ConnectionService { get; set; }
         public EventHandler<string> TeoDataReceivedEvent { get; set; }
         public EventHandler<ReponsePesee> TeoPeseeReceivedEvent { get; set; }
-        public EventHandler TeoConnectionFailedEvent { get; set; }
 
         public TeoBalance(Device device)
         {
             Name = device.Name;
             MACAddress = device.MACAddress;
             ConnectionService = DependencyService.Get<IConnectionServiceProvider>().GetConnectionInstance(ConnectionType.Bluetooth);
-            ConnectionService.DataReceivedEvent += (s, args) => TeoDataReceived(args);
-            ConnectionService.ConnectionFailedEvent += TeoConnectionFailed;
+            ConnectionService.DataReceivedEvent += TeoDataReceived;
         }
 
         ~TeoBalance()
         {
-            ConnectionService.DataReceivedEvent -= (s, args) => TeoDataReceived(args);
-            ConnectionService.ConnectionFailedEvent -= TeoConnectionFailed;
+            ConnectionService.DataReceivedEvent -= TeoDataReceived;
         }
 
         /* 
@@ -59,15 +56,9 @@ namespace TestXamConnections.Models
          * nommé _bufferedData
          */
         private string _bufferedData;
-        
-        // Fonction appelée si la connexion échoue
-        private void TeoConnectionFailed(object sender, string e)
-        {
-            TeoConnectionFailedEvent.Invoke(this, null) ;
-        }
 
         // Fonction appelée lors de la reception de données par le ConnectionService
-        private void TeoDataReceived(byte[] buffer)
+        private void TeoDataReceived(object sender, byte[] buffer)
         {
             // Si le premier character est 2 (ASCII: STX)
             // Alors c'est le début de la trame.
diff --git a/TestXamConnections/TestXamConnections/ViewModels/InternServiceViewModel.cs b/TestXamConnections/TestXamConnections/ViewModels/InternServiceViewModel.cs
index 175f8a7..14e86f7 100644
--- a/TestXamConnections/TestXamConnections/ViewModels/InternServiceViewModel.cs
+++ b/TestXamConnections/TestXamConnections/ViewModels/InternServiceViewModel.cs
@@ -10,6 +10,7 @@ namespace TestXamConnections.ViewModels
 {
     public class InternServiceViewModel : ViewModelBase
     {
+        private bool isScanning;
         private bool showRFID;
         private bool showError;
         private readonly AgridentReader agridentReader;
@@ -28,6 +29,12 @@ namespace TestXamConnections.ViewModels
             set { SetProperty( ref showError, value); }
         }
 
+        public bool IsScanning
+        {
+            get { return isScanning; }
+            set { SetProperty(ref isScanning, value); }
+        }
+
         public string RFIDResult
         {
             get { return rfidResult; }
@@ -42,8 +49,7 @@ namespace TestXamConnections.ViewModels
 
         private async Task StartScan()
         {
-            ShowError = false;
-            ShowRFID = false;
+            IsScanning = true;
             if (await agridentReader.StartScanAsync() == false)
             {
                 ShowError = true;
@@ -62,20 +68,33 @@ namespace TestXamConnections.ViewModels
             agridentReader = new AgridentReader();
             agridentReader.AgridentDataReceivedEvent += OnRFIDResultReceived;
             agridentReader.AgridentNORFIDEvent += OnNoRFIDReceived;
-            agridentReader.EnableServiceAsync().Wait();
+            agridentReader.AgridentScanStatusChangedEvent += OnScanStatusChanged;
+            bool err = agridentReader.EnableServiceAsync().Result;
             StartScanCommand = new Command(async () => await StartScan());
         }
 
-        private void OnNoRFIDReceived(object sender, string e)
+        private void OnScanStatusChanged(object sender, bool e)
+        {
+            IsScanning = e;
+            if (e == false)
+            {
+                ShowError = true;
+                ShowRFID = true;
+            }
+        }
+
+        private void OnNoRFIDReceived(object sender, EventArgs e)
         {
             ShowError = true;
             ErrorMessage = "Pas de TAG RFID detecté";
+            IsScanning = false;
         }
 
         private void OnRFIDResultReceived(object sender, string e)
         {
             ShowRFID = true;
             RFIDResult = e;
+            IsScanning = false;
         }
     }
 }
diff --git a/TestXamConnections/TestXamConnections/ViewModels/TeoDeviceViewModel.cs b/TestXamConnections/TestXamConnections/ViewModels/TeoDeviceViewModel.cs
index 1d8f263..f5c7bb5 100644
--- a/TestXamConnections/TestXamConnections/ViewModels/TeoDeviceViewModel.cs
+++ b/TestXamConnections/TestXamConnections/ViewModels/TeoDeviceViewModel.cs
@@ -83,9 +83,8 @@ namespace TestXamConnections.ViewModels
             IsVisibleData = false;
             ConnectToDeviceCommand = new Command(async () => await ConnectToDevice());
             SendValueCommand = new Command(async (cmd) => await teoScale.SendTeoCommandAsync((TeoCommandType)cmd));
-            TeoScale.TeoDataReceivedEvent = (s, args) => DataReceived(args);
-            TeoScale.TeoPeseeReceivedEvent = (s, args) => PeseeReceived(args);
-            TeoScale.TeoConnectionFailedEvent = ConnectionFailed;
+            TeoScale.TeoDataReceivedEvent = DataReceived;
+            TeoScale.TeoPeseeReceivedEvent = PeseeReceived;
 
             // Ajout manuel des commandes
             AvailableCommandsList = new ObservableCollection<CommandItemViewModel>();
@@ -95,20 +94,13 @@ namespace TestXamConnections.ViewModels
             }
         }
 
-        private void ConnectionFailed(object sender, EventArgs e)
-        {
-            IsConnected = false;
-            ShowError = true;
-            ErrorMessage = "La connexion a échoué";
-        }
-
-        public void DataReceived(string args)
+        public void DataReceived(object sender, string args)
         {
             IsVisibleData = true;
             Data += args.Trim() + "\n";
         }
 
-        public void PeseeReceived(ReponsePesee args)
+        public void PeseeReceived(object sender, ReponsePesee args)
         {
             Data = args.PoidsMesure;
         }
diff --git a/TestXamConnections/TestXamConnections/Views/InternServiceView.xaml b/TestXamConnections/TestXamConnections/Views/InternServiceView.xaml
index 1647bf0..00b9992 100644
--- a/TestXamConnections/TestXamConnections/Views/InternServiceView.xaml
+++ b/TestXamConnections/TestXamConnections/Views/InternServiceView.xaml
@@ -7,90 +7,110 @@
     <ContentPage.Content>
 
         <StackLayout BackgroundColor="#001729" VerticalOptions="FillAndExpand">
-            <StackLayout Spacing="15" VerticalOptions="CenterAndExpand">
+            <Grid VerticalOptions="FillAndExpand">
+                <StackLayout Spacing="15" VerticalOptions="CenterAndExpand">
 
-                <xe:BorderView
-                    Margin="0,20,0,0"
-                    xe:Commands.Tap="{Binding StartScanCommand}"
-                    xe:TouchEffect.Color="#0060a8"
-                    BackgroundColor="#003266"
-                    CornerRadius="65"
-                    HorizontalOptions="Center">
-                    <StackLayout Padding="15,10">
-                        <Label
-                            FontSize="Medium"
-                            HorizontalOptions="Center"
-                            HorizontalTextAlignment="Center"
-                            Text="Scan RFID"
-                            TextColor="#34a9ff" />
-                    </StackLayout>
-                </xe:BorderView>
+                    <xe:BorderView
+                        Margin="0,20,0,0"
+                        xe:Commands.Tap="{Binding StartScanCommand}"
+                        xe:TouchEffect.Color="#0060a8"
+                        BackgroundColor="#003266"
+                        CornerRadius="65"
+                        HorizontalOptions="Center">
+                        <StackLayout Padding="15,10">
+                            <Label
+                                FontSize="Medium"
+                                HorizontalOptions="Center"
+                                HorizontalTextAlignment="Center"
+                                Text="Scan RFID"
+                                TextColor="#34a9ff" />
+                        </StackLayout>
+                    </xe:BorderView>
 
-                <Frame
-                    Padding="0"
-                    BackgroundColor="Transparent"
-                    BorderColor="#4f5a64"
-                    CornerRadius="5"
-                    HasShadow="False"
-                    HorizontalOptions="Center"
-                    IsVisible="{Binding ShowRFID}"
-                    VerticalOptions="CenterAndExpand"
-                    WidthRequest="200">
-                    <StackLayout Spacing="0">
-                        <Label
-                            Margin="15"
-                            FontSize="15"
-                            HorizontalTextAlignment="Center"
-                            Text="RFID Scanné"
-                            TextColor="#34a9ff" />
+                    <Frame
+                        Padding="0"
+                        BackgroundColor="Transparent"
+                        BorderColor="#4f5a64"
+                        CornerRadius="5"
+                        HasShadow="False"
+                        HorizontalOptions="Center"
+                        IsVisible="{Binding ShowRFID}"
+                        VerticalOptions="CenterAndExpand"
+                        WidthRequest="200">
+                        <StackLayout Spacing="0">
+                            <Label
+                                Margin="15"
+                                FontSize="15"
+                                HorizontalTextAlignment="Center"
+                                Text="RFID Scanné"
+                                TextColor="#34a9ff" />
 
-                        <BoxView
-                            HeightRequest="1"
-                            HorizontalOptions="FillAndExpand"
-                            Color="#4f5a64" />
+                            <BoxView
+                                HeightRequest="1"
+                                HorizontalOptions="FillAndExpand"
+                                Color="#4f5a64" />
 
-                        <Label
-                            FontAttributes="Bold"
-                            HorizontalTextAlignment="Center"
-                            Text="{Binding RFIDResult}"
-                            TextColor="White" />
-                    </StackLayout>
-                </Frame>
+                            <Label
+                                FontAttributes="Bold"
+                                HorizontalTextAlignment="Center"
+                                Text="{Binding RFIDResult}"
+                                TextColor="White" />
+                        </StackLayout>
+                    </Frame>
 
-                <Frame
-                    Padding="0"
-                    BackgroundColor="Transparent"
-                    BorderColor="#4f5a64"
-                    CornerRadius="5"
-                    HasShadow="False"
-                    HorizontalOptions="Center"
-                    IsVisible="{Binding ShowError}"
-                    VerticalOptions="CenterAndExpand"
-                    WidthRequest="200">
-                    <StackLayout Spacing="0">
-                        <Label
-                            Margin="10"
-                            FontSize="Medium"
-                            HorizontalTextAlignment="Center"
-                            Text="Erreur"
-                            TextColor="#34a9ff" />
+                    <Frame
+                        Padding="0"
+                        BackgroundColor="Transparent"
+                        BorderColor="#4f5a64"
+                        CornerRadius="5"
+                        HasShadow="False"
+                        HorizontalOptions="Center"
+                        IsVisible="{Binding ShowError}"
+                        VerticalOptions="CenterAndExpand"
+                        WidthRequest="200">
+                        <StackLayout Spacing="0">
+                            <Label
+                                Margin="10"
+                                FontSize="Medium"
+                                HorizontalTextAlignment="Center"
+                                Text="Erreur"
+                                TextColor="#34a9ff" />
+
+                            <BoxView
+                                HeightRequest="1"
+                                HorizontalOptions="FillAndExpand"
+                                Color="#4f5a64" />
 
-                        <BoxView
-                            HeightRequest="1"
-                            HorizontalOptions="FillAndExpand"
-                            Color="#4f5a64" />
+                            <Label
+                                Margin="5,10"
+                                FontAttributes="Bold"
+                                FontSize="18"
+                                HorizontalTextAlignment="Center"
+                                Text="{Binding ErrorMessage}"
+                                TextColor="RED" />
+                        </StackLayout>
+                    </Frame>
 
+                </StackLayout>
+                <Grid
+                    HorizontalOptions="FillAndExpand"
+                    IsVisible="{Binding IsScanning}"
+                    VerticalOptions="FillAndExpand">
+                    <StackLayout VerticalOptions="Center">
+                        <ActivityIndicator IsRunning="True" Color="Orange" />
                         <Label
-                            Margin="5,10"
                             FontAttributes="Bold"
-                            FontSize="18"
+                            FontSize="Medium"
                             HorizontalTextAlignment="Center"
-                            Text="{Binding ErrorMessage}"
-                            TextColor="RED" />
+                            Text="Scanning"
+                            TextColor="Orange" />
                     </StackLayout>
-                </Frame>
-
-            </StackLayout>
+                    <BoxView
+                        BackgroundColor="White"
+                        Opacity="0.2"
+                        VerticalOptions="FillAndExpand" />
+                </Grid>
+            </Grid>
         </StackLayout>
 
     </ContentPage.Content>
diff --git a/TestXamConnections/TestXamConnections/Views/InternServiceView.xaml.cs b/TestXamConnections/TestXamConnections/Views/InternServiceView.xaml.cs
index 428112a..624f0af 100644
--- a/TestXamConnections/TestXamConnections/Views/InternServiceView.xaml.cs
+++ b/TestXamConnections/TestXamConnections/Views/InternServiceView.xaml.cs
@@ -17,5 +17,10 @@ namespace TestXamConnections.Views
             InitializeComponent();
             BindingContext = new InternServiceViewModel();
         }
+
+        protected override void OnDisappearing()
+        {
+            base.OnDisappearing();
+        }
     }
 }
\ No newline at end of file
