ReloadPreview 3.0.2
See the version list below for details.
dotnet add package ReloadPreview --version 3.0.2
NuGet\Install-Package ReloadPreview -Version 3.0.2
<PackageReference Include="ReloadPreview" Version="3.0.2" />
paket add ReloadPreview --version 3.0.2
#r "nuget: ReloadPreview, 3.0.2"
// Install ReloadPreview as a Cake Addin #addin nuget:?package=ReloadPreview&version=3.0.2 // Install ReloadPreview as a Cake Tool #tool nuget:?package=ReloadPreview&version=3.0.2
ReloadPreview
What is ReloadPreview
We know we can preview the ui when use xaml,xml,storyboard,swiftui, but if you want use C# code to write ui, no preview? Now, you can use this library to do it. It not only preview, because it need run app, that mean you can show data and load service, and debug by print info.
Support platform
- net6.0-android (tested)
- net6.0-iOS (tested, can't reload object that extend object-c)
- new6.0-mac
- WPF
- Xamarin
Need other platform? Invoke UI thread when change ui at Reload event, or override InvokeInMainThread
method.
How it work
After code changed, Command Line Server use msbuild to create new dll, then use socket send the .dll to android or ios app, app can use reflection to create instance from dll. So, you can remove old view form window, and use this instance of new view to do something.
How to use
Install and Run Command Line Server , input proj and target, such as D:/RelodPreview/ReloadPreview.csproj -t=android
.
Them install nuget, use it, such as at MAUI app:
public App()
{
HotReload.Instance.Init("192.168.0.108");
InitializeComponent();
HotReload.Instance.Reload += () =>
{
var view = HotReload.Instance.ReloadClass<MainPage>() as Page;
Console.WriteLine(view is null);
MainPage = view;
};
MainPage = new MainPage();
}
Tips
2021.10.21
I found when you close "Edit and Continue" at Visual Studio 2022, you can use "Apply Changes" of Visual Studio to continue simple debug Android, At Android, "Apply Changes" will kill current Activity, and reload the Activity in apk, it can't let app auto load the new dll, so ReloadPreview can help you reload all the things of the activity. Limit is you just can use old breakpoint.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-android31.0 is compatible. net6.0-ios was computed. net6.0-ios15.2 is compatible. net6.0-maccatalyst was computed. net6.0-maccatalyst15.2 is compatible. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net6.0-windows10.0.19041 is compatible. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 6.0.2)
-
net6.0
- System.Text.Json (>= 6.0.2)
-
net6.0-android31.0
- System.Text.Json (>= 6.0.2)
-
net6.0-ios15.2
- System.Text.Json (>= 6.0.2)
-
net6.0-maccatalyst15.2
- System.Text.Json (>= 6.0.2)
-
net6.0-windows10.0.19041
- System.Text.Json (>= 6.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
3.0.7 | 565 | 7/12/2022 | |
3.0.6 | 542 | 4/21/2022 | |
3.0.5 | 446 | 3/3/2022 | |
3.0.4 | 437 | 2/27/2022 | |
3.0.3 | 455 | 2/27/2022 | |
3.0.2 | 460 | 2/27/2022 | |
2.1.8 | 314 | 12/22/2021 | |
2.1.7 | 285 | 12/22/2021 | |
2.1.6 | 307 | 12/14/2021 | |
2.1.5 | 358 | 12/14/2021 | |
2.1.4 | 518 | 12/11/2021 | |
2.1.3 | 1,322 | 12/3/2021 | |
2.1.2 | 724 | 12/3/2021 | |
2.1.1 | 302 | 12/3/2021 | |
2.1.0 | 313 | 12/2/2021 | |
2.0.0 | 1,606 | 12/1/2021 | |
1.2.0 | 314 | 11/28/2021 | |
1.0.0 | 375 | 10/13/2021 |
created for maui single project