Catel.Examples | Examples for Catel in WPF , Silverlight , Windows Phone
kandi X-RAY | Catel.Examples Summary
kandi X-RAY | Catel.Examples Summary
Examples for Catel in WPF, Silverlight, Windows Phone and WinRT.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Catel.Examples
Catel.Examples Key Features
Catel.Examples Examples and Code Snippets
Community Discussions
Trending Discussions on Catel.Examples
QUESTION
I can't get Xamarin.Forms and Catel work together.
I saw this sample but it seems it's out of date.
When I download Catel via NuGet, i get different issues for different versions:
v5.1:
Compile-time exception:
Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Obsolete, Version=4.2.4.0, Culture=neutral, PublicKeyToken=1ca091877d12ca03'. Perhaps it doesn't exist in the Mono for Android profile?
v5.0:
Runtime exception (when creating
new App();
):Could not load signature of Catel.MVVM.IViewModelFactory:CreateViewModel due to: Could not resolve type with token 01000061 (from typeref, class/assembly System.ComponentModel.IDataErrorInfo, Catel.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null) assembly:Catel.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null type:System.ComponentModel.IDataErrorInfo member:
v4.5.*
Using
ViewModelBase
:Runtime exception when creating Application object: System.TypeLoadException: Could not resolve type with token 01000097 (from typeref, class/assembly System.Reflection.BindingFlags, Catel.Core, Version=4.5.4.0, Culture=neutral, PublicKeyToken=null)
My implementation of
IViewModel
:Ok, MainPage loading, binding works, Constructor gets right services via parameters, but, for example, when I call '_uiVisualizerService.Show( subPageViewModel );' from command, it throws 'InvalidCastException'. Last line in Catel log before exception:
Injecting properties into type 'SubPage' after construction
. But SubPage and SubPageViewModel are absolutely empty.Details:
---> System.InvalidCastException: Specified cast is not valid. at Catel.Services.UIVisualizerService+d__9.MoveNext () [0x00096] in C:\CI_WS\Ws\97969\Source\Catel\src\Catel.MVVM\Catel.MVVM.Xamarin.Forms\Services\UIVisualizerService.cs:151 at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <183b200ee49746d48fc781625979428e>:0 at System.Threading.Tasks.Task'1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x0002b] in <183b200ee49746d48fc781625979428e>:0 at System.Threading.Tasks.Task'1[TResult].get_Result () [0x0000f] in <183b200ee49746d48fc781625979428e>:0 at Catel.Services.UIVisualizerService.Show (Catel.MVVM.IViewModel viewModel, System.EventHandler``1[TEventArgs] completedProc) [0x00000] in C:\CI_WS\Ws\97969\Source\Catel\src\Catel.MVVM\Catel.MVVM.Xamarin.Forms\Services\UIVisualizerService.cs:125 at XamarinFormsCatel.ViewModels.MainPageViewModel.OnGo () [0x00015] in C:\!Work\Test\XamarinFormsCatel\XamarinFormsCatel\XamarinFormsCatel\XamarinFormsCatel\ViewModels\MainPageViewModel.cs:34 at Xamarin.Forms.Command+<>c__DisplayClass3_0.<.ctor>b__0 (System.Object o) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Command.cs:73 at Xamarin.Forms.Command.Execute (System.Object parameter) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Command.cs:107 at Xamarin.Forms.Button.Xamarin.Forms.IButtonController.SendClicked () [0x0000a] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Button.cs:121 at Xamarin.Forms.Platform.Android.AppCompat.ButtonRenderer+ButtonClickListener.OnClick (Android.Views.View v) [0x0000b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\ButtonRenderer.cs:298 at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v) [0x0000f] in <71828dd8fb5f4508815e23d6996c45c2>:0 at (wrapper dynamic-method) System.Object:4c9f6786-8ab0-4bd8-bdb1-4cc7a3d7ddc7 (intptr,intptr,intptr) -> (Inner Exception #0) System.InvalidCastException: Specified cast is not valid. at Catel.Services.UIVisualizerService+d__9.MoveNext () [0x00096] in C:\CI_WS\Ws\97969\Source\Catel\src\Catel.MVVM\Catel.MVVM.Xamarin.Forms\Services\UIVisualizerService.cs:151 <---
What i do:
Change defalt
Catel.MVVM.dll
reference inandroid
project fromMonoAndroid
toportable-net45+wp8+win8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10
. if this is not done, compilation will fail.MainPage.xaml
MainPageViewModel.cs
public class MainPageViewModel : ViewModelBase { }
App.cs
public class App : Catel.Xamarin.Forms.Application { }
MainActivity.cs (Android)
...
ANSWER
Answered 2017-Aug-29 at 08:59The team is working on improved support for Xamarin.Forms. At the moment there are no examples. The expectation is to finalize v5 support for Xamarin.Forms on this over the next few months.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Catel.Examples
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page