Skip to content

Commit

Permalink
Sample App Update
Browse files Browse the repository at this point in the history
  • Loading branch information
enisn committed Apr 3, 2019
1 parent 732d35b commit 708a0c8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
36 changes: 19 additions & 17 deletions Sample.InputKit/Sample.InputKit/Views/SelectionViewPage.xaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Sample.InputKit"
xmlns:input="clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit"
xmlns:sys="clr-namespace:System;assembly=netstandard"
x:Class="Sample.InputKit.Views.SelectionViewPage"
Title="SelectionView">
<ContentPage
x:Class="Sample.InputKit.Views.SelectionViewPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:input="clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit"
xmlns:local="clr-namespace:Sample.InputKit"
xmlns:sys="clr-namespace:System;assembly=netstandard"
Title="SelectionView">
<ContentPage.BindingContext>
<local:MainViewModel/>
<local:MainViewModel />
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout Padding="25" Spacing="15">
<Picker x:Name="picker" SelectedIndexChanged="Picker_SelectedIndexChanged"/>
<Picker x:Name="picker" SelectedIndexChanged="Picker_SelectedIndexChanged" />
<Picker x:Name="labelPositionPicker" SelectedIndexChanged="LabelPositionChanged" />

<input:SelectionView x:Name="selectionView"
ColumnNumber="2"
RowSpacing="10"
ColumnSpacing="10"
LabelPosition="Before"
SelectionType="Button"
ItemDisplayBinding="{Binding Name}"
ItemsSource="{Binding MyList}" />
<input:SelectionView
x:Name="selectionView"
ColumnNumber="1"
ColumnSpacing="10"
ItemDisplayBinding="{Binding Name}"
ItemsSource="{Binding MyList}"
RowSpacing="10"
SelectionType="Button" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
14 changes: 13 additions & 1 deletion Sample.InputKit/Sample.InputKit/Views/SelectionViewPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Plugin.InputKit.Shared.Controls;
using Plugin.InputKit.Shared;
using Plugin.InputKit.Shared.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -18,11 +19,22 @@ public SelectionViewPage()
InitializeComponent();
picker.ItemsSource = Enum.GetValues(typeof(SelectionType));
picker.SelectedItem = SelectionType.Button;

labelPositionPicker.SelectedItem = LabelPosition.Before;
labelPositionPicker.ItemsSource = Enum.GetValues(typeof(LabelPosition));
}

private void Picker_SelectedIndexChanged(object sender, EventArgs e)
{
selectionView.SelectionType = (SelectionType)picker.SelectedItem;
}

private void LabelPositionChanged(object sender, EventArgs e)
{
if (sender is Picker pkr)
{
selectionView.LabelPosition = (LabelPosition)pkr.SelectedItem;
}
}
}
}

0 comments on commit 708a0c8

Please sign in to comment.