Passa ai contenuti principali

Post

Xamarin Xaml Reusable Content View, basics

Simply open Xamarin Studio and create a new "Forms ContentView Xaml", name it MyView, that is our UserControl. In the code below we use the UserControl inside a Xaml Page. Without adding any code to the UserControl the page can interact with it setting its content (the label "Hello From the page"). With this approach the page decided to replace the content of the UserControl, any view added within the UserControl by xaml in itself will be ignored. The UserControl can still be extended using it's c# code-behind. <? xml version ="1.0" encoding ="UTF-8" ? > < local:MyPageBase xmlns ="http://xamarin.com/schemas/2014/forms" xmlns:x ="http://schemas.microsoft.com/winfx/2009/xaml" x:Class ="xam0001.MyPage1" xmlns:local ="clr-namespace:xam0001" > < local:MyView > < Label Text ="Hello From the page" ></ Label > </ ...

Xamarin.Forms Reusable XAML Page Base Class

The base class is a normal XAML Page. The derived class comes from a new XAML Page, then we change: In code: public partial class MyPage1 : MyPageBase In xaml: < local:MyPageBase xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"  x:Class="xam0001.MyPage1" xmlns:local="clr-namespace:xam0001" >   </ local:MyPageBase > 

Xamarin Forms Image: where to put images in projects (root directory in WindosPhone)

We have a PCL Xamarin.Forms project with some XAML. Images are project-specific so we put the image in the starting projec (i.e. Wp and Android) We want to define image name in the XAML so we use: x:Name="myImage"  Source="NavigationLeft.png" Android takes the "NavigationLeft.png" in the Resources/Drawable WindowsPhone takes the "NavigationLeft.png" on the root of the project. So Windows phone project get messed with resource images in the root folder. Is there a way to avoid this? No, there's not: in Windows Phone  we could place the image in an "Images" forder and reference it with "Images/NavigationLeft.png" in XAML, this would work. But in Android the Resource/drawable directory is a flat diretory and does allow subdirs. For now i prefixed share image with an x "xNavigationLeft". Sources: Android drawable does not allow subdirs For Wp using Xamarin.Forms we must put images on root dir

Service Bus per Windows

Service Bus è disponibile anche per Windows Server (Non Azure)  MSDN page for Service Bus 1.1 Il video di Channel 9 (Ottobre 2013)  per la release di Service Bus per Windows 1.1. Informazioniricavate dal video: E' installabile solo su Windows Server 2008R2 SP1. Non funziona su 2008. Service Bus è l'erede di Message Queue, che comunque continua ad essere sviluppato e distribuito con Windows. A differenza di Message Queue non è distribuito come sistema operativo ma installabile successivamente. La licenza di Windows Server comprende l'installazione e l'utilizzo di Service  Bus.  Service Bus è installabile tramite WebPI sul proprio pc di sviluppo (Win7 o 8). Un ottimo tool per Service Bus e l'explorer è sviluppato per microsft da Paolo salvatori

Xamarin Walkthrough: Fragments

Alcuni appunti in itinere seguendo il tutorial  fragments walkthrough su Xamarin.Android: il tag axml per indicare il fragment è proprio "fragment" con la f minuscola, nonostante altri tag inizino con la lettera maiuscola. l'errato casing produce un errore in fase di esecuzione. Perchè per il fragment di dettaglio non viene usato un costruttore ad hoc in cui passo i parametri di inizializzazione, ma viene invece passato come argomento di un budle? Questa modalità di inizializzazione (New Instance pattern) è comune nel mondo Android. La ragione principale è che il ciclo di vita di un fragment prevede che lo stesso fragment possa essere ri-creato: in quel caso non posso usare variabili di classe, che potrebbero non essere più valorizzate, ne usare un costruttore con parametri, che viene ignorato in fase di ri-creazione. Il bundle invece viene salvato e può essere usato come cache affidabile per i parametri di creazione. Nella seconda parte del walkthrough S...

Xamarin Studio Supporto per portable Libraries

Xamarin Studio per Mac non supporta ancora perfettamente le Portable Libraries. Le portable libraries si riescono ad includere e il progetto, se non ha errori, compila correttamente. Mancano però ad ora: code completion inserimento di reference alla BCL. Aspettiamo con ansia la versione 4.02 di Xamarin Studio, prevista per maggio che forse introdurrà pieno supporto supporto alle PCL http://stackoverflow.com/questions/15104239/monodevelop-portable-library-project-references-are-not-available