Yet Another Podcast #158 – Angular 2 Documentation with Ward Bell

Ward Bell is a Microsoft MVP, and is a Google GDE (Google Developer Expert)Water Colors - 1  and the President of IdeaBlade, makers of Breeze.  He is responsible for the Angular 2 documentation and has been deeply enmeshed in the day to day development of Angular 2 as a result.

Ward is a good friend and a kind and brilliant man.

 

 

 

Share
Posted in Angular, Essentials | Tagged | 1 Comment

Yet Another Podcast #157 – What’s New in Xamarin and A Case Study

I’m joined by Dan Hermes and David Silverlight for a quick overview of what is new in Xamarin, and then a deep dive into an application they both worked on for the FAA

Links from David Silverlight to follow.

 

 

 

 

Share
Posted in Tools and Utilities, Xamarin | Tagged | Leave a comment

Effects with XAML

In this excellent article, Nish Anil describes how to modify controls using Effects – a lighter weight approach than creating custom renderers.  His examples, however, are all in C#, so I decided to translate them into XAML. red slider

To begin I created a new Xamarin.Forms project named xamlEffects.  There are two parts to creating the effect.  The first is platform dependent.  Optionally, create a folder in the iOS project named Platform.  In that folder, add a file named RedSliderEffect.cs.  You’ll also create files named BlueSliderEffect and GreenSliderEffect.

 Continue reading 
Share
Posted in Essentials, Xamarin, XAML | Leave a comment

Yet Another Podcast #156 – MVVM Light with Laurent Bugnion

 

Laurent works as Senior Director for IdentityMine, one of the leading companies (and mvvmlightGold Partner) for Microsoft technologies such as Windows Presentation Foundation, Xamarin, Windows Store, Windows Phone, XBOX and generally User Experience. He is based in Zurich Switzerland.

Laurent writes for MSDN magazine and other publications, codes in Windows, WPF, Xamarin (iOS and Android), ASP.NET and his blog is on blog.galasoft.ch. He is a frequent speaker at conferences such as Microsoft MIX, TechEd, VSLive, TechDays and many other international events. 2016 is his 10th year as aMicrosoft Most Valuable Professional (Windows Application Development), his third year as a Microsoft Regional Director and his second year as a Xamarin Most Valuable Professional. He is the author of the well-known open source framework MVVM Light for Windows, WPF, Xamarin, and of the popular Pluralsight reference course about MVVM Light.

 

 

 

 

 

Share
Posted in MVVM, Xamarin | Tagged | 1 Comment

C# 6 From Scratch Released On Pluralsight

C# 6 From Scratch

Share
Posted in Essentials | Leave a comment

Xamarin.Forms: Creating a sliding drawer with behaviors, messages and MVVM Light

Sliding Drawers have become a popular, almost required form of navigation in phone applications.  There are libraries that will do this for you, but you can use Xamarin.Forms to create what you want without too much effort.  Okay, with quite a bit of effort, but it is like following a recipe.  Ok, a complicated recipe.  So fasten your seatbelts…

How the Pieces Fit Together Sliding Drawers

We’re going to have two kinds of pages:

  • Normal content pages
  • Master and Detail pages

We begin, as usual by creating our MVVM folders, and one more for Behaviors.  Let’s create four pages that we’ll navigate among.  We can just name them Page 1, Page 2, Page 3 and Page 4, though in a real application you’ll no doubt give them more meaningful names.

Now it’s time to create the navigation, based on your Master/Details pages.  For this we need to declare two pages:

  • Our Root page: type MasterDetailPage
  • Our Drawer page: type Content Page

These two work together to have the drawer page slide over the current page and offer navigation as shown above.

Continue reading

Share
Posted in Essentials | 1 Comment

Yet Another Podcast 155 – Humanitarian Toolbox with Bill Wagner

Bill Wagner is a Microsoft Senior Content Developer creating documents and learning htboxmaterials for developers learning the .net platform.  He is also the president and on the board of directors of the Humanitarian Toolbox.

Bill spoke with me about what the Humanitarian Toolbox is, and how developers can get involved in this tremendously important work.

 

 

Share
Posted in Community, Essentials, Open Source | Tagged | Leave a comment

Navigate and then send data back with Xamarin.Forms and MVVM Light

…By Jesse Liberty & Eric Grover

The Challenge : Fetch

Navigate to a second page, present an Editor (multi-linefetch entry) and then send the data back to the original page (and navigate back at the same time).

Behaviors, Commands and Messages, Oh my!

Behaviors will let us turn events into commands, commands will let us handle events in the view model, and messages will let us communicate from a ViewModel to another ViewModel or to a page.

We’ll combine all this with the power of MVVM Light.

Continue reading

Share
Posted in Xamarin, XAML | Leave a comment

View Model Page Navigation with MVVM Light

When you move from code behind to a View Model (as you should, if only to makeBlank freeway sign ready for your custom text testing easier) certain challenges arise, such as: how do I navigate to another page?

Fortunately, MVVM Light provides a Messaging bus, that makes it easy to send messages from a View Model to a page (or to another View Model).  This can be over done but when used judiciously it makes the very difficult into the very easy.

The following solution was improved enormously by Eric Grover, my favorite MVVM Light Guru after Laurent 🙂

Begin by creating a parent for ContentPage (I called mine BaseViewPage).  Have your content pages derive from the new page.  In the new page we’ll register to receive Navigation Messages from the Messenger Bus

 

public BaseViewPage( )
  {
 
      Messenger.Default.Register<INavigationMessage>(
          this,
          HandleNavigation );
 
  }

Notice we need an interface, INavigationMessage and a method, HandleNavigation.

INavigationManager looks like this:

 

public interface INavigationMessage
  {
      Type PageType { get;  }
  }

This allows us to navigate to any type of page.  Its implementation is:

public class NavigationMessage<T> : INavigationMessage where T : Page
{
    public Type PageType
    {
        get { return typeof(T); }
    }
 
}

This nicely forces the type to be a Page.

Here’s HandleNavigation, which also goes in the BaseViewPage:

 

public async void HandleNavigation( 
    INavigationMessage navigationMessage )
   {
 
       var target = Activator.CreateInstance(
               navigationMessage.PageType);
 
       await Navigation.PushAsync( (ContentPage) target );
   }

Nicely generic, which is just what we want.

Now we’re ready to use this.  Let’s say we’re in MyPageViewModel and we want to navigate to YourPage (xaml).  We write:

 

var message = new NavigationMessage<YourPage>();
Messenger.Default.Send( message );

Slick, eh?

Share
Posted in Xamarin | 1 Comment

Yet Another Podcast #154 – Dan Wahlin on Typescript and Angular 2

Dan Wahlin founded Wahlin Consulting which provides consulting and training IMG_0510services on Web technologies.

He has also published over 10 developer courses on Pluralsight.com and Udemy.com including the new Docker for Web Developers course. Dan is a Docker Captain, Google GDE, Microsoft MVP and Regional Director and speaks at conferences and user groups around the world.

Dan has written several books on Web technologies, hundreds of technical articles and blog posts and runs the Web Weekly newsletter – a great way to stay up on the latest technologies. Follow Dan on Twitter @DanWahlin.

 

 


Share
Posted in Agile, Essentials, TypeScript | Tagged | 3 Comments

TypeScript and Angular 2

AngularAfter attending ng-conf a couple weeks ago, and taking a terrific workshop with John Papa and Dan Wahlin, and spending time talking with them and with Ward Bell (who is responsible for the Angular 2 documentation), I’ve decided to go all-in with Angular 2 for my Web work.

Angular 2 is written in and all the samples and documentation are written in TypeScript.  Thus, TypeScript is my next language of choice.  This should be pretty straight forward, as the hard part is OOP, which we C# programmers are already comfortable with.

I’ll try to document my travels through these technologies as I go.  Truth is that I’m fully employed with Xamarin work, so this will come in fits and starts, but I’ll do what I can to keep up a cadence.

Looking forward to it.

Photos from ng-conf

Share
Posted in Angular, TypeScript | Leave a comment

Global Resources in Xamarin.Forms

First, when I checked Google, all I could find was articles saying this can’t be done.  Humbug.  Thanks to Roger Peters and jFarrell I got it done (well, they did and then I did, but now you will).

Here are the steps (and they are pretty easy)

  • Create a normal XAML file named App.xaml.
  • This will automatically create a file named App.xaml.cs
  • Copy from App.cs to App.xaml.cs and delete App.cs
  • In App.xaml set the ContentPage to be an Application and create a resource dictionary
<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="eSiteMoble.App">
 
 
  <Application.Resources>
    <ResourceDictionary>
  • Add the keyword Partial before class in App.xaml.cs
  • Add InitializeComponent to the constructor (this is critical)

Hey! Presto! your resources are available to any page…

<Label Text="Remember Me?"
             TextColor="{StaticResource TextForegroundColor}"

Easy as cake. Piece of Pie.

Share
Posted in Xamarin | 1 Comment