diff --git a/sample/Sample/App.xaml b/sample/Sample/App.xaml index 44de3734..c7b682e9 100644 --- a/sample/Sample/App.xaml +++ b/sample/Sample/App.xaml @@ -1,8 +1,8 @@  + xmlns:local="clr-namespace:Samples" + x:Class="Samples.App"> diff --git a/sample/Sample/App.xaml.cs b/sample/Sample/App.xaml.cs index f592646b..6e486afa 100644 --- a/sample/Sample/App.xaml.cs +++ b/sample/Sample/App.xaml.cs @@ -1,14 +1,11 @@ -using Samples; +namespace Samples; -namespace Sample +public partial class App : Application { - public partial class App : Application + public App() { - public App() - { - InitializeComponent(); + this.InitializeComponent(); - this.MainPage = new MainPage(); - } + this.MainPage = new MainPage(); } } diff --git a/sample/Sample/MauiProgram.cs b/sample/Sample/MauiProgram.cs index f7eaf8ea..474c9a5e 100644 --- a/sample/Sample/MauiProgram.cs +++ b/sample/Sample/MauiProgram.cs @@ -1,7 +1,4 @@ -using Acr.UserDialogs; -using Microsoft.Maui.LifecycleEvents; - -namespace Sample; +namespace Samples; public static class MauiProgram @@ -18,7 +15,7 @@ public static MauiApp CreateMauiApp() }); #if ANDROID - UserDialogs.Init(() => Platform.CurrentActivity); + Acr.UserDialogs.UserDialogs.Init(() => Platform.CurrentActivity); #endif return builder.Build(); } diff --git a/sample/Sample/Platforms/Android/MainActivity.cs b/sample/Sample/Platforms/Android/MainActivity.cs index 65db277d..287b02e7 100644 --- a/sample/Sample/Platforms/Android/MainActivity.cs +++ b/sample/Sample/Platforms/Android/MainActivity.cs @@ -1,11 +1,20 @@ using Android.App; using Android.Content.PM; -using Android.OS; -namespace Sample +namespace Samples { - [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] + [Activity( + Theme = "@style/Maui.SplashTheme", + MainLauncher = true, + ConfigurationChanges = + ConfigChanges.ScreenSize | + ConfigChanges.Orientation | + ConfigChanges.UiMode | + ConfigChanges.ScreenLayout | + ConfigChanges.SmallestScreenSize | + ConfigChanges.Density + )] public class MainActivity : MauiAppCompatActivity { } -} \ No newline at end of file +} diff --git a/sample/Sample/Platforms/Android/MainApplication.cs b/sample/Sample/Platforms/Android/MainApplication.cs index ea556747..2b4f7cf1 100644 --- a/sample/Sample/Platforms/Android/MainApplication.cs +++ b/sample/Sample/Platforms/Android/MainApplication.cs @@ -1,7 +1,7 @@ using Android.App; using Android.Runtime; -namespace Sample +namespace Samples { [Application] public class MainApplication : MauiApplication @@ -13,4 +13,4 @@ public MainApplication(IntPtr handle, JniHandleOwnership ownership) protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } -} \ No newline at end of file +} diff --git a/sample/Sample/Platforms/MacCatalyst/AppDelegate.cs b/sample/Sample/Platforms/MacCatalyst/AppDelegate.cs index ebf5095b..9e528147 100644 --- a/sample/Sample/Platforms/MacCatalyst/AppDelegate.cs +++ b/sample/Sample/Platforms/MacCatalyst/AppDelegate.cs @@ -1,10 +1,10 @@ using Foundation; -namespace Sample +namespace Samples { [Register("AppDelegate")] public class AppDelegate : MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } -} \ No newline at end of file +} diff --git a/sample/Sample/Platforms/MacCatalyst/Program.cs b/sample/Sample/Platforms/MacCatalyst/Program.cs index aaecb2e8..4eaad85b 100644 --- a/sample/Sample/Platforms/MacCatalyst/Program.cs +++ b/sample/Sample/Platforms/MacCatalyst/Program.cs @@ -1,8 +1,6 @@ -using ObjCRuntime; +using UIKit; -using UIKit; - -namespace Sample +namespace Samples { public class Program { @@ -14,4 +12,4 @@ static void Main(string[] args) UIApplication.Main(args, null, typeof(AppDelegate)); } } -} \ No newline at end of file +} diff --git a/sample/Sample/Platforms/Windows/App.xaml b/sample/Sample/Platforms/Windows/App.xaml index c64b6780..55995a55 100644 --- a/sample/Sample/Platforms/Windows/App.xaml +++ b/sample/Sample/Platforms/Windows/App.xaml @@ -1,8 +1,8 @@  + xmlns:local="using:Samples.WinUI"> diff --git a/sample/Sample/Platforms/Windows/App.xaml.cs b/sample/Sample/Platforms/Windows/App.xaml.cs index 649a6d27..c258d6d1 100644 --- a/sample/Sample/Platforms/Windows/App.xaml.cs +++ b/sample/Sample/Platforms/Windows/App.xaml.cs @@ -3,7 +3,7 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace Sample.WinUI +namespace Samples.WinUI { /// /// Provides application-specific behavior to supplement the default Application class. diff --git a/sample/Sample/Platforms/Windows/app.manifest b/sample/Sample/Platforms/Windows/app.manifest index f1912528..1f0db372 100644 --- a/sample/Sample/Platforms/Windows/app.manifest +++ b/sample/Sample/Platforms/Windows/app.manifest @@ -1,6 +1,6 @@ - + diff --git a/sample/Sample/Platforms/iOS/AppDelegate.cs b/sample/Sample/Platforms/iOS/AppDelegate.cs index ebf5095b..9e528147 100644 --- a/sample/Sample/Platforms/iOS/AppDelegate.cs +++ b/sample/Sample/Platforms/iOS/AppDelegate.cs @@ -1,10 +1,10 @@ using Foundation; -namespace Sample +namespace Samples { [Register("AppDelegate")] public class AppDelegate : MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } -} \ No newline at end of file +} diff --git a/sample/Sample/Platforms/iOS/Program.cs b/sample/Sample/Platforms/iOS/Program.cs index aaecb2e8..4eaad85b 100644 --- a/sample/Sample/Platforms/iOS/Program.cs +++ b/sample/Sample/Platforms/iOS/Program.cs @@ -1,8 +1,6 @@ -using ObjCRuntime; +using UIKit; -using UIKit; - -namespace Sample +namespace Samples { public class Program { @@ -14,4 +12,4 @@ static void Main(string[] args) UIApplication.Main(args, null, typeof(AppDelegate)); } } -} \ No newline at end of file +} diff --git a/sample/Sample/ViewModels/SpecificCasesViewModel.cs b/sample/Sample/ViewModels/SpecificCasesViewModel.cs index be52ad78..154224f2 100644 --- a/sample/Sample/ViewModels/SpecificCasesViewModel.cs +++ b/sample/Sample/ViewModels/SpecificCasesViewModel.cs @@ -123,7 +123,7 @@ await this.Dialogs.AlertAsync(new AlertConfig Text = "Toast with image", Command = new Command(() => { - var img = Device.RuntimePlatform == Device.UWP ? "ms-appx:///Assets/emoji_cool_small.png" : "emoji_cool_small.png"; + var img = DeviceInfo.Platform == DevicePlatform.WinUI ? "ms-appx:///Assets/emoji_cool_small.png" : "emoji_cool_small.png"; this.Dialogs.Toast(new ToastConfig("Wow what a cool guy").SetIcon(img)); }) }, diff --git a/sample/Sample/ViewModels/ToastsViewModel.cs b/sample/Sample/ViewModels/ToastsViewModel.cs index 94878664..7ee7e6fa 100644 --- a/sample/Sample/ViewModels/ToastsViewModel.cs +++ b/sample/Sample/ViewModels/ToastsViewModel.cs @@ -45,24 +45,24 @@ public ToastsViewModel(IUserDialogs dialogs) : base(dialogs) } - static System.Drawing.Color FromHex(string hex) - { - var c = Color.FromHex(hex); - var dc = System.Drawing.Color.FromArgb((int)c.Alpha, (int)c.Red, (int)c.Green, (int)c.Blue); - return dc; - } - - - static string ToHex(Color color) - { - var red = (int)(color.Red * 255); - var green = (int)(color.Green * 255); - var blue = (int)(color.Blue * 255); - //var alpha = (int)(color.A * 255); - //var hex = String.Format($"#{red:X2}{green:X2}{blue:X2}{alpha:X2}"); - var hex = String.Format($"#{red:X2}{green:X2}{blue:X2}"); - return hex; - } + //static System.Drawing.Color FromHex(string hex) + //{ + // var c = Color.FromArgb(hex); + // var dc = System.Drawing.Color.FromArgb((int)c.Alpha, (int)c.Red, (int)c.Green, (int)c.Blue); + // return dc; + //} + + + //static string ToHex(Color color) + //{ + // var red = (int)(color.Red * 255); + // var green = (int)(color.Green * 255); + // var blue = (int)(color.Blue * 255); + // //var alpha = (int)(color.A * 255); + // //var hex = String.Format($"#{red:X2}{green:X2}{blue:X2}{alpha:X2}"); + // var hex = String.Format($"#{red:X2}{green:X2}{blue:X2}"); + // return hex; + //} public ICommand Open { get; } diff --git a/src/Acr.UserDialogs/Acr.UserDialogs.csproj b/src/Acr.UserDialogs/Acr.UserDialogs.csproj index 34dc4d7b..30df2970 100644 --- a/src/Acr.UserDialogs/Acr.UserDialogs.csproj +++ b/src/Acr.UserDialogs/Acr.UserDialogs.csproj @@ -2,6 +2,7 @@ net8.0;net8.0-ios;net8.0-android;net8.0-maccatalyst;net8.0-macos $(TargetFrameworks);net8.0-windows + https://github.com/aritchie/userdialogs $(AssemblyName) ($(TargetFramework)) Allan Ritchie @@ -57,10 +58,15 @@ - + + + \ No newline at end of file diff --git a/src/Acr.UserDialogs/Platforms/Windows/ActionSheetViewModel.cs b/src/Acr.UserDialogs/Platforms/Windows/ActionSheetViewModel.cs index 8c776eeb..fe4b43bf 100644 --- a/src/Acr.UserDialogs/Platforms/Windows/ActionSheetViewModel.cs +++ b/src/Acr.UserDialogs/Platforms/Windows/ActionSheetViewModel.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Windows.UI.Xaml; namespace Acr.UserDialogs diff --git a/src/Acr.UserDialogs/Platforms/Windows/TimePickerControl.xaml b/src/Acr.UserDialogs/Platforms/Windows/TimePickerControl.xaml index 5804d6e5..fb0834b0 100644 --- a/src/Acr.UserDialogs/Platforms/Windows/TimePickerControl.xaml +++ b/src/Acr.UserDialogs/Platforms/Windows/TimePickerControl.xaml @@ -1,5 +1,6 @@