Pages

Showing posts with label NuGet. Show all posts
Showing posts with label NuGet. Show all posts

Saturday, 24 August 2013

Helper class to print the text box content in Windows Store App

Introduction

Microsoft's documentation & sample for printing is too much complex. The sample app for printing shows only how to print RichTextBlock. There's no tutorial to print the TextBox content in Windows Store app. Moreover to print single line of string, one has to write too much code rather than maximum 10 lines in WinForm. So this helper class provides simplest method to print the text box content. It has only one static method. It prints the text box content with its formatting. It's majorly based on MSDN print sample.

I got idea to write a library from the following Stack Overflow questions.

How to print the contents of a TextBox ?

How do you print contents of a RichTextBox ?

How do I print a TextFile OR contents of a TextBox in Metro apps ?

How to use it ?

You have to call just one static method ShowPrintUIAsync of class Printer, it will do print job on your behalf.

await Printer.ShowPrintUIAsync(PrintPreview, MyTextBox, Guid.NewGuid().ToString());

  • PrintPreview is a canvas, which is mandatory to show print preview in device charm. You have to declare in your XAML. 
  • MyTextBox is a text box object, whose text content is going to be printed. 
  • Guid.NewGuid().ToString() is a file name for printing the document. (It will be applied if you are creating PDF or XPS file via printing.)
To install WinRT.TextboxPrintHelper as NuGet package, run the following command in the Package Manager Console.

PM> Install-Package WinRT.TextboxPrintHelper

I would be glad to have issues or suggestions from you, so I can improve this. If you want to fork the repository or post issues, find this helper class on GitHub.

Monday, 15 October 2012

Interacting with Windows 8 Maps app using WindowsMapsHelper library


Windows 8 is shipped with preinstalled Maps application. This app provides all basic mapping features such us showing current location, searching for place or local business and calculating driving directions. Even better, Maps app implements bingmaps protocol to allow 3rd party applications to activate these features. There is just one disadvantage of the protocol: it’s basically a URL string and all numerous parameters need to be properly formatted.

WindowsMapsHelper library aims to simplify communications with Maps app. It encapsulates maps protocol into a few strongly typed classes.

Read More
Source code at GitHub
NuGet Package Here

Saturday, 6 October 2012

AgFx.WinRT 1.0.0-experimental

AgFx is a data caching framework that makes it easy to build data-connected Windows Phone applications.

To install AgFx.WinRT, run the following command in the Package Manager Console

PM> Install-Package AgFx.WinRT -Pre




Check On NuGet Gallary

Friday, 14 September 2012

Adding and Editing WinRT Behaviors with Blend

I am a huuuuuuge fan of Behaviors (and Actions and Triggers) for Silverlight and WPF. I have been very disappointed when WinRT turned out not to support them.

Luckily, Joost Von Schalk created WinRTBehaviors on CodePlex (also available on NuGet). But his solution still lacks any Blend support. I have not been able to reproduce the full Blend behavior editing experience, but I managed to take the first baby-step that at least saves you from creating Behaviors from code.

Read More

Monday, 3 September 2012

Transhipment - A WinRT library for structured data sharing

WinRT library for structured data sharing (via Share Contract) using Schema.org data formats.

How To Install Via NuGet

PM> Install-Package Transhipment
Usage In C#


void DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
    var request = args.Request;

    var geo = SchemaFactory.Create(Schema.GeoCoordinates) as IGeoCoordinates;
    geo.Name = "Polar Bear Provincial Park";
    geo.Latitude = "54.596931";
    geo.Longitude = "-83.283978";

    request.Data.Properties.Title = "Sample data";
    request.Data.Properties.Description = "data for " + geo.Type;
    request.Data.SetStructuredData(geo);
}

Check it in GitHub

Tuesday, 28 August 2012

Caliburn.Micro MVVM Framework

Caliburn.Micro MVVM FrameworkCaliburn.Micro is a small, yet powerful framework, designed for building applications across all Xaml Platforms. With strong support for MVVM and other proven UI patterns, Caliburn.Micro will enable you to build your solution quickly, without the need to sacrifice code quality or testability.

Download from here and it's also available at NuGet


JulMar MVVM Helpers + Behaviors For Windows 8 RTM

The MVVM Helper + Behavior library is a set of classes for developers to help them build Model-View-ViewModel oriented applications. It includes some useful classes, a base framework for MVVM and a bunch of Blend behaviors, triggers and actions.

There are several examples available at http://www.julmar.com/blog/mark where I've been blogging on how to use this library. I'll push some of that information up here as well.

You can install MVVMHelpers through NuGet http://www.nuget.org - just search for MVVMHelpers, it will add the latest version into your project automatically from within Visual Studio if you install the NuGet plug-in.

Alternatively, you can type the following into the Package Manager console to add it to your project:

PM> Install-Package Install-Package MVVMHelpers.Metro

Download DLL from here
Source code for MVVMHelpers for Windows 8 Metro

Friday, 24 August 2012

Q42.WinRT - Useful library for data driven Windows 8 C# / XAML WinRT projects


Q42.WinRT is an open source library for Windows 8 C#/XAML applications. This library is focused on web connected and data driven applications. It includes helpers to easily cache data from API calls and cache web images to the local storage. There`s also a DataLoader included which functions as a wrapper around a Task method. You can bind a ProgressBar or ProgressRing to the DataLoader and show it as long as the task is running. With this library comes a fully functional sample application that shows off most of the functionality. There`s also a unit test project included. It include controls, converters & helpers.

Please checkout the included sample application at GitHub or download directly from NuGet 

Thursday, 23 August 2012

Getting started with SQLite in Windows Store / WinRT apps


Getting started with SQLite in Windows Store / WinRT apps
In this blog post I will expand the blog post by Tim Heuer  to include information on how to include and access a pre-populated SQLite database file, maybe even a file created by migrating from a SQL Server Compact database file.

First, download the "SQLite for Windows Runtime" Extension via Tools/Extensions and Updates/Online. Restart Visual Studio.

Then add references to the SQLite and C++ extensions as described by Tim Heuer. Remember to change the Build Configuration to either x64 or x86 in Configuration Manager.

Now add the sqlite-net nuget package to the project, from the References node, select "Manage NuGet Packages" and search online for "sqlite-net"

Read full article here

Wednesday, 15 August 2012

Visual Studio 2012 RTW (Release To Web)

Visual Studio 2012 is now released to the web. Please visit Jason Zander’s Blog for detailed announcement. This page lists what’s new in ASP.NET 4.5 and Visual Studio for Web.
We are updating the Visual Studio 2010 publish experience as well to align with the features available in Visual Studio 2012 RTW. The bits are inside Windows Azure SDK for .NET which can be downloaded in https://www.windowsazure.com/en-us/develop/net/.
Also, we are releasing the following at the same time:
  • ASP.NET MVC 4 for Visual Studio 2010 SP1 and Visual Web Developer 2010 SP1
  • ASP.NET Web API OData preview on NuGet
  • ASP.NET Web API Help Page preview on NuGet
  • ASP.NET Web API Tracing preview on NuGet
Read full article here

Tuesday, 14 August 2012

TwitterRt - Tweet from C#/XAML Windows Metro Apps


TwitterRt - Tweet from C#/XAML Windows Metro AppsMy goal is to make tweeting from a C# Metro application as easy as possible. To that end, I created a library called TwitterRt.

Other posts in this series:
Install TwitterRt from NuGet.org and add to your existing Metro application:


  1. Install the NuGet Package Manager if you have not already.
  2. Open your Metro application in Visual Studio.
  3. Select Manage NuGet Packages from the Project menu.
  4. Click Online. Search for TwitterRt. Click Install.



Latest TwitterRt source resides here

TwitterRt - Tweet from Windows Metro Apps - MSDN Sample

Monday, 6 August 2012

MetroGridHelper for WinRT v1.1–Enhanced to work with Snapped and Portrait mode

MetroGridHelper v1.0

Because the left-margin is different for Snapped and Portrait mode, the previous version of MetroGridHelper for WinRT was not optimal. It didn’t support a different left margins at all. Don’t be sad, v1.1 supports Filled (120px), Snapped(20px), Fullscreen Landscape(100px) and Fullscreen Portrait(100px).

You can find the updated version on NuGet.

If you’re new to the MetroGridHelper for winrt you can execute the below command in the NuGet Package Manager Console:

PM> Install-Package WinRT.MetroGridHelper

If you have already installed the previous version you can also do the Update-Package command via the Package Manager Console:

PM> Update-Package WinRT.MetroGridHelper

For source code click here

Thursday, 26 July 2012

MetroGridHelper for WinRT, a helper to get the alignment right

It’s already more than a year ago that Jeff Wilcox wrote the MetroGridHelper for Windows Phone. I’ve been using it a lot since then. But we now have the option to build WinRT applications, sadly without the MetroGridHelper.

Wait no more, I ported the code from Jeff and also modified it to fit the metro guidelines that exist for WinRT applications. I’ve had some help from Martin Tirion and Matthijs Hoekstra, both working as Evangelist for Microsoft in The Netherlands.

The result is something that helps me during the design of the Windows 8, WinRT, apps.

MetroGridHelper for WinRT, a helper to get the alignment right

 
You can simply install the NuGet Package. Through the console like this:

PM> Install-Package WinRT.MetroGridHelper

Read full article here

Monday, 16 July 2012

Introducing Windows.UI.Interactivity: Behaviors for the Windows Runtime

In the Windows Runtime and Blend for Visual Studio 2012 there are no behaviors. This brings lots of problems when you are using the MVVM pattern or you come from the Windows Phone or Silverlight platform. Windows.UI.Interactivity tries to fill this gap by porting the whole System.Windows.Interactivity assembly, where the behaviors live in the Blend SDK, to the Windows Runtime. The project builts on work done by Windows Phone MVP Joost van Schaik a.k.a. LocalJoost and Silverlight MVP Andrea Boschin.

Read Full article here

a NuGet package for Windows.UI.Interactivity is now available here.

Thursday, 21 June 2012

MEF for Windows 8 Metro and TPL Data Flow Moved to NuGet

Microsoft has decided to remove MEF for Windows 8 Metro and TPL Data Flow from the .NET 4.5 framework release. Instead they will be offered as NuGet packages so that improvements can be released outside of the full .NET release cycle.

This decision continues an overall trend within Microsoft’s Developer Division to move away from large development cycles. A good example of this is ASP.NET MVC. Since 2009 it has had three major releases and is on the verge of a fourth. By comparison ASP.NET WebForms has only had one release. Though the next version of WebForms contains numerous enhancements that should have been released at the same time MVC got them, Microsoft is waiting until all of Visual Studio 2012 and .NET 4.5 is ready.

A more complicated example is Entity Framework. The core of the product is still tied to .NET’s release cycle. However, many of the important features such as “Code First” are being released out-of-band via NuGet.

Read full article here
Web Informer Button