Com.MarcusTS.UI.XamForms
2.0.8
dotnet add package Com.MarcusTS.UI.XamForms --version 2.0.8
NuGet\Install-Package Com.MarcusTS.UI.XamForms -Version 2.0.8
<PackageReference Include="Com.MarcusTS.UI.XamForms" Version="2.0.8" />
paket add Com.MarcusTS.UI.XamForms --version 2.0.8
#r "nuget: Com.MarcusTS.UI.XamForms, 2.0.8"
// Install Com.MarcusTS.UI.XamForms as a Cake Addin #addin nuget:?package=Com.MarcusTS.UI.XamForms&version=2.0.8 // Install Com.MarcusTS.UI.XamForms as a Cake Tool #tool nuget:?package=Com.MarcusTS.UI.XamForms&version=2.0.8
Xamarin.Forms Specific
A Light-Weight Framework for Modern, Animated Apps Using Responsive Tasks
We have said -- more than once -- that a framework is a way of doing something very badly while pretending to save time. Projects like Prism break more rules than a guest with Tourette's Syndrome at a tea party. They claim to "take care of the coding for you". But they do it by violating design principles and coding standards. Those ideals aren't just "polite rules for nice people". They are what make an app safe, reliable, manageable, scalable, affordable, and user-friendly. Design is everything.
A real framework would leverage design principles to create a light-weight programming platform that promotes an exciting, involving user experience through an animated UI. It would cure Xamarin's limitations. It would aspire to greatness, but without trying to take over the world.
That's where our humble library comes in. It isn't a black box. It is tiny compare to so-called frameworks. You can easily modify it or combine it with other tools. Let's compare approaches to other coding paradigms:
Topic | How We Handle It | How They Handle It | |
---|---|---|---|
The Task Parallel Library | Head-on; ResponsiveTasks repairs broken TPL roots. We can even wait for void without hanging your app. | "I see nothing! Nothing!" Dozens of bad threads racing constantly | |
C# Fundamentals | 100% compliant. No redundancy. All interface contracts. | "Magic" file names illegally glue view models to views; if they don't match, the app crashes at run-time. Extreme redundancy (2 million lines worth!) Few interface contracts. | |
Navigation | Independent App State Manager identifies the app state using a set of handy string constants. View Presenter uses the app state to determine what view and view model should handle it based on run-time conditions. Flexible, open, and dynamic. | Tired, old "web" style menus and back-stack with rigid, hard-coded views and view models. Navigation occurs from a view model directly; this is illegal, since a view model cannot know what other views actually exist. | |
Page Management | Simple, single-page app with views that flow in and out like actors on a stage. Elegant, powerful, and light-weight coding. Fully animated. | Heavy-weight pages are constantly shuffled in and out with disruptive, ugly transitions. Virtually no animation. Like dancing with an elephant. | |
Views / Controls | Auto-generated views; can actually build an app with virtually no code in the view model except for simple attributes. | Horrid, redundant, impossible-to-maintain XAML; focus on static development. Almost no actual code re-use and no way to control code bloat. | |
Editing / Input Strategy | Animated, floating placeholders for input fields. Flexible validation behaviors. Colorful cues below the field explain exactly what they must do for a proper input. All views validate as a group automatically. | Extremely tedious, verbose, old-style edit fields with clunky responses -- often through jolting modal dialogs. Extreme coding complexity. |
We Even Produced a Complete Demo App
For (a lot more detail on how we do this for you, see the Modern App Demo on GitHub. (This is not a NuGet library because it is not re-usable as a component. Just download the code and customize it as you see fit. It is 100% runnable with a few demo views.)
Yes, You Can Still Use XAML
{Sigh}
The code in this project responds to any generic type. That can be a view created in XAML or in code:
protected async Task ChangeContentView<InterfaceT, ClassT>(object viewModel)
where ClassT : View, InterfaceT
where InterfaceT : class
{
{ code omitted }
await ChangeTheContent().AndReturnToCallingContext();
// PRIVATE METHODS
async Task ChangeTheContent()
{
var newView = _diContainer.RegisterAndResolveAsInterface<ClassT, InterfaceT>();
The Modern App Demo consumes this in the Master View Presenter:
public class MasterViewPresenter :
MasterViewPresenterBase, IMasterViewPresenter
{
protected override async Task RespondToViewModelChange(object newModule)
{
if (newModule is IDashboardViewModel)
{
await ChangeContentView<IDashboardTitledFlexViewHost,
DashboardTitledFlexViewHost>(newModule).AndReturnToCallingContext();
}
else if (newModule is ISettingsViewModel)
{
await ChangeContentView<ISettingsTitledFlexViewHost,
SettingsTitledFlexViewHost>(newModule).AndReturnToCallingContext();
}
else if (newModule is IAccountsViewModel)
{
await ChangeContentView<IAccountsTitledFlexViewHost,
AccountsTitledFlexViewHost>(newModule).AndReturnToCallingContext();
}
else if (newModule is ILogInViewModel)
{
await ChangeContentView<ILogInTitledFlexViewHost,
LogInTitledFlexViewHost>(newModule).AndReturnToCallingContext();
}
else if (newModule is ICreateAccountViewModel)
{
await ChangeContentView<ICreateAccountTitledFlexViewHost,
CreateAccountTitledFlexViewHost>(newModule).AndReturnToCallingContext();
}
else if (newModule is ICreationSuccessViewModel)
{
await ChangeContentView<ICreationSuccessTitledFlexViewHost,
CreationSuccessTitledFlexViewHost>(newModule).AndReturnToCallingContext();
}
}
Simply replace any of these calls to ChangeContentView with a class and interface pointing to your XAML file.
The Path from SharedForms to Here
You can still use our original SharedForms library for your apps. This library leverages some of it, but in most ways, supercedes it due to the inclusion of the Response Tasks Library. Once you have included a NuGet reference for this project, you might not need to directly reference SharedForms again.
This Project Is Open Source; Enjoy Our Entire Public Suite
Shared Utils (MAUI Ready!)
The Smart DI Container (MAUI Ready!)
Responsive Tasks (MAUI Ready!)
PlatformIndependentShared (MAUI Ready!)
UI.XamForms
The Modern App Demo
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. 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
- Com.MarcusTS.PlatformIndependentShared (>= 2.0.5)
- Com.MarcusTS.ResponsiveTasks (>= 2.0.5)
- Com.MarcusTS.SharedUtils (>= 2.0.5)
- Com.MarcusTS.SmartDI (>= 2.0.5)
- PropertyChanged.Fody (>= 3.4.1)
- Xamarin.Essentials (>= 1.7.3)
- Xamarin.Forms (>= 5.0.0.2515)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.