Closed schovan closed 1 year ago
The color of the title bar is not normal, and the background color of the navigation bar is wrong.
The program crashes when exiting debug for the first time
@406841895 Is this a version you made it by yourself or you downloaded it somewhere?
Not sure what you are asking?
@vb2ae me neither :-) maybe caliburn micro 5 beta? Is this https://github.com/Caliburn-Micro/Caliburn.Micro/releases/tag/5.0.19-beta%2B7e85e48931 what I should use?
yes the caliburn micro 5 beta has a maui version. would love any feedback. It is available in our myget feed
@406841895 Is this a version you made it by yourself or you downloaded it somewhere?
This app is written based on the Microsoft example, I made a mistake and now the style is fine, but I don't know how to configure the IOC container
yes the caliburn micro 5 beta has a maui version. would love any feedback. It is available in our myget feed
In the maui version, why is there no AppBootstrapper, and how do I configure the IOC container SimpleContainer
Try looking at this sample for inspiration on how to setup Caliburn micro with MAUI: MAUI Sample
I am aware of a bug the I need to get around to fixing it has to do with the viewlocator and namespace mappings. If you run into issues finding views it is because CM is trying to use Activity as a suffix instead of view.
@KasperSK Has anyone tested if dependency injection really works for MAUI? Looks like it only works for parametless constructor. Look at this file for example: https://github.com/Caliburn-Micro/Caliburn.Micro/blob/master/src/Caliburn.Micro.Platform/Platforms/Maui/Windows/CaliburnApplication.cs Or am I using a wrong version? Is there any hidden version where is it implemented? Or does depencency injection in MAUI with Caliburn require some special setup?
Edit: I made some experiments and made it working. I requires some special setup, that is not included in the example app. The setup needs to be done for every platform. I made it for Windows and Android. I don't know, how to do it for Apple and Tizen. This is for Windows, I hope it is a correct approach: https://gist.github.com/schovan/3ba38aaf210a492c2f52a74a46a4d4de
@schovan I have not made any effort to integrate with the IoC in MAUI, but there are several ways to achieve this (like in your edit).
I think we need to make a setup sample that uses IoC, as one of the more advanced features.
for android
[Application] public class MainApplication : Caliburn.Micro.Maui.CaliburnApplication { public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership) { Initialize(); }
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
protected override void Configure()
{
base.Configure();
}
protected override IEnumerable<Assembly> SelectAssemblies()
{
return new List<Assembly>() { typeof(App).Assembly };
}
protected override object GetInstance(Type service, string key)
{
return MauiProgram.builder.Services.BuildServiceProvider().GetService(service);
}
protected override IEnumerable<object> GetAllInstances(Type service)
{
return new List<object>() { MauiProgram.builder.Services.BuildServiceProvider().GetService(service) };
}
}
For Ios, and Mac Catatlyst
[Register("AppDelegate")]
public class AppDelegate : Caliburn.Micro.Maui.CaliburnApplicationDelegate
{
public AppDelegate()
{
Initialize();
}
protected override object GetInstance(Type service, string key)
{
return MauiProgram.builder.Services.BuildServiceProvider().GetService(service);
}
protected override IEnumerable<object> GetAllInstances(Type service)
{
return new List<object>() { MauiProgram.builder.Services.BuildServiceProvider().GetService(service) };
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
Hi, Caliburn.Micro was using for my enterprise app in WPF so I'm using Caliburn.Micro.Maui for migration and with the setup it's works good. But I'm trying to do the ShellView like the tutorial for WPF . However with Window it does not work and causes a bug. Window seems to work with C# code and with Xaml there is no example.
<?xml version="1.0" encoding="utf-8" ?>
<Window xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Formation.Views.ShellView"
Title="ShellView">
<!--With WPF-->
<!--<Grid>
<ContentControl x:Name="ActiveItem" Margin="20"/>
</Grid>-->
<ContentPage x:Name="ActiveItem"></ContentPage>
</Window>
Do you know how to make it work with the ShellView or maybe it's not yet implemented for MAUI. Otherwise how to change view with another page?
Closing ticket moved shellview to new issue
I started experimenting with Maui and found that other MVVM frameworks for MAUI are either unusable (haven't features that I want) or bugged. Can I somewhere download alpha / beta build for MAUI and test it? Do you plan some pre-release / when ?