Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
110 lines (103 sloc) 6.71 KB
<?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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:xaml="clr-namespace:Prism.Navigation.Xaml;assembly=Prism.Forms"
xmlns:alertDefinitions="clr-namespace:StockAlerts.App.Views.AlertDefinitions;assembly=StockAlerts.App"
xmlns:freshEssentials="clr-namespace:FreshEssentials;assembly=FreshEssentials"
xmlns:views="clr-namespace:StockAlerts.App.Views"
mc:Ignorable="d"
x:Class="StockAlerts.App.Views.AlertDefinitions.EditAlertDefinitionPage">
<ContentPage.Resources>
<Style x:Key="SaveButtonStyle"
TargetType="{x:Type Label}">
<Setter Property="FontFamily"
Value="{StaticResource MontserratRegular}" />
<Setter Property="TextColor"
Value="{StaticResource WhiteColor}" />
<Setter Property="HorizontalOptions"
Value="Center" />
<Setter Property="VerticalOptions"
Value="Center" />
</Style>
</ContentPage.Resources>
<ContentPage.Content>
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions>
<Label Text="{Binding Title}" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Margin="10" FontSize="Large"></Label>
<!-- CREATE ALERT DEFINITION FORM -->
<Grid Grid.Row="1" Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- STOCK -->
<Label Text="Stock" FontAttributes="Bold" VerticalTextAlignment="Center"></Label>
<Grid Grid.Row="0" Grid.Column="1" HorizontalOptions="Fill">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackLayout>
<Entry Text="{Binding StockSymbol}" IsEnabled="False" >
</Entry>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer
Command="{xaml:NavigateTo 'StockSearchPage'}"
NumberOfTapsRequired="1" />
</StackLayout.GestureRecognizers>
</StackLayout>
<ImageButton Grid.Column="1" Source="search_icon.png" Command="{xaml:NavigateTo 'StockSearchPage'}" BackgroundColor="Transparent"></ImageButton>
</Grid>
<!-- ALERT NAME -->
<Label Grid.Row="1" Grid.Column="0" Text="Alert Name" FontAttributes="Bold" VerticalTextAlignment="Center"></Label>
<Entry Grid.Row="1" Grid.Column="1" Text="{Binding AlertName}" HorizontalOptions="Fill"></Entry>
<!-- CRITERIA -->
<Label Grid.Row="2" Grid.Column="0" Text="Criteria" FontAttributes="Bold" VerticalTextAlignment="Center" Margin="0,10,0,0"></Label>
<StackLayout Grid.Row="3" Grid.ColumnSpan="2">
<freshEssentials:SegmentedButtonGroup OnColor="{StaticResource DarkGrayColor}" OffColor="{StaticResource WhiteColor}"
SelectedIndex="{Binding SelectedOperatorButtonIndex, Mode=TwoWay}"
HorizontalOptions="Center" HeightRequest="30" WidthRequest="120" CornerRadius="10">
<freshEssentials:SegmentedButtonGroup.SegmentedButtons>
<freshEssentials:SegmentedButton Title="AND"></freshEssentials:SegmentedButton>
<freshEssentials:SegmentedButton Title="OR"></freshEssentials:SegmentedButton>
</freshEssentials:SegmentedButtonGroup.SegmentedButtons>
</freshEssentials:SegmentedButtonGroup>
<StackLayout BindableLayout.ItemsSource="{Binding CriteriaCollection}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<alertDefinitions:CriteriaView BindingContext="{Binding}"></alertDefinitions:CriteriaView>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>
<ImageButton Source="plus_sign.png" BackgroundColor="Transparent" HorizontalOptions="Center" Command="{Binding AddCriteriaCommand}"></ImageButton>
</StackLayout>
</Grid>
<!-- ERROR MESSAGES -->
<Label Text="{Binding ErrorMessage}" TextColor="{StaticResource ErrorColor}" Grid.Row="2" Margin="10,0,0,0">
</Label>
<!-- SAVE BUTTON -->
<Frame CornerRadius="22" WidthRequest="160" HeightRequest="44" HorizontalOptions="Center" VerticalOptions="Center" Grid.Row="3" HasShadow="True" Padding="0">
<Button CornerRadius="22" WidthRequest="160" HeightRequest="44" HorizontalOptions="Center" VerticalOptions="Center" Margin="0"
Text="Save" Command="{Binding SaveCommand}"
BackgroundColor="{StaticResource DarkGrayColor}" TextColor="{StaticResource WhiteColor}"></Button>
</Frame>
</Grid>
<!-- INDICATOR -->
<views:LoadingIndicatorView></views:LoadingIndicatorView>
</Grid>
</ContentPage.Content>
</ContentPage>
You can’t perform that action at this time.