Tagged: XAML

Ocean Validation for Xamarin Forms

Introduction

This blog post is about an example Xamarin Forms project I wrote to show using Prism, Unity, and Ocean Validation in several scenarios.

I decided to make this a video blog post and have six videos for you.

You learn the following:

  • Using the sample Xamarin Forms app and understanding the line of business scenarios it covers.
  • Using Prism and Unity in a real-world Xamarin Forms App
  • Dependency injection in a real-world Xamarin Forms App
  • Abstracting Static services and Static Device information behind interfaces to promote testing and maintainable code
  • Using Prism NavigationService and PageDialogService
  • Async Await contrasted with the Promise pattern in a Xamarin Forms App
  • Ocean validation framework with Xamarin Forms
  • Using IDataErrorInfo to surface validation errors for properties or the entire object.  (Yes, IDataErrorInfo!)  This also works for UWP.  These two platform’s binding pipeline lack data validation.  No worries, it’s very easy to do now.
  • Using Ocean validation to validate an object in multiple states.  Multiple validation states imply that the object is going through a workflow, where an object can be valid for a certain state, but not valid for other states.  This is a common scenario in complex business applications like insurance claims or when an object is completed over several Xamarin Forms pages.
  • At the end of November 2016, the Xamarin Forms ListView view began to have some problems that cost me over a day.  In the last video, I explain the issues and what I did to get around them.  I also wrote up bugs and communicated with Microsoft about these issues.

Introduction to Ocean for Xamarin Forms

Prism and Dependency Injection in Ocean for Xamarin Forms

Async Await and Promise Pattern in Ocean for Xamarin Forms

Introduction to Ocean Validation Framework for Xamarin Forms

Ocean Multi-Object State Validation for Xamarin Forms

Xamarin Forms ListView Troubles (as of 1 Dec 2016)

Source Code

https://github.com/Oceanware/OceanForXamarinForms

Close

I hope these videos have helped with your understanding of Prism, Unity, and Ocean in Xamarin Forms.

Have a great day,

Just a grain of sand on the world’s beaches

Updated Xamarin Forms BindablePicker

Introduction

On 9/30/2016 I updated the Xamarin Forms Bindable Picker, correcting it to handle the view model clearing the Items ObservableCollection.

When the view model exposes an ObservableCollection as the BindablePickers ItemsSource and the view model clears that collection, the BindablePicker now responds correctly and updates the UI as expected by:

  • Removing all items in its collection
  • Setting SelectedItem to null
  • Setting SelectedValue to null
  • Setting SelectedIndex to -1

Much appreciate the feedback and bug reports I’ve received to make this control much better.

Close

Have a great day,

Just a grain of sand on the world’s beaches

XAML Designer Brush Editor Fixed

Introduction

Since the release of Visual Studio 2015 Update 3, the VS XAML Designer pop up brush editor quit working in the Properties window when properties were sorted by name, or when properties of type brush were not in the Brush category.  This issue affected both Visual Studio and Blend for Visual Studio 2015.

Fix

Microsoft posted the fix in this cumulative servicing update:

Microsoft Visual Studio 2015 Update 3 (KB3165756)  

https://msdn.microsoft.com/en-us/library/mt752379.aspx

I have installed the update and tested various controls and use cases and can confirm the fix corrected the problem.

Close

Have a great day.

Just a grain of sand on the worlds beaches.

 

XAML IntelliSense Presenter for Visual Studio 2015

The XAML IntelliSense Presenter for the Visual Studio 2015 XAML Editor provides many high-octane features that make accessing, filtering, and consuming the IntelliSense information list much easier.  This makes the XAML developer more productive when editing XAML.

Features

  • Pascal case lookup
  • Optional narrowing list filter
  • Filtering based on item type
  • xmlns IntelliSense options
    • Show/hide only solution assemblies
    • Show/hide schemas
  • Filter settings persist for the current Visual Studio session

Pascal Case Lookup

Pascal case lookup is always enabled regardless of the narrowing filter option. When all of your text is upper case, this feature kicks in to quickly locate the item you are looking for. Note, this feature requires at least two upper case characters be entered before kicking in.

The below images demonstrates the Pascal case lookup.

NarrowingEnabled

PascalLookupOne

Narrowing List Filter

When the narrowing list filter is enabled, it provides two features.

  • Narrows the list of displayed items by only including items that contain your text
  • List item selection priority
    • Selects the first match that starts with your text
    • Selects the first entry that contains your text

Narrowing Filter Enabled

NarrowingFilterEnabled

Narrowing Filter Disabled (click filter icon to toggle enable/disabled)

NarrowingDisabled

List Item Type Filter

This was my original driving force behind writing this extension. I found myself frustrated when a type in XAML had 2 properties, 4 events and 75 namespaces listed in the IntelliSense listing.

Standard list of items, notice the multitude of namespaces that are listed.

UnfilteredNamespaces

Toggle the namespaces Toolbar button by clicking it and they are filtered for you.

NamespacesFiltered

The other Toolbar filter buttons work the same providing you the ability to filter properties and events.

xmlns IntelliSense

This feature was another reason I wrote this extension.  Normally you have to sift through many http://schemas…, this extension provides filtering to exclude them from the listing.

The below image demonstrates the two filter buttons in the xamls IntelliSense presenter. Notice how the listing is clean and relevant.

  • Show only solution assemblies is enabled.
  • Remove schema entries is enabled.

xmlnsfilter

You can also use Pascal case searching.

xmlnsPascalCasing

Download from Visual Studio Gallery

https://visualstudiogallery.msdn.microsoft.com/3f9797d7-8120-4a2e-9d0b-a3c2cc99639f

GitHub

https://github.com/Oceanware/XAMLIntelliSensePresenter2015

 Close

Hope this helps someone and have a great day

Just a grain of sand on the worlds beaches.