Building A Generic SQLite Repository

In a recent project, I found myself needing multiple, seemingly unrelated databases.  It was crazy to copy and paste the code for such basic operations as getting all the data, etc., so the obvious alternative was a generic repository, and a database with tables for each set of data.

The first step is creating the SQLite repo.  We begin by creating the class:

public class GenericSqliteRepository<T> where T : IEntity, new()

Continue reading

Posted in C#, Data, Essentials, Xamarin | Tagged , , | Leave a comment

MVVM Light and Xamarin.Forms

Laurent Bugnion is extremely well known and respected in the developer community.  He is probably most famous for the creation of MVVM Light.

Laurent works as Senior Global Azure Advocate for Microsoft after almost 10 years spent working for IdentityMine and Valorem, two leading firms in Microsoft technologies. He is one of the foremost experts for XAML and C# based development. He codes in Windows, WPF, Xamarin (iOS and Android), Unity, ASP.NET. On his free time, Laurent writes for technical publications such as MSDN Magazine, and his blog is on blog.galasoft.ch. He is a frequent speaker at conferences such as Microsoft MIX, Build, TechEd, VSLive, TechDays and many other international events. Prior to joining Microsoft, Laurent was a Microsoft Most Valuable Professional for Windows development from 2007 to 2017, a Microsoft Regional Director from 2013 and a Xamarin Most Valuable Professional from 2015. He is also 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.

 

Posted in MVVM, Xamarin, XAML | Tagged | 1 Comment

Getting a PDF from a remote host to a Xamarin.Forms Application

It is fairly easy to display a PDF file that is local to your phone.  For example, see this article from Xamarin.com.

A bit trickier is to get a PDF from a server and then to display it.  Here’s how I did it (note, this blog post offers snippets of code, rather than a complete solution… I will reduce my larger program to something manageable asap)

The first thing I did was create a model object named ReportItem. Its primary goal is to help group all the items in my list of pdf’s, but it contains the all-important URL to the pdf itself.

Next, I created a page named ShowPDFPage.  In the XAML part of this page I just have a CustomWebView:

         <local:CustomWebView Uri="foo.pdf" 
                               HorizontalOptions="FillAndExpand"
                               VerticalOptions="FillAndExpand" />

The CustomWebView was taken from an article I found on the web.

 public class CustomWebView : WebView
    {
       public static readonly BindableProperty UriProperty = BindableProperty.Create (propertyName:"Uri",
             returnType:typeof(string),
             declaringType:typeof(CustomWebView),
             defaultValue:default(string));
 
       public string Uri
       {
          get { return ( string ) GetValueUriProperty ); }
          set { SetValueUriPropertyvalue ); }
       }
    }

This performs the magic of showing the PDF file, but how do we get it?

Continue reading

Posted in Essentials, Xamarin | Tagged , | Leave a comment

New Azure Courses (Part 1 and 2)

Pleased and proud to say my first two Azure courses are now available on LinkedIn Learning (Lynda.com).

Part 1 is a general introduction to Azure for developers.

Part 2 focuses on working with Data in Azure

Posted in Azure, Video | Tagged | Leave a comment

Yet Another Podcast #176 – All Things Visual Studio Mac

Mikayla Hutchinson is a Principal Program Manager for Microsoft working on Visual Studio Mac.  We discuss the state of the IDE and what’s coming.

 

Posted in Visual Studio, Visual Studio | Tagged | Leave a comment

Yet Another Podcast #175 – John Papa

John Papa is a dedicated a father and husband, a Principal Developer Advocate with Microsoft, and an alum of the Google Developer Expert, Microsoft RD and MVP programs.

His passions are deploying and teaching modern web technologies, and enjoying everything Disney with his family. John is a co-host of the popular Adventures in Angular podcast, author of the Angular Style Guide, and many popular Pluralsight courses

 

Posted in Angular, Azure, Microsoft | Tagged | 1 Comment

Free Recorded Webinar on Xamarin.Forms

Click image or click here

 

Posted in Xamarin | Leave a comment

Yet Another Podcast #174 – Jon Galloway on Open Source

Talking with Jon Galloway, Executive Director of the .NET Foundation,  about open source.

 

 

Posted in Open Source | Tagged | 1 Comment

Live Webinar: Building Your First Mobile Application with Xamarin.Forms

Click here to go to sign-up page

Get started with mobile programming using Xamarin.Forms. Join me at our interactive webinar, Q&A and demo. I will:

  • Help you get started with Xamarin.Forms
  • Compare Xamarin.Forms with Xamarin Native
  • Demo Xamarin.Forms layouts and views

Learn how to build native mobile applications in C# with nearly 100% reuse. Bring your questions!

Posted in Webinar, Xamarin, XAML | Tagged | 16 Comments

Yet Another Podcast #173 – Jeremy Likness on Azure

Talking with Jeremy Likness about Azure. Prepare to have your mind blown!

Posted in Azure | Tagged | Leave a comment

I’m speaking At DevIntersections. Get $50 off…

Click image, or click here

Posted in Essentials | Leave a comment

Your First Mobile Application With Xamarin.Forms – a new Pluralsight Course

Pleased and proud to announce my latest Pluralsight Course…

 

 

Posted in Essentials | 2 Comments