user-notifier
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d269e2708c
commit
6c61fbe1a4
@ -0,0 +1,4 @@
|
||||
[*.cs]
|
||||
|
||||
# CS0618: Le type ou le membre est obsolète
|
||||
dotnet_diagnostic.CS0618.severity = silent
|
@ -1,9 +1,39 @@
|
||||
namespace ShoopNCook.Views.Components;
|
||||
using Microsoft.Maui.Graphics;
|
||||
|
||||
public partial class NoticePopup : ContentView
|
||||
{
|
||||
public NoticePopup()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public NoticePopup(string message, string messageType)
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
MessageLabel.Text = message;
|
||||
|
||||
switch (messageType)
|
||||
{
|
||||
case "Error":
|
||||
this.BackgroundColor = Microsoft.Maui.Graphics.Colors.Red;
|
||||
break;
|
||||
case "Warning":
|
||||
this.BackgroundColor = Microsoft.Maui.Graphics.Colors.Yellow;
|
||||
break;
|
||||
case "Notice":
|
||||
this.BackgroundColor = Microsoft.Maui.Graphics.Colors.Blue;
|
||||
break;
|
||||
case "Success":
|
||||
this.BackgroundColor = Microsoft.Maui.Graphics.Colors.Green;
|
||||
break;
|
||||
}
|
||||
|
||||
// Display the toast for 3 seconds
|
||||
|
||||
Device.StartTimer(TimeSpan.FromSeconds(3), () =>
|
||||
{
|
||||
// Close the toast
|
||||
// You need to replace this with your actual code to close the toast
|
||||
this.IsVisible = false;
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in new issue