|
21 | 21 | <RowDefinition Height="Auto"/>
|
22 | 22 | </Grid.RowDefinitions>
|
23 | 23 | <Grid.ColumnDefinitions>
|
24 |
| - <ColumnDefinition Width="Auto"/> |
| 24 | + <ColumnDefinition Width="1*"/> |
25 | 25 | <ColumnDefinition Width="2*"/>
|
26 | 26 | <ColumnDefinition Width="3*"/>
|
27 | 27 | </Grid.ColumnDefinitions>
|
|
30 | 30 | <RowDefinition/>
|
31 | 31 | <RowDefinition Height="Auto"/>
|
32 | 32 | </Grid.RowDefinitions>
|
33 |
| - <ListBox MinWidth="100" ItemsSource="{Binding Lessons, ElementName=Self}" |
| 33 | + <ListBox MinWidth="100" |
| 34 | + ItemsSource="{Binding Lessons, ElementName=Self}" |
34 | 35 | SelectedItem="{Binding SelectedLesson, ElementName=Self}">
|
35 | 36 | <ListBox.ItemTemplate>
|
36 | 37 | <DataTemplate DataType="{x:Type services:LessonData}">
|
|
52 | 53 | </Grid>
|
53 | 54 | </Grid>
|
54 | 55 | <Grid Grid.Column="1" Margin="5">
|
55 |
| - <Grid.RowDefinitions> |
56 |
| - <RowDefinition Height="Auto"/> |
57 |
| - <RowDefinition/> |
58 |
| - <RowDefinition Height="Auto"/> |
59 |
| - <RowDefinition/> |
60 |
| - </Grid.RowDefinitions> |
61 |
| - <local:TextInput Label="Title" TextContent="{Binding LessonTitle, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
62 |
| - <local:TextInput Grid.Row="1" Label="Background" TextContent="{Binding LessonBackground, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
63 |
| - <local:TextInput Grid.Row="2" Label="Docs Path (from root on docs.json-everything.net)" TextContent="{Binding DocsPath, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
64 |
| - <local:TextInput Grid.Row="3" Label="Instructions" TextContent="{Binding Instructions, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
| 56 | + <Grid.RowDefinitions> |
| 57 | + <RowDefinition Height="Auto"/> |
| 58 | + <RowDefinition/> |
| 59 | + <RowDefinition Height="Auto"/> |
| 60 | + <RowDefinition/> |
| 61 | + </Grid.RowDefinitions> |
| 62 | + <local:TextInput Label="Title |
| 63 | + " TextContent="{Binding SelectedLesson.Title, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
| 64 | + <local:TextInput Grid.Row="1" Label="Background" |
| 65 | + TextContent="{Binding SelectedLesson.Background, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
| 66 | + <local:TextInput Grid.Row="2" Label="Docs Path (from root on docs.json-everything.net)" |
| 67 | + TextContent="{Binding SelectedLesson.DocsPath, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
| 68 | + <local:TextInput Grid.Row="3" Label="Instructions" |
| 69 | + TextContent="{Binding SelectedLesson.Instructions, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
65 | 70 | </Grid>
|
66 | 71 | <Grid Grid.Column="2" Grid.RowSpan="2" Margin="5">
|
67 | 72 | <Grid.RowDefinitions>
|
68 |
| - <RowDefinition/> |
| 73 | + <RowDefinition Height="3*"/> |
| 74 | + <RowDefinition Height="3*"/> |
69 | 75 | <RowDefinition/>
|
70 | 76 | </Grid.RowDefinitions>
|
71 | 77 | <local:CodeInput Label="Initial Code" Margin="0,0,5,5"
|
72 |
| - CodeContent="{Binding InitialCode, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
73 |
| - <local:CodeInput Grid.Row="1" Label="Solution" Margin="0,5,5,0" |
74 |
| - CodeContent="{Binding Solution, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
| 78 | + CodeContent="{Binding SelectedLesson.InitialCode, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
| 79 | + <local:CodeInput Grid.Row="1" Label="Solution" Margin="0,5,5,5" |
| 80 | + CodeContent="{Binding SelectedLesson.Solution, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
| 81 | + <local:CodeInput Grid.Row="2" Label="Solution" Margin="0,5,5,0" |
| 82 | + CodeContent="{Binding ValidationOutput, ElementName=Self}"/> |
75 | 83 | <Button Grid.Row="1" Content="Copy from above" Click="CopyInitialToSolution"
|
76 | 84 | HorizontalAlignment="Right" VerticalAlignment="Top"
|
77 | 85 | Padding="10,0"/>
|
|
83 | 91 | <RowDefinition Height="Auto"/>
|
84 | 92 | </Grid.RowDefinitions>
|
85 | 93 | <Label Content="Tests"/>
|
86 |
| - <ListBox Grid.Row="1" ItemsSource="{Binding Tests, ElementName=Self}" SelectedItem="{Binding SelectedTest, ElementName=Self}"> |
| 94 | + <ListBox Grid.Row="1" SelectionChanged="SelectedTestChanged" |
| 95 | + ItemsSource="{Binding SelectedLesson.Tests, ElementName=Self}" |
| 96 | + SelectedItem="{Binding SelectedLesson.SelectedTest, ElementName=Self}"> |
87 | 97 | <ListBox.ItemTemplate>
|
88 | 98 | <DataTemplate DataType="{x:Type local:TestModel}">
|
89 | 99 | <TextBlock Text="{Binding Condensed}"/>
|
|
103 | 113 | <Button Content="🡇" Click="MoveTestDown" Grid.Column="3"/>
|
104 | 114 | </Grid>
|
105 | 115 | </Grid>
|
106 |
| - <local:CodeInput Grid.Column="1" Grid.Row="1" Label="Test Data" Margin="5" |
107 |
| - CodeContent="{Binding SelectedTest.Formatted, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
| 116 | + <local:CodeInput x:Name="TestInput" Grid.Column="1" Grid.Row="1" Label="Test Data" Margin="5" |
| 117 | + CodeContent="{Binding SelectedLesson.SelectedTest.Formatted, ElementName=Self, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> |
108 | 118 | <StackPanel Grid.Row="2" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,5,5">
|
109 | 119 | <Button Content="Validate" Click="ValidateSolution"/>
|
110 | 120 | <Button Content="Save" Click="SaveChanges" IsEnabled="{Binding CanSave, ElementName=Self}"/>
|
|
0 commit comments