Skip to content

Commit

Permalink
Module 3 Homework
Browse files Browse the repository at this point in the history
Replaced textblocks with buttons and added click events. Added ListView
controls
  • Loading branch information
OnlyOneBDS committed Oct 1, 2015
1 parent a03ba2c commit 36c8a76
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ public App()
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif

{
Frame rootFrame = Window.Current.Content as Frame;

// Do not repeat app initialization when the Window already has content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.TopAppBar>
<AppBar x:Name="topAppBar" IsSticky="false">
<Grid>
<AppBarButton x:Name="btnHome" Label="Home" Icon="Home" Click="btnHome_Click" />
</Grid>
</AppBar>
</Page.TopAppBar>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="9*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<TextBlock
x:Name="textBlock"
<GridView x:Name="OrdersGridView" />
<Button
x:Name="ClearOrders"
Content="Clear All Orders"
Grid.Row="1"
HorizontalAlignment="Center"
Text="**Clear All Orders**"
TextWrapping="Wrap"
VerticalAlignment="Center" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@ public ExpeditePage()
{
this.InitializeComponent();
}

private void btnHome_Click(object sender, RoutedEventArgs e)
{
Frame.Navigate(typeof(MainPage));
}
}
}
22 changes: 11 additions & 11 deletions RestaurantManager/RestaurantManager.UniversalWindows/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@
Text="Internal Test Version"
TextWrapping="Wrap"
VerticalAlignment="Bottom" />
<TextBlock
x:Name="textBlock2"
<Button
x:Name="OrdersView"
Content="Go to Orders View"
Grid.Column="0"
Grid.Row="2"
HorizontalAlignment="Center"
Text="**Go to Orders View**"
TextWrapping="Wrap"
VerticalAlignment="Center" />
<TextBlock
x:Name="textBlock3"
VerticalAlignment="Center"
Click="OrdersView_Click" />
<Button
x:Name="SubmitOrder"
Content="Submit Order"
Grid.Column="1"
Grid.Row="2"
HorizontalAlignment="Center"
Text="**Submit Order**"
TextWrapping="Wrap"
VerticalAlignment="Center" />
HorizontalAlignment="Center"
VerticalAlignment="Center"
Click="SubmitOrder_Click" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,15 @@ public MainPage()
{
this.InitializeComponent();
}

private void OrdersView_Click(object sender, RoutedEventArgs e)
{
Frame.Navigate(typeof(ExpeditePage));
}

private void SubmitOrder_Click(object sender, RoutedEventArgs e)
{
Frame.Navigate(typeof(OrderPage));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.TopAppBar>
<AppBar x:Name="topAppBar" IsSticky="false">
<Grid>
<AppBarButton x:Name="btnHome" Label="Home" Icon="Home" Click="btnHome_Click" />
</Grid>
</AppBar>
</Page.TopAppBar>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*" />
Expand All @@ -19,6 +26,10 @@
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<ListView
x:Name="listView"
Grid.Row="1"
Grid.RowSpan="3" />
<TextBlock
x:Name="textBlock"
Grid.Column="1"
Expand All @@ -35,21 +46,24 @@
Text="Order Items:"
TextWrapping="Wrap"
VerticalAlignment="Center"/>
<TextBlock
x:Name="textBlock2"
<ListView
x:Name="listView1"
Grid.Column="2"
Grid.Row="2"
Grid.RowSpan="2" />
<Button
x:Name="AddOrder"
Content="Add to Order"
Grid.Row="4"
HorizontalAlignment="Center"
Text="**Add to Order**"
TextWrapping="Wrap"
VerticalAlignment="Center" />
<TextBlock
x:Name="textBlock3"
<Button
x:Name="SubmitOrder"
Content="Submit Order"
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="4"
HorizontalAlignment="Center"
Text="**Submit Order**"
TextWrapping="Wrap"
VerticalAlignment="Center" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@ public OrderPage()
{
this.InitializeComponent();
}

private void btnHome_Click(object sender, RoutedEventArgs e)
{
Frame.Navigate(typeof(MainPage));
}
}
}
}

0 comments on commit 36c8a76

Please sign in to comment.