borepin/Borepin/Borepin/Page/CreateCardPage.xaml
2023-02-27 02:42:18 +01:00

64 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.Page.CreateCardPage"
xmlns:converters="clr-namespace:Borepin.Converter"
xmlns:resource_text="clr-namespace:Borepin.Resources.Text"
xmlns:views="clr-namespace:Borepin.View"
Title="Create Card">
<NavigationPage.TitleView>
<Button Text="Refresh" HorizontalOptions="End" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}" Command="{Binding RefreshCommand}"/>
</NavigationPage.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<converters:AllTrueBoolConverter x:Key="AllTrueBoolConverter"/>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Padding="20">
<views:ConnectionStateView/>
<StackLayout>
<StackLayout.IsVisible>
<MultiBinding Converter="{StaticResource AllTrueBoolConverter}">
<Binding Path="IsBusy" Converter="{StaticResource InvertBoolConverter}"/>
<Binding Path="IsConnected" />
</MultiBinding>
</StackLayout.IsVisible>
<Label Text="NFC Reader" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Picker ItemsSource="{Binding ReaderIDs}" SelectedItem="{Binding ReaderID}"></Picker>
<Label Text="PICC Key" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Entry Grid.Column="0" Text="{Binding PICCKey}" IsSpellCheckEnabled="false"/>
<Button Grid.Column="2" Text="Scan QR-Code" Command="{Binding ScanPICCKeyCommand}" Style="{StaticResource Style_Button_Primary}" IsVisible="False"/>
</Grid>
<Label Text="Application Key" Style="{StaticResource Style_Label_Property_Title}"></Label>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Entry Grid.Column="0" Text="{Binding APPKey}" IsSpellCheckEnabled="false"/>
<Button Grid.Column="1" Text="Random" Command="{Binding RandomAPPKeyCommand}" Style="{StaticResource Style_Button_Primary}"/>
<Button Grid.Column="2" Text="Scan QR-Code" Command="{Binding ScanAPPKeyCommand}" Style="{StaticResource Style_Button_Primary}" IsVisible="False"/>
</Grid>
<StackLayout Orientation="Horizontal">
<CheckBox IsChecked="{Binding FormatCard}"/>
<Label Text="Format Card" VerticalOptions="Center"/>
</StackLayout>
<Button Text="Create Card" Command="{Binding CreateCardCommand}" Style="{StaticResource Style_Button_Primary}"/>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>