<UserControl x:Class="SimpleStm.Views.MainPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:SimpleStm.Views"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:Converters="clr-namespace:SimpleStm.Converters"
             prism:ViewModelLocator.AutoWireViewModel="True" 
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">

    <UserControl.Resources>
        <Converters:BooleanToBrushConverter x:Key="BooleanToBrushConverter" />
    </UserControl.Resources>

    <Grid>
        <TextBlock Margin="362,84,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Measurement active"
                   TextWrapping="Wrap" RenderTransformOrigin="2.789,-0.1" />

        <Ellipse Width="30"
                 Height="30"
                 Margin="400,100,0,0"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Top"
                 Fill="{Binding MeasurementActive,
                                Converter={StaticResource BooleanToBrushConverter}}"
                 Stroke="Black" />
        
        <TextBlock Margin="100,134,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Temperature"
                   TextWrapping="Wrap"/>

        <TextBox Width="110"
                 Margin="100,155,0,0"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Top" 
                 Text="{Binding Temperature
                                }"/>

        <TextBlock Margin="100,84,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Actual DateTime"
                   TextWrapping="Wrap"/>

        <TextBox Width="110"
                 Margin="100,105,0,0"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Top" 
                 Text="{Binding ActualDateTime
                                }"/>

        <TextBlock Margin="345,134,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Humidity"
                   TextWrapping="Wrap"/>
        
        <TextBox Width="110"
                 Margin="345,155,0,0"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Top" 
                 Text="{Binding Humidity
                                }"/>

        <TextBlock Margin="590,134,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Pressure"
                   TextWrapping="Wrap"/>
        
        <TextBox Width="110"
                 Margin="590,155,0,0"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Top" 
                 Text="{Binding Pressure
                                }"/>
        <TextBlock Margin="100,200,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Date"
                   TextWrapping="Wrap"/>
        
        <ComboBox Name="DateCombo"           
            Margin="100,219,0,0"
            Width="80"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            
            IsEditable="true"
            IsReadOnly="true"
            SelectedItem="{Binding Path=Date}" ItemsSource="{Binding Path=Dates,
            Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
        </ComboBox>

        <TextBlock Margin="204,200,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Month"
                   TextWrapping="Wrap"/>
        
        <ComboBox Name="MonthCombo"           
            Margin="204,219,0,0"
            Width="80"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            
            IsEditable="true"
            IsReadOnly="true"
            SelectedItem="{Binding Path=Month}" ItemsSource="{Binding Path=Months,
            Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
        </ComboBox>

        <TextBlock Margin="308,200,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Year"
                   TextWrapping="Wrap"/>
        
        <ComboBox Name="YearCombo"           
            Margin="308,219,0,0"
            Width="80"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            
            IsEditable="true"
            IsReadOnly="true"
            SelectedItem="{Binding Path=Year}" ItemsSource="{Binding Path=Years,
            Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
        </ComboBox>

        <TextBlock Margin="412,200,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Hour"
                   TextWrapping="Wrap"/>
        
        <ComboBox Name="HourCombo"           
            Margin="412,219,0,0"
            Width="80"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            
            IsEditable="true"
            IsReadOnly="true"
            SelectedItem="{Binding Path=Hour}" ItemsSource="{Binding Path=Hours,
            Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
        </ComboBox>

        <TextBlock Margin="516,200,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Minute"
                   TextWrapping="Wrap"/>
        
        <ComboBox Name="MinuteCombo"           
            Margin="516,219,0,0"
            Width="80"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            
            IsEditable="true"
            IsReadOnly="true"
            SelectedItem="{Binding Path=Minute}" ItemsSource="{Binding Path=Minutes,
            Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
        </ComboBox>

        <TextBlock Margin="620,200,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="Second"
                   TextWrapping="Wrap"/>
        
        <ComboBox Name="SecondCombo"           
            Margin="620,219,0,0"
            Width="80"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            
            IsEditable="true"
            IsReadOnly="true"
            SelectedItem="{Binding Path=Second}" ItemsSource="{Binding Path=Seconds,
            Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
        </ComboBox>

        <Button Width="109"
                Height="28"
                Margin="100,295,0,0"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Command="{Binding SetTimeCommand,
                                  Mode=OneWay}"
                Content="Set DateTime" />

        <Button Width="109"
                Height="28"
                Margin="264,295,0,0"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Command="{Binding StartMeasurementCommand,
                                  Mode=OneWay}"
                Content="Start Measurement" />

        <Button Width="109"
                Height="28"
                Margin="428,295,0,0"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Command="{Binding StopMeasurementCommand,
                                  Mode=OneWay}"
                Content="Stop Measurement" />

        <Button Width="109"
                Height="28"
                Margin="591,295,0,0"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Command="{Binding SleepCommand,
                                  Mode=OneWay}"
                Content="Sleep" />



    </Grid>
</UserControl>
