I am trying to add several ApplicationResourcesto my application Xamarinthat usesMvvmCross
I currently have a file App.cs:
public class App : MvxApplication
{
public override void Initialize()
{
this.CreatableTypes()
.EndingWith("Service")
.AsInterfaces()
.RegisterAsLazySingleton();
.....etc etc..
}
}
Now I follow Working with Styles with Xaml for your application and got:
<?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:mvvmcross="clr-namespace:Cirrious.MvvmCross.ViewModels;assembly=Cirrious.MvvmCross"
x:Class="FieldStrikeMove.Core.App">
<Application.Resources>
<ResourceDictionary>
<Style x:Key="TestStyle" TargetType="Label">
<Setter Property="TextColor" Value="Green" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application >
I also added a keyword partialto my class App.cs, but that says:
Partial declarations must not indicate different base classes
So i tried
<?xml version="1.0" encoding="utf-8" ?>
<mvvmcross:MvxApplication xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mvvmcross="clr-namespace:Cirrious.MvvmCross.ViewModels;assembly=Cirrious.MvvmCross"
x:Class="FieldStrikeMove.Core.App">
<Application.Resources>
<ResourceDictionary>
<Style x:Key="TestStyle" TargetType="Label">
<Setter Property="TextColor" Value="Green" />
</Style>
</ResourceDictionary>
</Application.Resources>
</mvvmcross:MvxApplication>
but I get:
35 "FieldStrikeMove.Core.App" "TView" "Xamarin.Forms.Xaml.Extensions.LoadFromXaml(TView, System.Type)". 'FieldStrikeMove.Core.App' 'Xamarin.Forms.BindableObject'.
Xaml MvvmCross Xamarin