Thursday, November 28, 2019

Xamarin.Forms Making Navigation object available in viewmodel

using App5.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace San.Ash.Mobile.Vic.School.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SchoolFilterSortListView : ContentPage
{
public SchoolFilterSortListView()
{
InitializeComponent();
BindingContext = new SchoolViewModel(Navigation);
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Windows.Input;
using App5.Models;
using App5.Views;
using San.Ash.Mobile.Vic.School.Models;
using Xamarin.Forms;
using System.ComponentModel;
namespace App5.ViewModels
{
public class SchoolViewModel : INotifyPropertyChanged
{
readonly IList<School> source;
School selectedSchool;
int selectionCount = 1;
public ObservableCollection<School> Schools { get; private set; }
public IList<School> EmptySchools { get; private set; }
public string SelectedSchoolMessage { get; private set; }
public ICommand FilterCommand => new Command<string>(FilterItems);
public ICommand SchoolSelectionChangedCommand => new Command(SchoolSelectionChanged);
public INavigation Navigation { get; set; }
async void SchoolSelectionChanged()
{
//SelectedSchoolMessage = $"Selection {selectionCount}: {SelectedSchool.Name}";
//OnPropertyChanged("SelectedSchoolMessage");
//selectionCount++;
//var item = args.SelectedItem as Item;
//if (item == null)
// return;
var item = new Item();
item.Id = selectionCount.ToString();
item.Text = SelectedSchool.Name;
await Navigation.PushAsync(new ItemDetailPage(new ItemDetailViewModel(item)));
// Manually deselect item.
//ItemsListView.SelectedItem = null;
}
#region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}

Guiding and learning tools for children and for everyone

One of the best and easy coding & learning tool

A place to know Geometry and Algebra at its best
A TedTalk a day, a watch it to shine it

BBC Bitsize

Youtube channels
Mathantics
Numberphile

Thursday, November 21, 2019

AI for For the Blind and Visually Impaired

I'm not sure if there is any device or product around that just replaces human eye with digital smart camera. What I mean is Smart Eye Device can do?

Wearable Smart Eye Device WSED Features:


  • Identity obstacles , identify people around while walking. 
  • Look for traffic light  any object to assist visually challenged person to move around with ease like normal eye can. Assistive and adaptive vision to make a clear mapping of path for visually challenged. 360 eye vision smart device for safety.
  •  Read image, text and recognize any people and object. Just like any eye.
Just imagine if automated car can  manoeuvre then on similar line we can think of solution to replace eye with smart eye.

This product is one step forward to achieve one of the above functions what if AI revolutionized and does wonder. 

Not sure if Microsoft HOLO lens 2.0 or vitual reality to Actual reality

Monday, November 18, 2019

My Xamarin Journey So far

Xamarin.forms

  • MVVM
  • Data Binding
  • Resource
  • MainActivity - Icon 
  • Splash Screen On load launcher
  • ResourceDictionary
  • Dynamic vs static Resource
  • Frame
  • Use of Application setting

Controls-Component


  • Listview/Collection View
  • Tab View
  • Carousal
  • Grid View
  • TabbedPage

Explore AdMob

Thursday, November 14, 2019

Xamarin Forms UI Style Guide : Grid Metro Style Tile

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Row="1" Grid.Column="0" Padding="5" Margin="5" ColumnSpacing="2" RowSpacing="2">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackLayout Grid.Row="0" Grid.Column="0" HorizontalOptions="FillAndExpand" BackgroundColor="#0071be" VerticalOptions="FillAndExpand">
<Label Text="Top Left" />
</StackLayout>
<StackLayout Grid.Row="0" Grid.Column="1" HorizontalOptions="FillAndExpand" BackgroundColor="#0071be" VerticalOptions="FillAndExpand">
<Label Text="Top Right" />
</StackLayout>
<StackLayout Grid.Row="1" Grid.Column="0" HorizontalOptions="FillAndExpand" BackgroundColor="#0071be" VerticalOptions="FillAndExpand">
<Label Text="Bottom Left" />
</StackLayout>
<StackLayout Grid.Row="1" Grid.Column="1" HorizontalOptions="FillAndExpand" BackgroundColor="#0071be" VerticalOptions="FillAndExpand">
<Label Text="Bottom Right" />
</StackLayout>
</Grid>
</Grid>