Closed asWorks closed 4 years ago
I'd recommend looking at the features examples as they're using more modern versions.
Thank you for your quick response - this is very much appreciated. I looked into the features examples but just find a Features.Forms part which seems to represent Xamarin.Forms. In this I find a FormsApp.cs file. It again shows me that the App class is inherited from FormsApplication witout a partial modifier which is exactly what the setup samples show me and which again brings me the error :
"Missing partial modifier on declaration of type 'App'; another partial declaration of this type exists TestCM" or, if I add the partial modifier : "Partial declarations of 'App' must not specify different base classes"
Is is genrally right the Camliburn.Micro for Xamarin.Forms Version 4.X is initialized in the App file codebehind and not in a Bootstrrapper class as shown in the setup examples and in the features examples?
And if - how do I solve this error.
I am really stuck and confused and not even sure if Caliburn.Micro supports Xamarin.Forms at all and is keeping pace with the currently quick develpment of Xamarin.Forms.
If you need any more specific information about my problem please let me know.
Thank you very much for your efforts.
asWorks
It sounds like there's some code being generated somewhere that has a partial and an inherited class somewhere.
Hello Nigel, thank you again for your response. Well as far as I know every Xamarin.Forms App uses a Page called App.xaml which has a partial Codebehind class call App.cls that inherits from Application. Searching the documentation for caliburn.micro I found that I should let the App.cls inherit from a Caliburn.Micro Class which then brings me the afore mentioned error.
And I cannot find any documentation that tells me how to set up Xamarin.Forms with Caliburn.Micro and I don´t seem to be able to get any answer to that question.
I really appreciate your work for this great framework and I understand that documentation is the least satisfying part of this work.
It is really a pity though because in this state it makes it impossible for a beginner to make any use of it - even to set it up seems to be impossible.
So it seems I will have to look for another framework which I really regret because I used CM with WPF and I really liked it.
Kind regards
A. Stoever
Ah, it looks like the templates have moved on in XF since I last built them (its been a few years).
If you update App.xaml
root node to FormsApplication it'll change the generated codes inherited model.
Hmm, sorry to have to say - I don´t understand what you mean. Could you be a little more specific? Where shall I update the root node of App.Xaml? Please understand that I am a newbie.
When you have a xaml file the root node defines the class it inherits from. So the following xaml means the the generated code ends up in public partial class App : Application
.
<Application>
Changing this to <cm:FormsApplication>
lets you tweak it to public partial class App : FormsApplication
which means your non generated code only has to be public partial class App
.
If you look at the UWP code you can see it doing it there.
Thank you very much for your patience. 🥇 This finally did the trick and I have it up and running. 👍
Kind regards
A. Stoever
Closing it because the problem is solved - thanks a lot again.
Hello, I am trying to use Calibur.Micro with Xamarin.Forms. After searching the documentation, Stack Overflow and Google/Youtube I can´t find any newer samples.
I follow the steps written down in the samples/Setup part of this repo.
I fail after trying to inherit app.xaml.cs from 'FormsApplication' - getting either the error: "Missing partial modifier on declaration of type 'App'; another partial declaration of this type exists TestCM" or, if I add the partial modifier : "Partial declarations of 'App' must not specify different base classes"
Below you can find the code from a new Xamarin Forms project in Visual Studio 2019 with latest Updates and the list of errors that I cannot solve. Is the latest version of Xamarin Forms supposed to work with Caliburn .Micro or should I use a different Framework? I worked with WPF and CM for a long time and really liked it.
Thank you very much for your efforts and every help would be greatly appreciated. Maybe you could have a look at my problem or point me to a newer documantation that I was not able to find yet.
using Xamarin.Forms; using Xamarin.Forms.Xaml; using TestCM.Services; using TestCM.Views;
using Caliburn.Micro.Xamarin.Forms; using Caliburn.Micro; using TestCM.ViewModels;
namespace TestCM { public partial class App : FormsApplication { private readonly SimpleContainer container;
}
<?xml version="1.0" encoding="utf-8" ?> <Application xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="TestCM.App">