Michael Ridland has recently blogged about a nice light weight library of essential and commonly used converters, controls and utilities.
http://www.michaelridland.com/xamarin/freshessentials-for-xamarin-forms-the-must-have-nuget-for-forms/
Monday, April 18, 2016
Saturday, April 9, 2016
Simple Xamarin Forms Demo App
A Simple Xamarin Forms Sample App
Recently I presented a short Xamarin Forms introduction. It was only a short 30min taster, but I wanted to ensure I was showing something a little deeper than a simple "Hello World" App. I personally find those kind of demo's too basic and not enough to get a taste of how using a technology is going to suit real world work.
Here's the App I built for the demo:
https://github.com/Benrnz/CorporateBsGenerator
Demo points
- Solution structure of a Xamarin Forms App.
- Entry point - how does it start and choose the first Xaml page?
- Anatomy of a Xaml page.
- Xaml Basics
- Root elements, in this case a ContentPage. Other options are MasterDetailPage, TabbedPage, and NavigationPage.
- Setting Page Padding to different values for each platform.
- Layout Controls: In this case we're using a AbsoluteLayout and a StackLayout. Another common Layout is Grid.
- Labels, Styles, and basic value DataBinding.
- Using different buttons for iOS and Android. The Material Design Floating Action Button.
- Binding can be used for more than value binding. The FAB has a bound reference to the ListView.
- Code Behind
- Great to get started
- Event Handlers
- Best Practice - Code behind doesn't scale well. The MVVM pattern.
- A look at more advanced customisation for Android. A Custom Renderer to create a Floating Action Button.
- Tooling - What do we need to develop and test an App?
Sunday, April 3, 2016
Floating Action Button in Xamarin Forms
I'm loving experimenting with Xamarin Forms at the moment. So when I wanted to include a Floating Action Button (FAB) in Android versions of a Forms App, I naturally wanted to try to get this working with Forms first. I realise you can use Xamarin Native Android views in a Forms App, but I enjoy XAML and creating reusable controls.
My first port of call was James Montemagno's GitHub and blog and found his examples for a FAB.
https://github.com/jamesmontemagno/FloatingActionButton-for-Xamarin.Android
He does mention he ported this code from: https://github.com/makovkastar/FloatingActionButton
This looks perfect, but I wanted to improve the Forms example to be mostly XAML based and try to best encapsulate the events into the FAB control to minimise the amount of work the consuming developer has to do.
Here's my code so far.
https://github.com/Benrnz/XamlFloatingActionButton
Its far from perfect, but works great. Be aware however, that if your ObservableCollection has duplicate values in it, the FAB will exhibit unexpected hide/show behaviour.
Here's what I ended up with in my XAML:
My first port of call was James Montemagno's GitHub and blog and found his examples for a FAB.
https://github.com/jamesmontemagno/FloatingActionButton-for-Xamarin.Android
He does mention he ported this code from: https://github.com/makovkastar/FloatingActionButton
This looks perfect, but I wanted to improve the Forms example to be mostly XAML based and try to best encapsulate the events into the FAB control to minimise the amount of work the consuming developer has to do.
Here's my code so far.
https://github.com/Benrnz/XamlFloatingActionButton
Its far from perfect, but works great. Be aware however, that if your ObservableCollection has duplicate values in it, the FAB will exhibit unexpected hide/show behaviour.
Here's what I ended up with in my XAML:
<AbsoluteLayout VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand">
<StackLayout AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0,0,1,1">
<Label Text="FAB Test 1"
VerticalOptions="Center"
HorizontalOptions="Center" />
<ListView x:Name="MainList"
ItemsSource="{Binding MyItems}"
VerticalOptions="FillAndExpand"/>
</StackLayout>
<fabTest1:FloatingActionButtonView x:Name="Fab"
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1,1,AutoSize,AutoSize"
ImageName="ic_add.png"
ColorNormal="#ff3498db"
ColorPressed="Black"
ColorRipple="#ff3498db"
Command="{Binding FabExecuteCommand}"
ParentList="{Binding Source={x:Reference MainList}, Path=.}"/>
</AbsoluteLayout>
Microsoft announces new licencing for Xamarin!
Since Microsoft bought Xamarin and the deal was officially signed and closed about two weeks ago, Microsoft have announced their intentions to open source and make Xamarin free.
Visual Studio Community edition (the free edition) will also have access but not to all features.
This will include:
- Xamarin Studio (Mac and Windows version)
- Xamarin Platform for iOS, Android and Windows, for small teams and non-Enterprise organisations. Enterprise is defined as organisations earning more then one million US Dollars per annum.
- Check out this blog from https://blog.xamarin.com/xamarin-for-all/
Writing an App for any platform using Xamarin is now totally open source!
Check out the actual //Build 2016 announcement by Scott Guthrie:
https://www.youtube.com/watch?v=WC7ijoFzjEg
18:35
Test Cloud will continue to be a paid product with several tiers although Enterprise MSDN subscribers will get a 25% discount.
Xamarin Insights will merge with Microsoft's HockeyApp over time. Right now Insights has features that Hockey does not yet support.
Some level of Xamarin University will be included for MSDN Professional and Enterprise subscribers, although this isn't clear yet.
Check out https://store.xamarin.com/ for latest details.
Subscribe to:
Posts (Atom)