diff --git a/TestAssembly/FooExtension.cs b/TestAssembly/FooExtension.cs index fa86b19..32d7200 100644 --- a/TestAssembly/FooExtension.cs +++ b/TestAssembly/FooExtension.cs @@ -1,5 +1,5 @@ -using System; -using Xamarin.Forms.Xaml; +using Microsoft.Maui.Controls.Xaml; +using System; namespace TestAssembly { diff --git a/TestAssembly/TestAssembly.csproj b/TestAssembly/TestAssembly.csproj index 59f7043..0edd2a9 100644 --- a/TestAssembly/TestAssembly.csproj +++ b/TestAssembly/TestAssembly.csproj @@ -1,11 +1,8 @@ - netstandard2.0 + net6.0; + true - - - - diff --git a/Xamarin.Forms.Mocks.Tests/AnimationTests.cs b/Xamarin.Forms.Mocks.Tests/AnimationTests.cs index 1e851f6..c819eae 100644 --- a/Xamarin.Forms.Mocks.Tests/AnimationTests.cs +++ b/Xamarin.Forms.Mocks.Tests/AnimationTests.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.Maui.Controls; using NUnit.Framework; namespace Xamarin.Forms.Mocks.Tests diff --git a/Xamarin.Forms.Mocks.Tests/AppThemeTests.cs b/Xamarin.Forms.Mocks.Tests/AppThemeTests.cs index 90b6927..2c8d803 100644 --- a/Xamarin.Forms.Mocks.Tests/AppThemeTests.cs +++ b/Xamarin.Forms.Mocks.Tests/AppThemeTests.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using Microsoft.Maui.Controls; using NUnit.Framework; using Xamarin.Forms; diff --git a/Xamarin.Forms.Mocks.Tests/ApplicationTests.cs b/Xamarin.Forms.Mocks.Tests/ApplicationTests.cs index ce31fe7..ee8b981 100644 --- a/Xamarin.Forms.Mocks.Tests/ApplicationTests.cs +++ b/Xamarin.Forms.Mocks.Tests/ApplicationTests.cs @@ -1,5 +1,6 @@ -using NUnit.Framework; -using Xamarin.Forms.Xaml; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Graphics; +using NUnit.Framework; namespace Xamarin.Forms.Mocks.Tests { @@ -40,7 +41,7 @@ public void ApplicationFromXaml() { Application.Current = new App(); - Assert.AreEqual(Application.Current.Resources["White"], Color.White); + Assert.AreEqual(Application.Current.Resources["White"], Colors.White); } } } diff --git a/Xamarin.Forms.Mocks.Tests/DeviceTests.cs b/Xamarin.Forms.Mocks.Tests/DeviceTests.cs index 1080440..85ad301 100644 --- a/Xamarin.Forms.Mocks.Tests/DeviceTests.cs +++ b/Xamarin.Forms.Mocks.Tests/DeviceTests.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using Microsoft.Maui.Controls; using NUnit.Framework; namespace Xamarin.Forms.Mocks.Tests @@ -31,7 +32,6 @@ public void RuntimePlatformiOS() MockForms.Init(Device.iOS); Assert.AreEqual(Device.iOS, Device.RuntimePlatform); - Assert.AreEqual(TargetPlatform.iOS, Device.OS); } [Test] @@ -40,7 +40,6 @@ public void RuntimePlatformAndroid() MockForms.Init(Device.Android); Assert.AreEqual(Device.Android, Device.RuntimePlatform); - Assert.AreEqual(TargetPlatform.Android, Device.OS); } [Test] @@ -99,7 +98,7 @@ public void OpenUri() var expectedUri = new Uri("https://www.google.com"); - Device.OpenUri(expectedUri); + Microsoft.Maui.Essentials.Launcher.OpenAsync(expectedUri); Assert.AreEqual(expectedUri, actual); Assert.AreEqual(1, callCount); @@ -118,7 +117,7 @@ public void OpenUriDoesNotThrowOnNull() { MockForms.Init(); MockForms.OpenUriAction = null; - Device.OpenUri(new Uri("https://www.google.com")); + Microsoft.Maui.Essentials.Launcher.OpenAsync(new Uri("https://www.google.com")); } [Test] public void IdiomDesktop() diff --git a/Xamarin.Forms.Mocks.Tests/LoadFromXamlTests.cs b/Xamarin.Forms.Mocks.Tests/LoadFromXamlTests.cs index 8dc6eb6..30f30a8 100644 --- a/Xamarin.Forms.Mocks.Tests/LoadFromXamlTests.cs +++ b/Xamarin.Forms.Mocks.Tests/LoadFromXamlTests.cs @@ -1,5 +1,8 @@ -using NUnit.Framework; -using Xamarin.Forms.Xaml; +using Microsoft.Maui; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Xaml; +using Microsoft.Maui.Graphics; +using NUnit.Framework; namespace Xamarin.Forms.Mocks.Tests { @@ -58,7 +61,7 @@ public void LoadViewCellWithTrigger () var app = App.Current = new Application (); var color = - app.Resources ["DisabledbackgroundColor"] = Color.LightGray; + app.Resources ["DisabledbackgroundColor"] = Colors.LightGray; var cell = new SparePartViewCell (); cell.BindingContext = new { IsEnabled = false }; var grid = cell.View as Grid; diff --git a/Xamarin.Forms.Mocks.Tests/NavigationTests.cs b/Xamarin.Forms.Mocks.Tests/NavigationTests.cs index c609962..88387bd 100644 --- a/Xamarin.Forms.Mocks.Tests/NavigationTests.cs +++ b/Xamarin.Forms.Mocks.Tests/NavigationTests.cs @@ -1,6 +1,7 @@ using NUnit.Framework; using System.Threading.Tasks; using System.Linq; +using Microsoft.Maui.Controls; namespace Xamarin.Forms.Mocks.Tests { diff --git a/Xamarin.Forms.Mocks.Tests/OnPlatformTests.cs b/Xamarin.Forms.Mocks.Tests/OnPlatformTests.cs index 4f70bb8..f811d15 100644 --- a/Xamarin.Forms.Mocks.Tests/OnPlatformTests.cs +++ b/Xamarin.Forms.Mocks.Tests/OnPlatformTests.cs @@ -1,4 +1,6 @@ -using NUnit.Framework; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Graphics; +using NUnit.Framework; namespace Xamarin.Forms.Mocks.Tests { @@ -28,11 +30,11 @@ public void DefaultColor() var platformColor = new OnPlatform(); platformColor.Platforms.Add(new On { - Value = Color.Red, + Value = Colors.Red, Platform = new[] { Device.RuntimePlatform } }); - Assert.AreEqual(Color.Red, (Color)platformColor); + Assert.AreEqual(Colors.Red, (Color)platformColor); } [Test] @@ -40,15 +42,15 @@ public void iOSColor() { MockForms.Init(Device.iOS); - var platformColor = new OnPlatform { Default = Color.Blue }; + var platformColor = new OnPlatform { Default = Colors.Blue }; platformColor.Platforms.Add(new On { - Value = Color.Red, + Value = Colors.Red, Platform = new[] { Device.iOS } }); - Assert.AreNotEqual(Color.Blue, (Color)platformColor); - Assert.AreEqual(Color.Red, (Color)platformColor); + Assert.AreNotEqual(Colors.Blue, (Color)platformColor); + Assert.AreEqual(Colors.Red, (Color)platformColor); } [Test] @@ -56,15 +58,15 @@ public void AndroidColor() { MockForms.Init(Device.Android); - var platformColor = new OnPlatform { Default = Color.Blue }; + var platformColor = new OnPlatform { Default = Colors.Blue }; platformColor.Platforms.Add(new On { - Value = Color.Red, + Value = Colors.Red, Platform = new[] { Device.Android } }); - Assert.AreNotEqual(Color.Blue, (Color)platformColor); - Assert.AreEqual(Color.Red, (Color)platformColor); + Assert.AreNotEqual(Colors.Blue, (Color)platformColor); + Assert.AreEqual(Colors.Red, (Color)platformColor); } [Test] @@ -72,15 +74,15 @@ public void GTKColor() { MockForms.Init(Device.GTK); - var platformColor = new OnPlatform { Default = Color.Blue }; + var platformColor = new OnPlatform { Default = Colors.Blue }; platformColor.Platforms.Add(new On { - Value = Color.Red, + Value = Colors.Red, Platform = new[] { Device.GTK } }); - Assert.AreNotEqual(Color.Blue, (Color)platformColor); - Assert.AreEqual(Color.Red, (Color)platformColor); + Assert.AreNotEqual(Colors.Blue, (Color)platformColor); + Assert.AreEqual(Colors.Red, (Color)platformColor); } [Test] @@ -88,15 +90,15 @@ public void macOSColor() { MockForms.Init(Device.macOS); - var platformColor = new OnPlatform { Default = Color.Blue }; + var platformColor = new OnPlatform { Default = Colors.Blue }; platformColor.Platforms.Add(new On { - Value = Color.Red, + Value = Colors.Red, Platform = new[] { Device.macOS } }); - Assert.AreNotEqual(Color.Blue, (Color)platformColor); - Assert.AreEqual(Color.Red, (Color)platformColor); + Assert.AreNotEqual(Colors.Blue, (Color)platformColor); + Assert.AreEqual(Colors.Red, (Color)platformColor); } [Test] @@ -104,15 +106,15 @@ public void UWPColor() { MockForms.Init(Device.UWP); - var platformColor = new OnPlatform { Default = Color.Blue }; + var platformColor = new OnPlatform { Default = Colors.Blue }; platformColor.Platforms.Add(new On { - Value = Color.Red, + Value = Colors.Red, Platform = new[] { Device.UWP } }); - Assert.AreNotEqual(Color.Blue, (Color)platformColor); - Assert.AreEqual(Color.Red, (Color)platformColor); + Assert.AreNotEqual(Colors.Blue, (Color)platformColor); + Assert.AreEqual(Colors.Red, (Color)platformColor); } [Test] @@ -120,15 +122,15 @@ public void WPFColor() { MockForms.Init(Device.WPF); - var platformColor = new OnPlatform { Default = Color.Blue }; + var platformColor = new OnPlatform { Default = Colors.Blue }; platformColor.Platforms.Add(new On { - Value = Color.Red, + Value = Colors.Red, Platform = new[] { Device.WPF } }); - Assert.AreNotEqual(Color.Blue, (Color)platformColor); - Assert.AreEqual(Color.Red, (Color)platformColor); + Assert.AreNotEqual(Colors.Blue, (Color)platformColor); + Assert.AreEqual(Colors.Red, (Color)platformColor); } } } diff --git a/Xamarin.Forms.Mocks.Tests/PropertiesTests.cs b/Xamarin.Forms.Mocks.Tests/PropertiesTests.cs index 8728529..38eaa6c 100644 --- a/Xamarin.Forms.Mocks.Tests/PropertiesTests.cs +++ b/Xamarin.Forms.Mocks.Tests/PropertiesTests.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using Microsoft.Maui.Controls; using NUnit.Framework; namespace Xamarin.Forms.Mocks.Tests diff --git a/Xamarin.Forms.Mocks.Tests/Views/App.xaml b/Xamarin.Forms.Mocks.Tests/Views/App.xaml index 157c1ef..ec5e231 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/App.xaml +++ b/Xamarin.Forms.Mocks.Tests/Views/App.xaml @@ -1,5 +1,5 @@  - diff --git a/Xamarin.Forms.Mocks.Tests/Views/App.xaml.cs b/Xamarin.Forms.Mocks.Tests/Views/App.xaml.cs index bde8680..e742b28 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/App.xaml.cs +++ b/Xamarin.Forms.Mocks.Tests/Views/App.xaml.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.Maui.Controls; +using System; namespace Xamarin.Forms.Mocks.Tests { diff --git a/Xamarin.Forms.Mocks.Tests/Views/SparePartViewCell.xaml b/Xamarin.Forms.Mocks.Tests/Views/SparePartViewCell.xaml index 9ce985c..e4e487a 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/SparePartViewCell.xaml +++ b/Xamarin.Forms.Mocks.Tests/Views/SparePartViewCell.xaml @@ -1,6 +1,5 @@  - diff --git a/Xamarin.Forms.Mocks.Tests/Views/SparePartViewCell.xaml.cs b/Xamarin.Forms.Mocks.Tests/Views/SparePartViewCell.xaml.cs index 2e3a9f6..aa44019 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/SparePartViewCell.xaml.cs +++ b/Xamarin.Forms.Mocks.Tests/Views/SparePartViewCell.xaml.cs @@ -1,5 +1,4 @@ -using Xamarin.Forms; -using Xamarin.Forms.Xaml; +using Microsoft.Maui.Controls; namespace Xamarin.Forms.Mocks.Tests { diff --git a/Xamarin.Forms.Mocks.Tests/Views/TerribleExtension.cs b/Xamarin.Forms.Mocks.Tests/Views/TerribleExtension.cs index 7dc4c83..73477e4 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/TerribleExtension.cs +++ b/Xamarin.Forms.Mocks.Tests/Views/TerribleExtension.cs @@ -1,5 +1,5 @@ -using System; -using Xamarin.Forms.Xaml; +using Microsoft.Maui.Controls.Xaml; +using System; namespace Xamarin.Forms.Mocks.Tests { diff --git a/Xamarin.Forms.Mocks.Tests/Views/TestView.xaml b/Xamarin.Forms.Mocks.Tests/Views/TestView.xaml index 5bfd96d..62dc260 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/TestView.xaml +++ b/Xamarin.Forms.Mocks.Tests/Views/TestView.xaml @@ -1,4 +1,4 @@  - + diff --git a/Xamarin.Forms.Mocks.Tests/Views/TestView.xaml.cs b/Xamarin.Forms.Mocks.Tests/Views/TestView.xaml.cs index 7d8aaec..89009bf 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/TestView.xaml.cs +++ b/Xamarin.Forms.Mocks.Tests/Views/TestView.xaml.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.Maui.Controls; +using System; using System.Collections.Generic; using Xamarin.Forms; diff --git a/Xamarin.Forms.Mocks.Tests/Views/TestViewCompiled.xaml b/Xamarin.Forms.Mocks.Tests/Views/TestViewCompiled.xaml index 78d5a9f..a8d6ffe 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/TestViewCompiled.xaml +++ b/Xamarin.Forms.Mocks.Tests/Views/TestViewCompiled.xaml @@ -1,4 +1,4 @@  - + diff --git a/Xamarin.Forms.Mocks.Tests/Views/TestViewCompiled.xaml.cs b/Xamarin.Forms.Mocks.Tests/Views/TestViewCompiled.xaml.cs index 62c7743..3b1f205 100644 --- a/Xamarin.Forms.Mocks.Tests/Views/TestViewCompiled.xaml.cs +++ b/Xamarin.Forms.Mocks.Tests/Views/TestViewCompiled.xaml.cs @@ -1,7 +1,8 @@ -using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Xaml; +using System; using System.Collections.Generic; using Xamarin.Forms; -using Xamarin.Forms.Xaml; namespace Xamarin.Forms.Mocks.Tests { diff --git a/Xamarin.Forms.Mocks.Tests/Xamarin.Forms.Mocks.Tests.csproj b/Xamarin.Forms.Mocks.Tests/Xamarin.Forms.Mocks.Tests.csproj index dabb41d..89f7d41 100644 --- a/Xamarin.Forms.Mocks.Tests/Xamarin.Forms.Mocks.Tests.csproj +++ b/Xamarin.Forms.Mocks.Tests/Xamarin.Forms.Mocks.Tests.csproj @@ -1,20 +1,23 @@  - - net461 - Xamarin.Forms.Mocks.Tests - false - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + net6.0; + true + Xamarin.Forms.Mocks.Tests + false + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/Xamarin.Forms.Mocks.Xaml/TypeConversionExtensions.cs b/Xamarin.Forms.Mocks.Xaml/TypeConversionExtensions.cs index 9dd5e4b..0c0c8b2 100644 --- a/Xamarin.Forms.Mocks.Xaml/TypeConversionExtensions.cs +++ b/Xamarin.Forms.Mocks.Xaml/TypeConversionExtensions.cs @@ -1,9 +1,11 @@ -using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Xaml.Internals; +using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; using System.Linq; using System.Reflection; -using Xamarin.Forms.Xaml.Internals; namespace Xamarin.Forms.Mocks.Xaml { @@ -37,7 +39,7 @@ internal static object ConvertTo (this object value, Type toType, Func attributes) { var converterAttribute = - attributes.FirstOrDefault (cad => TypeConverterAttribute.TypeConvertersType.Contains (cad.AttributeType.FullName)); + attributes.FirstOrDefault (cad => System.ComponentModel.TypeConverterAttribute.Default.ConverterTypeName.Contains (cad.AttributeType.FullName)); if (converterAttribute == null) return null; if (converterAttribute.ConstructorArguments [0].ArgumentType == typeof (string)) diff --git a/Xamarin.Forms.Mocks.Xaml/ValueConverterProvider.cs b/Xamarin.Forms.Mocks.Xaml/ValueConverterProvider.cs deleted file mode 100644 index a5de565..0000000 --- a/Xamarin.Forms.Mocks.Xaml/ValueConverterProvider.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Reflection; -using Xamarin.Forms.Xaml; - -namespace Xamarin.Forms.Mocks.Xaml -{ - public class ValueConverterProvider : IValueConverterProvider - { - public object Convert(object value, Type toType, Func minfoRetriever, IServiceProvider serviceProvider) - { - return value.ConvertTo(toType, minfoRetriever, serviceProvider); - } - } -} diff --git a/Xamarin.Forms.Mocks.Xaml/Xamarin.Forms.Mocks.Xaml.csproj b/Xamarin.Forms.Mocks.Xaml/Xamarin.Forms.Mocks.Xaml.csproj index 45ca2b0..bbc1ce1 100644 --- a/Xamarin.Forms.Mocks.Xaml/Xamarin.Forms.Mocks.Xaml.csproj +++ b/Xamarin.Forms.Mocks.Xaml/Xamarin.Forms.Mocks.Xaml.csproj @@ -1,9 +1,7 @@  - netstandard2.0 + net6.0 + true Xamarin.Forms.Xaml.UnitTests - - - diff --git a/Xamarin.Forms.Mocks.Xaml/XamlExtensions.cs b/Xamarin.Forms.Mocks.Xaml/XamlExtensions.cs deleted file mode 100644 index e7cc31a..0000000 --- a/Xamarin.Forms.Mocks.Xaml/XamlExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Xamarin.Forms.Xaml -{ - public static class XamlExtensions - { - public static void LoadFromXaml(this object view, string xaml) - { - XamlLoader.Load(view, xaml); - } - } -} diff --git a/Xamarin.Forms.Mocks.sln b/Xamarin.Forms.Mocks.sln index 09a842d..ed56222 100644 --- a/Xamarin.Forms.Mocks.sln +++ b/Xamarin.Forms.Mocks.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28922.388 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31815.197 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Forms.Mocks", "Xamarin.Forms.Mocks\Xamarin.Forms.Mocks.csproj", "{AFB557D0-683D-4370-8851-23A617B8079A}" EndProject @@ -10,7 +10,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Forms.Mocks.Tests", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{633E81F0-48E3-406F-90AE-A1B4ADF46DD1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestAssembly", "TestAssembly\TestAssembly.csproj", "{9643543F-E3B3-4723-925A-E33D7E6108A4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAssembly", "TestAssembly\TestAssembly.csproj", "{9643543F-E3B3-4723-925A-E33D7E6108A4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6517E9AA-7689-4A75-80A4-8CCF2402911D}" + ProjectSection(SolutionItems) = preProject + .travis.yml = .travis.yml + appveyor.yml = appveyor.yml + build.cake = build.cake + build.ps1 = build.ps1 + build.sh = build.sh + LICENSE = LICENSE + README.md = README.md + Xamarin.Forms.Mocks.nuspec = Xamarin.Forms.Mocks.nuspec + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Xamarin.Forms.Mocks/IsolatedStorageFile.cs b/Xamarin.Forms.Mocks/IsolatedStorageFile.cs index 3cf8b73..60284a4 100644 --- a/Xamarin.Forms.Mocks/IsolatedStorageFile.cs +++ b/Xamarin.Forms.Mocks/IsolatedStorageFile.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; -using Xamarin.Forms.Internals; +using Microsoft.Maui.Controls.Internals; namespace Xamarin.Forms.Mocks { diff --git a/Xamarin.Forms.Mocks/MockDeviceInfo.cs b/Xamarin.Forms.Mocks/MockDeviceInfo.cs index 7bc1fc9..2efbe02 100644 --- a/Xamarin.Forms.Mocks/MockDeviceInfo.cs +++ b/Xamarin.Forms.Mocks/MockDeviceInfo.cs @@ -1,4 +1,5 @@ -using Xamarin.Forms.Internals; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; namespace Xamarin.Forms.Mocks { diff --git a/Xamarin.Forms.Mocks/MockForms.cs b/Xamarin.Forms.Mocks/MockForms.cs index c4fb12c..998406f 100644 --- a/Xamarin.Forms.Mocks/MockForms.cs +++ b/Xamarin.Forms.Mocks/MockForms.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.Maui.Controls; +using System; using System.Runtime.CompilerServices; using Xamarin.Forms.Mocks.Xaml; @@ -9,7 +10,7 @@ namespace Xamarin.Forms.Mocks public static class MockForms { /// - /// Callback for asserting against Device.OpenUri + /// Callback for asserting against Microsoft.Maui.Essentials.Launcher.OpenAsync /// NOTE: MockForms.Init() clears this value /// public static Action OpenUriAction { get; set; } @@ -17,11 +18,9 @@ public static class MockForms public static void Init(string runtimePlatform = "Test", TargetIdiom idiom = default(TargetIdiom), OSAppTheme requestedTheme = OSAppTheme.Unspecified) { Device.PlatformServices = new PlatformServices(runtimePlatform, requestedTheme); - Device.Idiom = idiom; Device.Info = new MockDeviceInfo(); DependencyService.Register(); DependencyService.Register(); - DependencyService.Register(); OpenUriAction = null; } } diff --git a/Xamarin.Forms.Mocks/PlatformServices.cs b/Xamarin.Forms.Mocks/PlatformServices.cs index 7bfbe42..805e749 100644 --- a/Xamarin.Forms.Mocks/PlatformServices.cs +++ b/Xamarin.Forms.Mocks/PlatformServices.cs @@ -1,11 +1,15 @@ -using System; +using Microsoft.Maui.Animations; +using Microsoft.Maui.Controls; +using System; using System.IO; using System.Reflection; using System.Security.Cryptography; using System.Text; using System.Threading; using System.Threading.Tasks; -using Xamarin.Forms.Internals; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui; +using Microsoft.Maui.Graphics; namespace Xamarin.Forms.Mocks { @@ -107,7 +111,7 @@ public async void StartTimer(TimeSpan interval, Func callback) public Color GetNamedColor(string name) { // Not supported on this platform - return Color.Default; + return Colors.Black; } } } diff --git a/Xamarin.Forms.Mocks/Serializer.cs b/Xamarin.Forms.Mocks/Serializer.cs index 423d060..ead0dd5 100644 --- a/Xamarin.Forms.Mocks/Serializer.cs +++ b/Xamarin.Forms.Mocks/Serializer.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Xamarin.Forms.Internals; +using Microsoft.Maui.Controls.Internals; namespace Xamarin.Forms.Mocks { diff --git a/Xamarin.Forms.Mocks/SystemResourcesProvider.cs b/Xamarin.Forms.Mocks/SystemResourcesProvider.cs index 45565b7..41fe60d 100644 --- a/Xamarin.Forms.Mocks/SystemResourcesProvider.cs +++ b/Xamarin.Forms.Mocks/SystemResourcesProvider.cs @@ -1,4 +1,5 @@ -using Xamarin.Forms.Internals; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Internals; namespace Xamarin.Forms.Mocks { diff --git a/Xamarin.Forms.Mocks/TestTicker.cs b/Xamarin.Forms.Mocks/TestTicker.cs index b6bb52e..f302304 100644 --- a/Xamarin.Forms.Mocks/TestTicker.cs +++ b/Xamarin.Forms.Mocks/TestTicker.cs @@ -1,4 +1,4 @@ -using Xamarin.Forms.Internals; +using Microsoft.Maui.Animations; namespace Xamarin.Forms.Mocks { @@ -6,17 +6,17 @@ internal class TestTicker : Ticker { private bool _enabled; - protected override void EnableTimer() + public override void Start() { _enabled = true; while (_enabled) { - SendSignals(16); + Fire(); } } - protected override void DisableTimer() + public override void Stop() { _enabled = false; } diff --git a/Xamarin.Forms.Mocks/Xamarin.Forms.Mocks.csproj b/Xamarin.Forms.Mocks/Xamarin.Forms.Mocks.csproj index 0ea84db..fb62f68 100644 --- a/Xamarin.Forms.Mocks/Xamarin.Forms.Mocks.csproj +++ b/Xamarin.Forms.Mocks/Xamarin.Forms.Mocks.csproj @@ -1,11 +1,9 @@  - netstandard2.0 + net6.0; + true Xamarin.Forms.Core.UnitTests - - -