﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - Crosslight - Crosslight Custom Library Projects</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-Custom-Library-Projects/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Crosslight Custom Library Projects</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-Custom-Library-Projects/</link><pubDate>Fri, 26 Sep 2014 05:04:30 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;blockquote&gt;Is it possible to use the "Resource.Layout.MyCustomLayout" layout in the Android project created by Crosslight? Which means, can I create resources in the custom library and use them in the Crosslight project?&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Open the targeted activity and override ContentLayoutId. Following snippet code shows how to do this in the sample CrosslightCustomLibrary.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;protected override int ContentLayoutId
{
    get
    {
        return MyAndroidCustomLibrary.Resource.Layout.MyCustomLayout;
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;This should help.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Crosslight Custom Library Projects</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-Custom-Library-Projects/</link><pubDate>Wed, 24 Sep 2014 17:40:54 GMT</pubDate><dc:creator>thomas.albert@tea-net.ch</dc:creator><description>&lt;p&gt;When trying on my own, I missed the "InitializeServices" step.&lt;/p&gt;&lt;p&gt;Is it possible to use the "Resource.Layout.MyCustomLayout" layout in the Android project created by Crosslight? Which means, can I create resources in the custom library and use them in the Crosslight project?&lt;/p&gt;&lt;p&gt;Does the scenario still work when I have a custom core, too?&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Thomas&lt;br&gt;&lt;/p&gt;</description></item><item><title>Crosslight Custom Library Projects</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-Custom-Library-Projects/</link><pubDate>Wed, 24 Sep 2014 04:15:09 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;blockquote&gt;...is it possible to create or do you already have any code for custom library projects?&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Yes, it is possible to create custom library project. I will start this by creating a simple project by using Crosslight &lt;strong&gt;Blank&lt;/strong&gt; project template. Next, I added an &lt;strong&gt;Android Library Project&lt;/strong&gt;, called as &lt;em&gt;MyAndroidCustomLibrary&lt;/em&gt;, to the solution.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Within MyAndroidCustomLibrary, a layout - MyCustomLayout.axml - is added. It is a very simple layout with text.&lt;br&gt;
Following references are  added into MyAndroidCustomLibrary project:&lt;/span&gt;&lt;/p&gt;
&lt;ul style="color: #1f497d;"&gt;&lt;li&gt;Intersoft.Crosslight;&lt;/li&gt;&lt;li&gt;Intersoft.Crosslight.Android;&lt;/li&gt;&lt;li&gt;assembly reference from the Core project of the solution.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;An Activity called &lt;em&gt;CustomActivity&lt;/em&gt; is added. Following snippet code shows the declaration of the CustomActivity class.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;[Activity(Label = "CustomActivity")]
[ImportBinding(typeof(CustomBindingProvider))]
public class CustomActivity : Activity&amp;lt;CustomViewModel&amp;gt;
{
    public CustomActivity()
        :base(Resource.Layout.MyCustomLayout){

    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;In the Android project of the solution, a reference from MyAndroidCustomLibrary project is added. Add following code into the &lt;strong&gt;InitializeService&lt;/strong&gt; method of AppInitializer class in the Android project in order to be able to consume the &lt;strong&gt;CustomActivity&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;public void InitializeServices(IApplicationHost appHost)
{
    IApplicationService applicationService = ServiceProvider.GetService&amp;lt;IApplicationService&amp;gt;();
            
    if (applicationService != null)
    {
        applicationService.GetContext().AddExportedType(typeof(CustomActivity));
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;CustomViewModel is added. What will this ViewModel do is quite simple, to assign &lt;em&gt;Text&lt;/em&gt; property with a string: "From Custom Activity" in the contructor.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;private string _text;

public string Text
{
    get { return _text; }
    set
    {
        if (_text != value)
        {
            _text = value;
            this.OnPropertyChanged("Text");
        }
    }
}

public CustomViewModel()
{
    this.Text = "From Custom Activity";
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I also add &lt;strong&gt;CustomBindingProvider&lt;/strong&gt; like the following snippet code.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;public CustomBindingProvider()
{
    this.AddBinding("TestText", BindableProperties.TextProperty, "Text");
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Last, I modify the &lt;strong&gt;ShowToast&lt;/strong&gt; command so that when user press Button1 it will navigate to &lt;em&gt;CustomViewModel&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Please find CrosslightCustomLibrary.zip file in the attachment for more detail information.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Crosslight Custom Library Projects</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-Custom-Library-Projects/</link><pubDate>Mon, 22 Sep 2014 18:12:19 GMT</pubDate><dc:creator>thomas.albert@tea-net.ch</dc:creator><description>&lt;p&gt;Hello Crosslight Support,&lt;/p&gt;&lt;p&gt;is it possible to create or do you already have any code for custom library projects.&lt;/p&gt;&lt;p&gt;I will explain what I mean with this:&lt;/p&gt;&lt;p&gt;When creating a couple of apps, there are pieces of code, views, resources and more stuff which one could reuse in every project. Xamarin offers a project template for "library projects". So it would be great if one could create a library project for Android and one for iOS and reuse these parts in every project created with Crosslight.&lt;/p&gt;&lt;p&gt;I tried this approach for Android. I created a Crosslight project with the project wizzard and added a library project to the solution. I added the Intersoft.Crosslight and Intersoft.Crosslight.Android references to the new library project and a reference to the Core project. Everything like in the "regular" Android project. I also referenced the custom Android project in the Crosslight Android project.&amp;nbsp;I moved some activities and some resources to the newly created library project and tried to build the solution. I encountered some problems and could not achieve what&amp;nbsp;I had in mind.&lt;/p&gt;&lt;p&gt;Is it possible to make such an approach in combination with Crosslight?&lt;/p&gt;&lt;p&gt;Does Crosslight recognize the activities belonging to a certain ViewModel when the activities are in a custom library?&lt;/p&gt;&lt;p&gt;How can I include the custom resources to the existing "Resource" class? The "Resource" class is partial and somehow you managed to include the resources from the Intersoft.Crosslight.Android assembly to the resources of the Android project created by Crosslight.&lt;/p&gt;&lt;p&gt;There may be other problems and other iOS specific problems, but I think you solved them all.&lt;/p&gt;&lt;p&gt;I hope I was able to describe my problem and I hope Crosslight will let me build custom library "extensions". If not maybe you take it as a feature request for an upcoming release.&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Thomas&lt;/p&gt;</description></item></channel></rss>