Working with CarouselView in Xamarin Forms

microsoft xamarin heros c# iOS Android UWP

Xamarin.Forms code runs on multiple platforms – each of which has its own filesystem. This means that reading and writing files is most easily done using the native file APIs on each platform. Alternatively, embedded resources are a simpler solution to distribute data files with an app. CarouselView CarouselView is available in Xamarin.Forms 4.3. However, it is currently experimental and can only be used by adding the following line of code to your AppDelegate class on iOS, or to your MainActivity class on Android, before calling Forms.Init: Prerequisites Visual Studio…

Read More

Xamarin forms, UWP Windows 10 App, TitleBar and Status bar customization

microsoft xamarin heros c# iOS Android UWP

Customize the title bar of your Universal App for Windows 10 is quite easy, but you need to write different code for PC and Mobile. The class that allows you to customize the title bar: when running on a PC is called TitleBar when running on a Mobile is called StatusBar Before to call the API you first need to check if it exists (true if you are running on that platform): //PC customization if (ApiInformation.IsTypePresent( “Windows.UI.ViewManagement.ApplicationView”)) { var titleBar = ApplicationView.GetForCurrentView().TitleBar; if (titleBar != null) { titleBar.ButtonBackgroundColor = Colors.DarkBlue;…

Read More

Convert Hex Color Code to Brush/SolidColorBrush in XAML App

microsoft xamarin heros c# iOS Android UWP

To set the background color of an object in .NET XAML, you will need to set the Brush object type. To create a Brush object from a hexadecimal color code, use the following. //input ex: #dcdcdc public static Windows.UI.Xaml.Media.SolidColorBrush GetColorFromHex(string hexaColor) { return new Windows.UI.Xaml.Media.SolidColorBrush( Windows.UI.Color.FromArgb( 255, Convert.ToByte(hexaColor.Substring(1, 2), 16), Convert.ToByte(hexaColor.Substring(3, 2), 16), Convert.ToByte(hexaColor.Substring(5, 2), 16) ) ); } Happy coding!

Read More

How do I get a Unique Identifier for a Device within Windows 10 Universal?

If you google a bit about this problem, you can’t find a right solution because all people are speaking about Hardware Token. Unfortunately this functionality doesn’t exists for Universal Windows Application. There are at the moment only a way. You have to add the Extension reference “Windows Desktop Extensions for the UWP” or “Windows Mobile Extensions for the UWP“, then you can use the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Windows.Security.ExchangeActiveSyncProvisioning; using Windows.System.Profile; namespace PSC.Code { public sealed class DeviceInfo { private static…

Read More

UWA: This application can only run in the context of an AppContainer

C# .NET language

Run it from VS (with or without debugging). This will actually install unpackaged version of your app, so you will see it in the start screen. Create a package to use locally. You can do this in VS by going to Store → Create App Package → Build a package to use only locally. This will create a bunch of files, including a command-line script that will actually install the app. You probably could use this method to distribute the app, but it would work only on developer-enabled computers. Publish…

Read More

Universal Windows app samples

windows store universal windows platform

On GitHub Microsoft have published a lot of examples for Universal Apps: the link is https://github.com/Microsoft/Windows-universal-samples This repo contains the samples that demonstrate the API usage patterns for the Universal Windows Platform (UWP) in the Windows Software Development Kit (SDK) for Windows 10. These code samples were created with the Universal Windows templates available in Visual Studio, and are designed to run on desktop, mobile, and future devices that support the Universal Windows Platform. Universal Windows Platform development These samples require Visual Studio 2015 and the Windows Software Development Kit…

Read More