Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the WPF User control to add a word #10

Merged
merged 2 commits into from Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
81 changes: 81 additions & 0 deletions src/WordTutor.Desktop/AddVocabularyWordView.xaml
@@ -0,0 +1,81 @@
<UserControl x:Class="WordTutor.Desktop.AddVocabularyWordView"
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:WordTutor.Desktop"
mc:Ignorable="d"
d:DesignHeight="450"
d:DesignWidth="800"
FontFamily="Segoe UI"
FontSize="18">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"
MinWidth="240"
MaxWidth="480"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" MaxHeight="32"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" MaxHeight="32"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" MaxHeight="32"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" MaxHeight="32"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<Label Content="Add Word"
FontSize="36"
HorizontalAlignment="Center"
Grid.Row="1"
Grid.Column="1"/>

<Label Content="Spelling"
HorizontalAlignment="Center"
Grid.Row="3"
Grid.Column="1"/>

<TextBox Text="{Binding Spelling, Delay=250, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Center"
Grid.Row="4"
Grid.Column="1"/>

<Label Content="Pronunciation"
HorizontalAlignment="Center"
Grid.Row="6"
Grid.Column="1"/>

<TextBox Text="{Binding Pronunciation, Delay=250, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Center"
Grid.Row="7"
Grid.Column="1"/>

<Label Content="Phrase"
HorizontalAlignment="Center"
Grid.Row="9"
Grid.Column="1"/>

<TextBox Text="{Binding Phrase, Delay=250, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Center"
Grid.Row="10"
Grid.Column="1"/>

<Button Content="Add"
HorizontalAlignment="Center"
Width="120"
Grid.Row="12"
Grid.Column="1"/>

</Grid>
</UserControl>
26 changes: 26 additions & 0 deletions src/WordTutor.Desktop/AddVocabularyWordView.xaml.cs
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WordTutor.Desktop
{
/// <summary>
/// Interaction logic for AddVocabularyWordView.xaml
/// </summary>
public partial class AddVocabularyWordView : UserControl
{
public AddVocabularyWordView()
{
InitializeComponent();
}
}
}
17 changes: 11 additions & 6 deletions src/WordTutor.Desktop/MainWindow.xaml
Expand Up @@ -5,14 +5,19 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WordTutor.Desktop"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
Title="MainWindow"
Height="600"
Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="9*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Content="Hello .NET Core!" HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="40"/>
<Button Content="Exit" Grid.Row="1" FontSize="20" Click="ButtonExit_Click"/>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<ContentControl x:Name="Shell" Grid.Column="0"/>

</Grid>
</Window>
10 changes: 10 additions & 0 deletions src/WordTutor.Desktop/WordTutor.Desktop.csproj
Expand Up @@ -7,8 +7,18 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<None Remove="AddVocabularyWordView.xaml" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\WordTutor.Core\WordTutor.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="AddVocabularyWordView.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>

</Project>