<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:dxdf="clr-namespace:DevExpress.Maui.DataForm;assembly=DevExpress.Maui.Editors"
             xmlns:dxe="clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors"
             Title="{Binding Title}"
             BackgroundColor="{StaticResource NormalBackgroundColor}"
             xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
             ios:Page.UseSafeArea="true"
             x:Class="MAUI.Views.NewItemPage">
    <ContentPage.ToolbarItems>
        <ToolbarItem Text="Save" Command="{Binding SaveCommand}"/>
    </ContentPage.ToolbarItems>
    <ContentPage.Content>
        <StackLayout>
            <dxdf:DataFormView x:Name="dataForm" DataObject="{Binding .}" CommitMode="PropertyChanged" ContentPadding="0" Margin="15">
                <dxdf:DataFormView.Resources>
                    <Style TargetType="dxe:TextEdit">
                        <Setter Property="TextFontSize" Value="16" />
                        <Setter Property="TextFontFamily" Value="Roboto" />
                        <Setter Property="PlaceholderColor" Value="#acacac"/>
                    </Style>
                </dxdf:DataFormView.Resources>
                <dxdf:DataFormTextItem InplaceLabelText="Title" FieldName="Title" IsLabelVisible="False" />
                <dxdf:DataFormTextItem InplaceLabelText="Content" FieldName="Content" IsLabelVisible="False"/>
            </dxdf:DataFormView>
            <StackLayout Orientation="Horizontal" Spacing="15" Margin="15,0,15,0">
                <Button Text="Cancel" Command="{Binding CancelCommand}" HorizontalOptions="FillAndExpand" Style="{StaticResource PrimaryButton}" Margin="0,0,7,0"/>
                <Button Text="Save" Command="{Binding SaveCommand}" HorizontalOptions="FillAndExpand" Style="{StaticResource PrimaryButton}" Margin="7,0,0,0"/>
            </StackLayout>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>
