|
8 | 8 | d:DesignHeight="450" d:DesignWidth="800" |
9 | 9 | Title="AddAnotherCriterionPage"> |
10 | 10 |
|
| 11 | + <Page.Resources> |
| 12 | + <Style x:Key="WatermarkTextBoxStyle" TargetType="TextBox"> |
| 13 | + <Setter Property="Template"> |
| 14 | + <Setter.Value> |
| 15 | + <ControlTemplate TargetType="TextBox"> |
| 16 | + <Grid> |
| 17 | + <TextBox x:Name="textBox" Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
| 18 | + Foreground="{TemplateBinding Foreground}" Background="Transparent" |
| 19 | + BorderBrush="{TemplateBinding BorderBrush}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> |
| 20 | + <TextBlock x:Name="Watermark" Text="New criterion" Foreground="Gray" Margin="10,0,0,0" VerticalAlignment="Center" |
| 21 | + IsHitTestVisible="False" Visibility="Collapsed"/> |
| 22 | + </Grid> |
| 23 | + <ControlTemplate.Triggers> |
| 24 | + <Trigger Property="Text" Value=""> |
| 25 | + <Setter TargetName="Watermark" Property="Visibility" Value="Visible"/> |
| 26 | + </Trigger> |
| 27 | + <Trigger Property="IsKeyboardFocused" Value="False"> |
| 28 | + <Setter TargetName="Watermark" Property="Visibility" Value="Collapsed"/> |
| 29 | + </Trigger> |
| 30 | + <Trigger Property="IsMouseOver" Value="False"> |
| 31 | + <Setter Property="Foreground" Value="Black" /> |
| 32 | + </Trigger> |
| 33 | + </ControlTemplate.Triggers> |
| 34 | + </ControlTemplate> |
| 35 | + </Setter.Value> |
| 36 | + </Setter> |
| 37 | + </Style> |
| 38 | + </Page.Resources> |
| 39 | + |
| 40 | + |
11 | 41 | <Grid> |
12 | 42 | <Grid Height="400" VerticalAlignment="Center"> |
13 | 43 | <Label Content="Enter the name of new criterion:" HorizontalAlignment="Center" Margin="0,80,0,0" VerticalAlignment="Top" FontSize="44" Foreground="#FF353B48"/> |
14 | | - <TextBox x:Name="textBox" HorizontalAlignment="Center" VerticalAlignment="Top" Width="404" Height="62" Margin="0,180,0,0" Foreground="#FF353B48" FontSize="25" BorderBrush="#FF353B48" VerticalContentAlignment="Center" SelectionBrush="#FF353B48" Padding="10,10,10,10"/> |
15 | | - </Grid> |
16 | | - <Button Click="Back" Content="Back" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="50,0,0,40" Height="60" Width="150" BorderBrush="#FF353B48" Foreground="#FF353B48" Background="White" BorderThickness="2,2,2,2" FontSize="25" FontFamily="Segoe UI Semibold" IsCancel="True"/> |
| 44 | + <TextBox x:Name="textBox" HorizontalAlignment="Center" VerticalAlignment="Top" Width="404" Height="62" Margin="0,180,0,0" FontSize="25" |
| 45 | + BorderBrush="#FF353B48" VerticalContentAlignment="Center" SelectionBrush="#FF353B48" Padding="10,10,10,10" |
| 46 | + Style="{StaticResource WatermarkTextBoxStyle}"/> |
| 47 | + </Grid> |
| 48 | + <Button Click="Back" Content="Back" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="50,0,0,40" Height="60" Width="150" BorderBrush="#FF353B48" Foreground="#FF353B48" Background="White" BorderThickness="2,2,2,2" FontSize="25" FontFamily="Segoe UI Semibold" IsCancel="True"/> |
17 | 49 | <Button Click="Confirm" Content="Confirm" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,50,40" Height="60" Width="150" BorderBrush="#FF353B48" Foreground="White" Background="#FF353B48" BorderThickness="2,2,2,2" FontSize="25" FontFamily="Segoe UI Semibold" IsDefault="True"/> |
18 | | - |
19 | 50 | </Grid> |
20 | 51 | </Page> |
0 commit comments