Skip to content
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
5e9a696
Move dispatcher logic out of IPlatformServices
mattleibow Oct 7, 2021
33b1fb8
obsolete
mattleibow Oct 7, 2021
d60b487
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 7, 2021
aafca63
remove obsolete
mattleibow Oct 7, 2021
5471049
Rework the dispatcher system
mattleibow Oct 13, 2021
6b1ec57
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 13, 2021
205f2fc
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 13, 2021
57ac327
rename file to match type
mattleibow Oct 13, 2021
411ffdb
no longer used
mattleibow Oct 13, 2021
c06b55b
rename for now
mattleibow Oct 15, 2021
6a0f16b
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 15, 2021
45f8100
ws
mattleibow Oct 15, 2021
bf08a23
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 15, 2021
2bb8bc6
fix after merge
mattleibow Oct 15, 2021
ed8da49
Fix up some SO
mattleibow Oct 16, 2021
9932d68
rename
mattleibow Oct 16, 2021
d9423ba
remove duplicates
mattleibow Oct 16, 2021
4be55de
Fix tests
mattleibow Oct 16, 2021
c54e40d
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 18, 2021
6e738ff
Fix more tests
mattleibow Oct 18, 2021
75e273d
Dispatchers are provided by the platform
mattleibow Oct 18, 2021
27f0a79
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 21, 2021
32f5012
Merge branch 'main' into dev/dispatchers
mattleibow Oct 22, 2021
4b98a33
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 22, 2021
ca55f31
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 24, 2021
4d79afe
Fix that
mattleibow Oct 25, 2021
d5b86b5
this goes
mattleibow Oct 25, 2021
68151c2
We can't throw in the ctor, it breaks too much
mattleibow Oct 26, 2021
71ab798
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Oct 26, 2021
bb2f710
Merge remote-tracking branch 'origin/release/6.0.1xx-preview10' into …
mattleibow Oct 26, 2021
57ae42c
Merge remote-tracking branch 'origin/release/6.0.1xx-preview10' into …
mattleibow Oct 26, 2021
da12b60
Merge remote-tracking branch 'origin/release/6.0.1xx-preview10' into …
mattleibow Oct 27, 2021
f5b84c8
Use the new thing
mattleibow Oct 27, 2021
ef3728c
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Nov 1, 2021
6e06653
Merge branch 'main' into dev/dispatchers
Redth Nov 2, 2021
4eff060
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Nov 10, 2021
54b45a5
The dependency
mattleibow Nov 10, 2021
7fcb80e
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Nov 10, 2021
9f74033
Fix wording
mattleibow Nov 10, 2021
520df9c
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Nov 10, 2021
f98733b
remove this again
mattleibow Nov 10, 2021
0f8f83f
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Nov 11, 2021
37c3725
Can never be null
mattleibow Nov 11, 2021
129fc0c
Use run loops and not threads
mattleibow Nov 11, 2021
b13d30a
boo
mattleibow Nov 11, 2021
cf94a2f
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Nov 11, 2021
568c118
reverse the order for lookup
mattleibow Nov 12, 2021
c0e122a
Update src/Core/tests/UnitTests/Dispatching/DispatcherTests.cs
mattleibow Nov 12, 2021
1492f86
The provider should cache the dispatcher instance
mattleibow Nov 12, 2021
fad6231
renamed
mattleibow Nov 12, 2021
29ddbfa
update the tests too
mattleibow Nov 12, 2021
99e113f
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Nov 12, 2021
a8008df
fix that
mattleibow Nov 12, 2021
3635abd
Use the dispatcher instead of the mock services
mattleibow Nov 13, 2021
fc1316a
Merge remote-tracking branch 'origin/main' into dev/dispatchers
mattleibow Nov 15, 2021
7502289
Use the correct thread static/thread local
mattleibow Nov 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Reflection;
using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
using Microsoft.Maui.Controls.CustomAttributes;
using Microsoft.Maui.Dispatching;
using NUnit.Framework.Interfaces;
using IOPath = System.IO.Path;

Expand Down Expand Up @@ -431,9 +432,6 @@ public abstract class TestCarouselPage : CarouselPage
public IApp RunningApp => AppSetup.RunningApp;

protected virtual bool Isolate => false;

IDispatcher _dispatcher = new FallbackDispatcher();
public override IDispatcher Dispatcher { get => _dispatcher; }
#endif

protected TestCarouselPage()
Expand Down Expand Up @@ -536,9 +534,6 @@ public abstract class TestTabbedPage : TabbedPage
public IApp RunningApp => AppSetup.RunningApp;

protected virtual bool Isolate => false;

IDispatcher _dispatcher = new FallbackDispatcher();
public override IDispatcher Dispatcher { get => _dispatcher; }
#endif

protected TestTabbedPage()
Expand Down
20 changes: 0 additions & 20 deletions src/Compatibility/Core/src/Android/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -490,25 +490,13 @@ class AndroidPlatformServices : IPlatformServices, IPlatformInvalidate
double _microSize;
double _smallSize;

static Handler s_handler;

readonly Context _context;

public AndroidPlatformServices(Context context)
{
_context = context;
}

public void BeginInvokeOnMainThread(Action action)
{
if (s_handler == null || s_handler.Looper != Looper.MainLooper)
{
s_handler = new Handler(Looper.MainLooper);
}

s_handler.Post(action);
}

public Assembly[] GetAssemblies()
{
return AppDomain.CurrentDomain.GetAssemblies();
Expand Down Expand Up @@ -664,14 +652,6 @@ public Color GetNamedColor(string name)
return null;
}

public bool IsInvokeRequired
{
get
{
return Looper.MainLooper != Looper.MyLooper();
}
}

public string RuntimePlatform => Device.Android;

public void StartTimer(TimeSpan interval, Func<bool> callback)
Expand Down
30 changes: 0 additions & 30 deletions src/Compatibility/Core/src/Windows/Dispatcher.cs

This file was deleted.

38 changes: 0 additions & 38 deletions src/Compatibility/Core/src/Windows/DispatcherProvider.cs

This file was deleted.

4 changes: 1 addition & 3 deletions src/Compatibility/Core/src/Windows/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ static void SetupInit(

Registrar.ExtraAssemblies = rendererAssemblies?.ToArray();

var dispatcher = mainWindow?.DispatcherQueue ?? UI.Dispatching.DispatcherQueue.GetForCurrentThread();

var platformServices = new WindowsPlatformServices(dispatcher);
var platformServices = new WindowsPlatformServices();

Device.PlatformServices = platformServices;
Device.PlatformInvalidator = platformServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<!-- add directives for your library here -->
<Namespace Name="Windows.UI.Xaml.Automation.Peers" MarshalObject="Required All"/>
<Type Name="Xamarin.Forms.Platform.UWP.WindowsPlatformServices" Activate="Required All"/>
<Type Name="Xamarin.Forms.Platform.UWP.WindowsBasePlatformServices" Activate="Required All"/>
<Type Name="Xamarin.Forms.Platform.UWP.WindowsPlatform" Activate="Required All"/>
</Library>
</Directives>
Loading