Releases: mysteryx93/HanumanInstitute.MvvmDialogs
v2.1
This version introduces some breaking changes.
- StrongViewLocator must now have its registrations in its constructor. See updated documentation.. This change was required because 2 separate instances are created: one for
MvvmDialogs
and one forAvalonia
defined inApp.axaml
. - Now apply picker
SuggestedStartLocation
andSuggestedFileName
. The property names and types have been modified. - Complete overhaul and simplification of
FileSystem
classes.IPathInfoFactory
andIBookmarkFileSystem
have been removed. See new documentation here.DialogStorageFile
got renamed toDesktopDialogStorageFile
andDesktopDialogStorageFactory
is available.
Other changes:
- Dialog show calls will now be ignored in design mode to avoid errors
- Updated
CrossPlatform.Browser
to run - ViewLocatorBase now calls
CreateViewInstance
virtual method instead ofActivator.CreateInstance
for easier customization.
Happy New Year!! May 2024 be the best year in a while
v2.0
Version 2.0 is ready!
What's new:
- Updated for Avalonia v11.0.0
- Changed license to MIT
- Removed AppSettings. Design was clumsy, and when it's actually needed, it doesn't work well with the modular design.
- AllowConcurrentDialogs option has been moved to the DialogManager
- Other options (in WPF) have been moved to the DialogFactory
- Avalonia.MessageBox: added an option to display message boxes as windows or popups. Option is available when configuring the DialogFactory:
new DialogFactory().AddMessageBox(MessageBoxMode.Popup)
v2.0-rc1
v2.0-rc1 is ready!
What's new:
- ViewModel event handling is now supported for ViewModels shown in DialogHost, FluentContentDialog and FluentTaskDialog
- DialogHost now supports mobile back button
- DialogHost can now display any type of content: ViewModel, Control, or direct content. Renamed ContentViewModel property to Content.
- Avalonia now targets .Net Standard 2.0
- Target Avalonia UI v2.0-rc1.1
v2.0-preview7
Version 2.0-preview7 is ready!
What's new:
- Automatically set MainWindow in Avalonia when showing the first window
DialogHost and Aura.UI Support
Added support for DialogHost.Avalonia popup views.
Added support for Aura.UI message boxes for MvvmDialogs v1.4.1 as Aura.UI does not yet support Avalonia11.
See updated documentation.
v2.0-preview6
v2.0-preview6 is ready!
What's new:
- Async close confirmation now works properly with mobile navigation
- Added an application setting: AllowConcurrentDialogs. When False (default), it will wait for the previous dialog to close before showing the next one. If you call 3 message boxes at the same time, it will show the message boxes one after the other instead of 3 on top of each other.
v2.0-preview5
V2.0-preview5 is ready!
What's new: StrongViewLocator to register ViewModel-View combinations in a strongly-typed way to avoid the use of reflection. Useful if you want to use Assembly Trimming! Works for both desktop and mobile and selects the View accordingly.
Sample ViewLocator registration:
locator = new StrongViewLocator() { ForceSinglePageNavigation = false }
.Register<MainViewModel, MainView, MainWindow>()
.Register<CurrentTimeViewModel, CurrentTimeView, CurrentTimeWindow>()
.Register<ConfirmCloseViewModel, ConfirmCloseView, ConfirmCloseWindow>();
build.RegisterLazySingleton(() => (IDialogService)new DialogService(
new DialogManager(viewLocator: locator),
viewModelFactory: x => Locator.Current.GetService(x)));
It could be done even better. This StaticViewLocatorGenerator (usage here) could be adapted to be more generic and serve for our needs. It would use a Source Generator to generate ViewModel-View mapping at compile-time using naming standards and removing the need for reflection. If someone has experience with Source Generators, contribution is welcomed!
v2.0-preview4
Preview 4 is ready with minor changes for Avalonia. What's new:
- Fixed file dialogs filters that were broken
- Removed dependency on Reactive
v2.0-preview3
v2.0-preview3 is released for Avalonia11!
It now supports 'magic' mobile navigation on Android and iOS using the exact same API, allowing to convert MVVM desktop apps into mobile with very little efforts. Mobile back navigation is also automatically supported.
Documentation has been updated.
Supporting mobile navigation required extensive internal structural changes which resulted in very little changes to the API.
I believe that these are the only minor breaking changes
- The default ViewLocator now replaces ViewModel with Window on desktop and View on mobile. If you want the old standard of only replacing with View, you can easily create your ViewLocator with a single line to replace ViewModel with View.
- File/folder dialogs now return
IDialogStorageFile
andIDialogStorageFolder
instead ofstring
. To get the same path string you had before (on desktop), simply add.LocalPath
.
Known limitations:
- Mobile views are held in a weak cache, and non-visible views should be released from memory when memory is needed. The unit test to ensure this happens does not currently pass. Contribution is welcomed to find the problem.
- Closing async cancellation does not yet work with mobile navigation
v1.4.1 Bug fixes
Version 1.4.1 is ready!
What's new:
- Renamed the new ViewLoaded/ViewClosing/ViewClosed methods to OnLoaded/OnClosing/OnClosed. Interface names remain the same.
- Fixed a crash with FluentAvalonia TaskDialog when pressing escape.
- When owner is null, it will now use the main window, or create a dummy window.