|
2 | 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 4 | x:Class="TodoListClient.MainWindow" |
5 | | - Title="To Do List Client" Height="400" Width="400" WindowStartupLocation="CenterScreen"> |
| 5 | + Title="To Do List Client" Height="400" Width="400" MinHeight="400" MinWidth="400" WindowStartupLocation="CenterScreen"> |
6 | 6 | <Grid Margin="12"> |
| 7 | + <Grid.RowDefinitions> |
| 8 | + <RowDefinition Height="10"/> |
| 9 | + <RowDefinition Height="44"></RowDefinition> |
| 10 | + <RowDefinition Height="85"></RowDefinition> |
| 11 | + <RowDefinition Height="208*"></RowDefinition> |
| 12 | + </Grid.RowDefinitions> |
| 13 | + <Grid.ColumnDefinitions> |
| 14 | + <ColumnDefinition Width="260*"></ColumnDefinition> |
| 15 | + <ColumnDefinition Width="140*"></ColumnDefinition> |
| 16 | + </Grid.ColumnDefinitions> |
7 | 17 | <Grid.Resources> |
8 | 18 | <VisualBrush x:Key="TodoHint" Stretch="None" AlignmentX="Left" AlignmentY="Top"> |
9 | 19 | <VisualBrush.Transform> |
10 | 20 | <TranslateTransform X="4" Y="7" /> |
11 | 21 | </VisualBrush.Transform> |
12 | 22 | <VisualBrush.Visual> |
13 | | - <Grid> |
| 23 | + <Grid Grid.Row="0" Grid.Column="0"> |
14 | 24 | <TextBlock Text="Enter to do item" FontWeight="Normal" Foreground="Gray" |
15 | 25 | FontSize="12" TextAlignment="Justify"/> |
16 | 26 | </Grid> |
17 | 27 | </VisualBrush.Visual> |
18 | 28 | </VisualBrush> |
19 | 29 | </Grid.Resources> |
20 | | - <StackPanel Grid.Row="0" Margin="5" VerticalAlignment="Top" Height="351"> |
21 | | - <Grid HorizontalAlignment="Left" Width="346"> |
22 | | - <Label HorizontalAlignment="Left" Content="Not Signed" Margin="0" x:Name="UserName" Width="261" Height="30"/> |
23 | | - <Button HorizontalAlignment="Right" Content="Sign In" Margin="0" Click="SignIn" x:Name="SignInButton" Width="80" Height="30"> |
24 | | - <Button.Style> |
25 | | - <Style TargetType="{x:Type Button}"> |
26 | | - <!-- "<Setter Property="IsEnabled" Value="False" /> --> |
27 | | - </Style> |
28 | | - </Button.Style> |
29 | | - </Button> |
30 | | - </Grid> |
31 | | - <GroupBox Margin="0,0,0,0" Header="Create a To Do item"> |
| 30 | + <Label Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" Content="Not Signed" Margin="0,5.4,0,0.6" x:Name="UserName" Width="261" Grid.ColumnSpan="2"/> |
| 31 | + <Button Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Content="Sign In" Margin="0,3.4,0,5.6" Click="SignIn" x:Name="SignInButton" Width="80" Height="30"> |
| 32 | + <Button.Style> |
| 33 | + <Style TargetType="{x:Type Button}"> |
| 34 | + <!-- "<Setter Property="IsEnabled" Value="False" /> --> |
| 35 | + </Style> |
| 36 | + </Button.Style> |
| 37 | + </Button> |
| 38 | + <GroupBox Grid.Row="2" Grid.ColumnSpan="2" Margin="0,11.4,-0.4,1.4" Header="Create a To Do item"> |
32 | 39 |
|
33 | | - <Grid Margin="0" HorizontalAlignment="Left" Width="388" > |
34 | | - <Grid.ColumnDefinitions> |
35 | | - <ColumnDefinition Width="130*"/> |
36 | | - <ColumnDefinition Width="85*"/> |
37 | | - </Grid.ColumnDefinitions> |
38 | | - <TextBox Grid.Column="0" HorizontalAlignment="Left" Height="34" FontSize="12" TextWrapping="Wrap" VerticalAlignment="Top" Width="199" |
| 40 | + <Grid Margin="0" HorizontalAlignment="Left" Width="320" > |
| 41 | + <TextBox Grid.Column="0" HorizontalAlignment="Left" Height="34" FontSize="12" TextWrapping="Wrap" VerticalAlignment="Top" Width="199" |
39 | 42 | x:Name="TodoText" Margin="10,10,0,0" TabIndex="1" Padding="3"> |
40 | | - <TextBox.Style> |
41 | | - <Style TargetType="{x:Type TextBox}"> |
42 | | - <Setter Property="Background" Value="Transparent" /> |
43 | | - <Style.Triggers> |
44 | | - <DataTrigger Binding="{Binding Text, ElementName=TodoText}" Value=""> |
45 | | - <Setter Property="Background" Value="{StaticResource TodoHint}"/> |
46 | | - </DataTrigger> |
47 | | - </Style.Triggers> |
48 | | - </Style> |
49 | | - </TextBox.Style> |
50 | | - </TextBox> |
51 | | - <Button Grid.Column="1" Content="Add item" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Width="101" RenderTransformOrigin="-0.013,0.15" Click="AddTodoItem" Height="34" IsDefault="True" TabIndex="2"/> |
52 | | - </Grid> |
| 43 | + <TextBox.Style> |
| 44 | + <Style TargetType="{x:Type TextBox}"> |
| 45 | + <Setter Property="Background" Value="Transparent" /> |
| 46 | + <Style.Triggers> |
| 47 | + <DataTrigger Binding="{Binding Text, ElementName=TodoText}" Value=""> |
| 48 | + <Setter Property="Background" Value="{StaticResource TodoHint}"/> |
| 49 | + </DataTrigger> |
| 50 | + </Style.Triggers> |
| 51 | + </Style> |
| 52 | + </TextBox.Style> |
| 53 | + </TextBox> |
| 54 | + <Button Grid.Column="1" Content="Add item" HorizontalAlignment="Right" Margin="0,10,0,0" VerticalAlignment="Top" Width="101" RenderTransformOrigin="-0.013,0.15" Click="AddTodoItem" Height="34" IsDefault="True" TabIndex="2"/> |
| 55 | + </Grid> |
53 | 56 |
|
54 | | - </GroupBox> |
55 | | - <DataGrid x:Name="TodoList" Margin="0,0,0,0" AutoGenerateColumns="False" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
56 | | - IsReadOnly="True" MinWidth="350" CanUserAddRows="False" CanUserDeleteRows="False" Height="230" GridLinesVisibility="None" Background="#FFFFFFFF"> |
| 57 | + </GroupBox> |
| 58 | + <DataGrid Grid.Row="3" Grid.ColumnSpan="2" x:Name="TodoList" Margin="0,11.6,-0.4,10.4" AutoGenerateColumns="False" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" |
| 59 | + IsReadOnly="True" MinWidth="350" CanUserAddRows="False" CanUserDeleteRows="False" GridLinesVisibility="None" Background="#FFFFFFFF"> |
57 | 60 |
|
58 | | - <DataGrid.Columns> |
59 | | - <DataGridTextColumn Header="To Do Items" Binding="{Binding Title}" Width="*"/> |
60 | | - </DataGrid.Columns> |
| 61 | + <DataGrid.Columns> |
| 62 | + <DataGridTextColumn Header="To Do Items" Binding="{Binding Title}" Width="*"/> |
| 63 | + </DataGrid.Columns> |
61 | 64 |
|
62 | | - </DataGrid> |
63 | | - </StackPanel> |
| 65 | + </DataGrid> |
64 | 66 | </Grid> |
65 | 67 | </Window> |
0 commit comments