For more info… click here
Speaking at DevIntersections Spring 2018
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()
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.
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 ) GetValue( UriProperty ); }
set { SetValue( UriProperty, value ); }
}
}
This performs the magic of showing the PDF file, but how do we get it?
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
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.
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
Free Recorded Webinar on Xamarin.Forms
Yet Another Podcast #174 – Jon Galloway on Open Source
Talking with Jon Galloway, Executive Director of the .NET Foundation, about open source.
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!
Yet Another Podcast #173 – Jeremy Likness on Azure
I’m speaking At DevIntersections. Get $50 off…
Click image, or click here