Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Monday, September 08, 2014

Window App Lab@home 12

1.Peter has been assigned a task to develop a writing pad app, which allows users to note information in plain text. The app allows the users to save the information added by them in a textual file format.

Peter has been assigned a task to develop a writing pad app, which allows users to note
information in plain text. The app allows the users to save the information added by them in a
textual file format.
Peter has developed and deployed the app. However, he noticed that if the app is in the snapped
view, it throws an exception when a user clicks the Save button.
Help Peter to identify the reason of the error and suggest a solution.

Solution::::

DOWNLOAD from here:

https://drive.google.com/file/d/0BzDgK7VFVLaKYk9Td3U2bHpVLU0/edit?usp=sharing

2.Charles has developed a Windows Store app named MyToDo, which allows users to maintain a to-do list. It allows the users to add or delete the tasks to be performed.

Charles has developed a Windows Store app named MyToDo, which allows users to maintain a
to-do list. It allows the users to add or delete the tasks to be performed.
The tasks added by the users are displayed on the right of the UI. Now, Charles wants to add a
functionality that enables the users to store all the tasks added in the app in a single plain text
format file named ToDo.txt in Documents Library. The button, Save to File, is provided on the
App bar, which allows the users to save the tasks added in the list to the ToDo.txt file. Charles
writes code to accomplish these requirements of the app. However, on the click of the Save to
File button, the tasks are not saved in the file.
Help Charles to identify the reason and suggest a solution.

Solution::::

DOWNLOAD from here:
https://drive.google.com/file/d/0BzDgK7VFVLaKTmNoS0lsc05oZUE/edit?usp=sharing

3.John has developed a Windows Store app for viewing images. This app contains a list of images. When a user clicks an image in the list, a larger view of the image is displayed, as shown in the following figure.

John has developed a Windows Store app for viewing images. This app contains a list of images.
When a user clicks an image in the list, a larger view of the image is displayed, as shown in the
following figure.
The Larger View of the Image
In the existing app, the images are statically added. Now, John has been assigned the task to
update the app so that the users can dynamically add images to the app. The app must have the
following functionalities:
It should allow the users to add image files from the Pictures folder through a button on the App
bar.
It should allow the users to add the .JPG, .PNG, and .BMP files.
Help John to implement the required functionality in the app.

Solution::::

DOWNLOAD from here:

https://drive.google.com/file/d/0BzDgK7VFVLaKejVZLTNXWDR6UlU/edit?usp=sharing
Share:

Window App Lab@home 11

1.Ryan has developed the Notes app. The app allows a user to add, edit, and view notes. Now, Ryan wants to enable the users to take a backup of all the notes that are added in the app.

Ryan has developed the Notes app. The app allows a user to add, edit, and view notes. Now,
Ryan wants to enable the users to take a backup of all the notes that are added in the app. The
backup of the notes should be stored in a single plain text file named Notes.txt in Documents
Library when the user taps the Save to File button in the app bar of the Notes page.
Help Ryan to implement the preceding functionality.

Solution::::

DOWNLOAD from here:

https://drive.google.com/file/d/0BzDgK7VFVLaKRmVIYTdvUWR5Z1U/edit?usp=sharing

2.Charles has been assigned a task to develop the WritingPad app. He has created the interface of the app, as shown in the following figure.

Charles has been assigned a task to develop the WritingPad app. He has created the interface of
the app, as shown in the following figure.
The Interface of the App

The app contains a text box, where a user can type content. In addition, it must keep the data
provided by the user, even if it is terminated by the user or OS.
For this, Charles uses the LocalSettings property of the ApplicationDataContainer object to keep
the text box content. Further, the content from the LocalSettings property of the
ApplicationDataContainer object will be retrieved in the OnNavigatedTo() method. However, when
Charles executes the app, it throws an exception.
Help Charles to identify the reason and the solution to the problem.

Solution::::


DOWNLOAD from here:

https://drive.google.com/file/d/0BzDgK7VFVLaKTUppRWh5TmtqZms/edit?usp=sharing
Share:

Window App Lab@home 10

1.Genelia has developed a book app, which allows users to read a book and navigate from one page to another.

Genelia has developed a book app, which allows users to read a book and navigate from one
page to another.
However, if the app is terminated by OS when in the suspended state, the app does not restore
the page state when the user launches the app again. Rather, it starts from the beginning. To
manage the navigation state of the app, Genelia makes use of the SuspensionManager class.
However, she is unable to implement the desired functionality.
Help Genelia identify the reason behind the preceding problem and provide a solution for the
same.

Solution::::

2.Ultima Computers is a company with a reputation of providing quality financial software products. Having consistently made profits for the past five years,

Ultima Computers is a company with a reputation of providing quality financial software products.
Having consistently made profits for the past five years, the company is diversifying into other
areas. Ultima acquires a project from Sunny Hills Resorts, a company that owns and operates
resorts globally.
Sunny Hills Resorts wants Ultima to develop a web-based payroll application. Therefore, the
systems analyst of Ultima gathers the requirements from the Assistant Vice-President (Finance) at
Sunny Hills. The developers at Ultima apply their experience of developing financial software to
the development of the new product. The application is developed before the deadline, and it is
found to be bug-free during the internal testing. Further, the application is deployed over the
Internet so that the users from all the branches of Sunny Hills Resorts can access it.
After the initial use, the following feedback comes in from all branches of Sunny Hills:
The site can be viewed properly at most of the workstations in the company. However, several
old computers in remote branches do not display the Web pages in their entirety. The
investigation reveals that some computers can only support a 640x480 resolution. Because the
website was built with an assumption that computers supporting an 800x600 resolution would be
available, the pages on the website did not fit into the display area of the monitors.
The same old computers were found to be able to support only 16 colors. Because the color
palette used for building the site had 216 colors, colors appear frayed on these computers.
Users in many branches have complained that each page on the website takes two to five
minutes to load. Investigations reveal that 75 percent of the branches have a bandwidth of less
than 128 kbps, and there are several users, who often share the link during the day.
Most users of the application are unable to find the information related to leave data of the
employees. The few users who did find the link had to go through five screens to reach it.
Many users have said that they could never identify the buttons and links, which are active, and
the ones, which are inactive. As a result, they click the buttons and links repeatedly until they get
frustrated and give up.
To resolve these issues, Ultima has to rework to design a more user-friendly application. The
project cost increases by 50 percent and Ultima faces a heavy loss.
Identify the possible causes behind the problems in the application. In addition, state the problems
and justify how these problems could have been averted.


Solution::::

DOWNLOAD from here:

https://drive.google.com/file/d/0BzDgK7VFVLaKdTl1bm4wTEhOSG8/edit?usp=sharing

3.BookTreasure Inc. is a huge library containing more than 1 million books and more than 1000 members. Managing the records of these books and members manually is becoming a difficult.

BookTreasure Inc. is a huge library containing more than 1 million books and more than 1000
members. Managing the records of these books and members manually is becoming a difficult
task. Therefore, the management of library wants to automate the library management system.
The automated system should allow the members of the library to search a specific book and
check its availability by using an online catalogue. The system should also allow the library staff to
accomplish the following tasks:
Issue a book
Return a book
Add a member
Remove a member
Add a book
Remove a book
Generate reports
While developing the preceding application, Jim Brown, an application developer, divides the
application in the following modules:
Search for a book
Issue a book
Return a book
Add a book to the library database
Further, he creates the following interaction designs for the preceding modules:
Search for a book module.
The Interaction Design for the Search for a Book Module
Issue a Book module.


The Interaction Design for the Issue a Book Module
Return a Book.
The Interaction Design for the Return a Book Module
Add a Book module.
The Interaction Design for the Add a Book Module
Analyze the preceding designs and identify the problems. Further, suggest solutions for the
identified problems.


Solution::::


DOWNLOAD from here:

https://drive.google.com/file/d/0BzDgK7VFVLaKeU5ScTVyM2w1VzA/edit?usp=sharing
Share:

Window App Lab@home 9

1.Ryan, a Windows Store app developer, created a recipe app for desserts. The app displays the images of various desserts whose recipes are available. Whenever a user clicks the image of a dessert, the app navigates to a page containing the recipe for the same. In addition, it allows the user to go back to the main page of the app.

Ryan, a Windows Store app developer, created a recipe app for desserts. The app displays the
images of various desserts whose recipes are available.
Whenever a user clicks the image of a dessert, the app navigates to a page containing the recipe
for the same. In addition, it allows the user to go back to the main page of the app.
Now, Ryan wants to store the navigation state of the app so that when the app is restarted after
suspension or termination by the system, the user is presented with the page on which the app
was terminated.
Help Ryan to develop the preceding app.

Solution::::

DOWNLOAD from here:

Accoun Gmail
https://drive.google.com/file/d/0BzDgK7VFVLaKMHRBRWMzeXVTM28/edit?usp=sharing

This is not Account Download


https://drive.google.com/file/d/0BzDgK7VFVLaKLWJBbU52elhfMDg/edit?usp=sharing


2.Ryan, an app developer, has developed an app that can be used to take notes. This app allows the users to view, create, edit, and delete notes. Each note contains a title and description. To provide the preceding functionalities, Ryan has created the following pages in the app: Notes: Displays the titles of the existing notes.

Ryan, an app developer, has developed an app that can be used to take notes. This app allows
the users to view, create, edit, and delete notes. Each note contains a title and description. To
provide the preceding functionalities, Ryan has created the following pages in the app:
Notes: Displays the titles of the existing notes.
Add Note: Displays controls to specify the title and description of a note on the screen. In
addition, it contains controls on the App bar to save a note or cancel the adding note action.
Edit Note: Displays the controls containing the details of the selected note for editing on the
screen. In addition, it contains controls on the App bar to save the edited note or cancel the
editing note action.
Note Details: Displays the title and description of the selected note. In addition, it contains
controls on the App bar to delete and edit the current note. In addition, the App bar contains a
control to navigate to the Notes page.
Ryan noticed that once the app is terminated, it loses its data. However, the app must retain
information that it contains until the user explicitly deletes it.
Help Ryan to implement the preceding functionality.

Solution::::

DOWNLOAD from here:

Account Gmail

https://drive.google.com/file/d/0BzDgK7VFVLaKWDhMNWlIRzJseTQ/edit?usp=sharing

This is not Account Download

https://drive.google.com/file/d/0BzDgK7VFVLaKVUJ2b0NKUEFiMVk/edit?usp=sharing

Share:

Window App Lab@home 8

1.John has developed a Windows Store app for viewing images. The following figure shows the UI of the app. The UI of the App The app has the following functionalities: The users are able to select an image from the Image List section.

John has developed a Windows Store app for viewing images. The following figure shows the UI
of the app.
The UI of the App

The app has the following functionalities:
The users are able to select an image from the Image List section.
Once the user selects the image from the Image List section, the preview of the selected image
is displayed in the Image Preview section.
The preview of the selected image uniformly fits in the defined area.
Now, John has been assigned the task to add the fadein and fadeout animation effects for the
preview of the image. This implies that whenever the user selects an image in Image List, the
currently-displayed image fades out and the selected image fades-in into the UI.
Help John add the preceding functionality to the app.


Solution::::

XAML code:

<Page
    x:Class="Exercise01.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Exercise01"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Viewbox>
        <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button Content="Image List" HorizontalAlignment="Left" Margin="10,10,0,0" BorderThickness="0" FontSize="24" Background="Blue" VerticalAlignment="Top" Width="315"/>
        <ListBox x:Name="lstboxPictureList" HorizontalAlignment="Left" Height="697" Margin="10,61,0,0" VerticalAlignment="Top" Width="315" SelectionChanged="lstboxPictureList_SelectionChanged"/>
        <Button Content="Image Preview"  HorizontalAlignment="Left" Margin="346,10,0,0" BorderThickness="0" FontSize="24" Background="Blue" VerticalAlignment="Top" Width="1010"/>
        <Button IsEnabled="False" HorizontalAlignment="Left" Height="697" Margin="346,61,0,0" VerticalAlignment="Top" Width="1010">
         
        <Image x:Name="imgPreview" Source="Assets/1.jpg" Stretch="Uniform">
       <Image.Resources>
       <Storyboard x:Name="fadeInImage" Storyboard.TargetName="imgPeview">
       <FadInThemeAnimation></FadInThemeAnimation>
       </Storyboard>
       <Storyboard x:Name="fadeInImage" Storyboard.TargetName="imgPeview">
       <FadeOutThemeAnimation></FadeOutThemeAnimation>
       </Storyboard>
       </Image.Resources>
        </Image>
        </Button>
    </Grid>
    </Viewbox>

</Page>
========================================================================

CS code:

using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Xaml.Navigation;
using System;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace Exercise01
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        public void loadPictureList()
        {
            for (int i = 1; i < 9; i++)
            {
                lstboxPictureList.Items.Add(i + ".jpg");
            }
            lstboxPictureList.SelectedIndex = 0;
        }
      
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            loadPictureList();
        }

        private void lstboxPictureList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {


            fadeOutImage.Begin();
        }
        private void fadeOutImage_Completed(object sender, object e)
        {
           imgPreview.Source = new BitmapImage(new uri("ms-appx:///Assets/"+ istboxPictureList.SelectedValue));
           fadeInImage.Begin();
        }
    }
}




2.Ryan, an app developer, has developed an app that can be used to take notes. This app allows the users to view, create, edit, and delete notes. Each note contains a title and a description. To provide the preceding functionalities, the following pages are added in the app:

Ryan, an app developer, has developed an app that can be used to take notes. This app allows
the users to view, create, edit, and delete notes. Each note contains a title and a description. To
provide the preceding functionalities, the following pages are added in the app:
Notes: Displays the titles of the existing notes, if already added. When a user selects the title of
a note on this page, the details of the note are displayed on a new page. However, if no notes
have been added yet, the Notes page displays the message, Notes not available. In addition,
this page contains a control in the app bar to add a new note.
Add Note: Displays controls to specify the title and description of a note. In addition, it contains
controls in the app bar to save a note or cancel the action of adding a note.
Edit Note: Displays the controls containing the details of the selected note. In addition, it
contains controls in the app bar to save the edited note or cancel the action of editing a note.
Note Details: Displays the title and description of the selected note along with the controls to
delete and edit the current note. In addition, it contains a control in the app bar to navigate to the
home page.
Now, Ryan has been assigned the task to enhance the UI of the app by implementing the
following functionalities:
Display the entrance animation effect when the pages of the app are displayed.
In the Notes page, a popup menu needs to be added. This menu should be displayed when the
user right-clicks an item in the list box that displays the list of notes. The popup menu contains
the commands that allow the user to edit or delete the selected note.
The buttons in the App bar of the app need to be styled with the respective App bar button styles,
such as EditAppBarButtonStyle, DeleteAppBarButtonStyle, and HomeAppBarButtonStyle.
Display a message dialog for confirming a delete operation before deleting a note.
Help Ryan to enhance the app by adding the preceding functionalities.

Solution::::

DOWNLOAD from here:

Account Gmail

https://drive.google.com/file/d/0BzDgK7VFVLaKUFJ6T0FUeGgtbXM/edit?usp=sharing

This is not Account

https://drive.google.com/file/d/0BzDgK7VFVLaKc2FQM0dERzFCQ28/edit?usp=sharing





3.Genelia has developed a reader app, which allows users to read a book and to move from one page to another. The home page of the app is shown in the following figure.

Genelia has developed a reader app, which allows users to read a book and to move from one
page to another. The home page of the app is shown in the following figure.


The Home Page of the App
The content page of the app is shown in the following figure.
The Content Page of the App
To enhance the look and feel of the next and previous buttons, Genelia has applied styles to the
next and previous buttons. However, after applying the desired styles, when she tries to deploy the
app, an exception is thrown. Help Genelia identify the reason of exception and provide a solution
for the same.


Solution::::

DOWNLOAD from here:

Account Gmail





4.Ryan, a Windows Store app developer, needs to create a recipe app for desserts. The app is expected to display the images of the various desserts whose recipes are available, as shown in the following figure.

Ryan, a Windows Store app developer, needs to create a recipe app for desserts. The app is
expected to display the images of the various desserts whose recipes are available, as shown in
the following figure.

The Various Dessert Recipes
Whenever a user clicks on the image of a dessert, the page containing the recipe for the same is
displayed, as shown in the following figure.
The Page Containing the Recipe
In addition, every recipe page allows the user to go back to the main page of the app.
To enhance the appearance of the app, Ryan has applied styles to the previous buttons in the
app. In addition, to make the app more appealing, he wants to add animation to the pages of the
app. However, after applying the animation, when he tries to deploy the app, an exception is
thrown.

Help Ryan identify the reason of exception and provide a solution for the same.

Solution::::

DOWNLOAD from here:

Account Gmail
https://drive.google.com/file/d/0BzDgK7VFVLaKb0ZJN2NSR1YyUzg/edit?usp=sharing

This is Not Account

https://drive.google.com/file/d/0BzDgK7VFVLaKLWRpZWJaV3p3Um8/edit?usp=sharing
Share:

Window App Lab@home 7

1.Genelia has developed a book app, which allows users to read a book and navigate from one page to another. The home page of the app is shown in the following figure. The Home Page of the App

Genelia has developed a book app, which allows users to read a book and navigate from one
page to another. The home page of the app is shown in the following figure.


The Home Page of the App
The content page of the app is shown in the following figure.
The Content Page of the App
However, this app does not allow the users to move back from a page to the previous page.
Moreover, when the users reach the last page, no control is provided to move back to the home
page.
Help Genelia identify the reason behind the preceding problems and provide a solution for the
same.

DOWNLOAD from here:

Account Gmail






2.Charles is assigned the task to develop a Windows Store app named MyToDo, which allows users to maintain a to-do list. It allows the user to add or delete the tasks to be performed. For this, the controls are available on the App bar of the app. The form for accepting the details from the user should be similar to the one shown in the following figure.

Charles is assigned the task to develop a Windows Store app named MyToDo, which allows users
to maintain a to-do list. It allows the user to add or delete the tasks to be performed. For this, the
controls are available on the App bar of the app. The form for accepting the details from the user
should be similar to the one shown in the following figure.
The Expected Interface of the App



When the user adds tasks, they should be displayed in the form as shown in the following figure.
The Expected Interface of the App after Adding Tasks
To delete an existing task, the user needs to select the task, and then right-click the blank area of
the app. The user can delete the selected task by clicking the Remove button that appears on the
App bar, as shown in the following figure.
The Remove Button on the App Bar
Charles has added the required controls to allow addition of tasks in the app. However, when a
user adds a task, he/she is able to see only the name of the task. Further, when a user clicks the
Remove button available on the App bar, the records are not deleted.
Help Charles to identify the reason and the solution to the problem.

Solution::::

XAML code:

<Page
    x:Class="MyToDo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MyToDo"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

   


    <Viewbox>
        <Grid Background="#FFA800FF" Width="1600" Height="900" Tapped="Grid_Tapped_1">
            <Rectangle Fill="Black" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="1878"/>
            <TextBlock Margin="639,28,561,0" HorizontalAlignment="Center" Text="My To Do" VerticalAlignment="Top" Height="72" FontSize="48" Width="400"/>

            <Grid x:Name="grd" Margin="0,7,0,-7">
                <TextBlock HorizontalAlignment="Left" Height="Auto" TextWrapping="Wrap" Text="Task Description" VerticalAlignment="Top" Width="Auto" Margin="17,132,0,0" FontSize="36"/>

                <TextBox x:Name="txtTaskDescription" HorizontalAlignment="Left" Margin="286,137,0,0" AcceptsReturn="True" Text="" VerticalAlignment="Top" Width="384" Height="109" GotFocus="txtTaskDescription_GotFocus"/>
                <TextBlock HorizontalAlignment="Left" Height="Auto" TextWrapping="Wrap" Text="Task Category" VerticalAlignment="Top" Width="Auto" Margin="17,267,0,0" FontSize="36"/>
                <ListView x:Name="lstViewTaskCategories" Foreground="White" FontSize="20"  HorizontalAlignment="Left" Height="100" Margin="289,276,0,0"  VerticalAlignment="Top" Width="384" BorderBrush="AliceBlue" BorderThickness="1">

                </ListView>
                <TextBlock x:Name="txtdesc" Visibility="Collapsed" HorizontalAlignment="Left" Height="Auto" TextWrapping="Wrap" Foreground="Red" Text="Please provide Task Description." VerticalAlignment="Top" Width="656" Margin="17,549,0,0" FontSize="36"/>
                <TextBlock HorizontalAlignment="Left" Height="81" TextWrapping="Wrap" Text="To be Completed by" VerticalAlignment="Top" Width="257" Margin="17,397,0,0" FontSize="36"/>
                <ComboBox x:Name="cboxYear" HorizontalAlignment="Left" Margin="289,427,0,0" VerticalAlignment="Top" Width="120"/>
                <ComboBox x:Name="cboxMonth" HorizontalAlignment="Left" Margin="422,427,0,0" VerticalAlignment="Top" Width="120"/>
                <ComboBox x:Name="cboxDay" HorizontalAlignment="Left" Margin="553,427,0,0" VerticalAlignment="Top" Width="120"/>
                <GridView x:Name="grdToDos" SelectionChanged="grdToDos_SelectionChanged_1" HorizontalAlignment="Left" Margin="719,132,0,0" VerticalAlignment="Top" Width="825" Height="460" BorderThickness="2" />
             SelectionChanged="grdToDos_SelectionChanged_1"HorizontalAlignment="Left" Margin="719,132,0,0" VerticalAlignment
            </Grid>
            <AppBar x:Name="appbar" VerticalAlignment="Bottom">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Row="0" Grid.Column="0" x:Name="bttnAddToDo" Content="Add"  Click="bttnAddToDo_Click_1"></Button>
                    <Button Grid.Row="0" Grid.Column="1" x:Name="bttnRemoveToDo" Visibility="Collapsed"   Content="Remove" Click="bttnRemoveFromGrid_Click_1"></Button>
                </Grid>
            </AppBar>



        </Grid>
    </Viewbox>

</Page>

========================================================================

CS code:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using System.Collections.ObjectModel;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace MyToDo
{
    public class ToDos
    {
        public string TaskDescription { get; set; }
        public string TaskCategory { get; set; }
        public string TaskDeadLine { get; set; }
        public bool isCompleted { get; set; }
        public ToDos(string description, string category, string deadline, bool isCompleted = false)
        {
            TaskDescription = description;
            TaskCategory = category;
            TaskDeadLine = deadline;
            this.isCompleted = isCompleted;
        }
    }
    public sealed partial class MainPage : Page
    {


        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
       ObservaleCollection<ToDos> toDosCollection = new  ObservaleCollection<ToDos>
        
        public MainPage()
        {
            this.InitializeComponent();
            fillYear(2012, 2090);
            fillMonth();
            fillDays();
            cboxMonth.SelectionChanged += cboxMonth_SelectionChanged;
            cboxYear.SelectionChanged += cboxYear_SelectionChanged;
            lstViewTaskCategories.Items.Add("Personal");
            lstViewTaskCategories.Items.Add("Official");
            lstViewTaskCategories.SelectedIndex = 0;

        }

        void cboxYear_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            fillDays();
        }

        void cboxMonth_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            fillDays();
        }
        void fillDays()
        {
            cboxDay.Items.Clear();
            cboxDay.Items.Add("");
            try
            {
                int days = DateTime.DaysInMonth(Convert.ToInt32(cboxYear.SelectedValue), getMonth(cboxMonth.SelectedValue.ToString()));
                for (int i = 1; i <= days; i++)
                    cboxDay.Items.Add(i);
                cboxDay.SelectedIndex = 0;
            }
            catch (Exception ex)
            {


            }

        }
        int getMonth(string monthName)
        {
            switch (monthName)
            {
                case "January":
                    return 1;
                case "February":
                    return 2;
                case "March":
                    return 3;
                case "April":
                    return 4;
                case "May":
                    return 5;
                case "June":
                    return 6;
                case "July":
                    return 7;
                case "August":
                    return 8;
                case "September":
                    return 9;
                case "October":
                    return 10;
                case "November":
                    return 11;
                case "December":
                    return 12;
                default:
                    return -1;

            }
        }
        void fillMonth()
        {
            cboxMonth.Items.Add("");
            cboxMonth.Items.Add("January");
            cboxMonth.Items.Add("February");
            cboxMonth.Items.Add("March");
            cboxMonth.Items.Add("April");
            cboxMonth.Items.Add("May");
            cboxMonth.Items.Add("June");
            cboxMonth.Items.Add("July");
            cboxMonth.Items.Add("August");
            cboxMonth.Items.Add("September");
            cboxMonth.Items.Add("October");
            cboxMonth.Items.Add("November");
            cboxMonth.Items.Add("December");
            cboxMonth.SelectedIndex = 0;
        }
        void fillYear(int startYear, int endYear)
        {
            cboxYear.Items.Add("");
            for (int i = startYear; i <= endYear; i++)
                cboxYear.Items.Add(i);
            cboxYear.SelectedIndex = 0;
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }
        private void bttnAddToDo_Click_1(object sender, RoutedEventArgs e)
        {
           txtdesc.Text = "Please provide complete information.";

            if (string.IsNullOrEmpty(txtTaskDescription.Text.Trim()) || cboxYear.SelectedIndex==0 || cboxMonth.SelectedIndex==0 || cboxDay.SelectedIndex==0)
            {
                txtdesc.Visibility = Windows.UI.Xaml.Visibility.Visible;
               
                return;
            }
            else
            {
                txtdesc.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                
                
                grdToDos.Items.Add(txtTaskDescription.Text);
                txtTaskDescription.Text = "";
                cboxDay.SelectedIndex = cboxMonth.SelectedIndex = cboxYear.SelectedIndex = 0;
                txtTaskDescription.Focus(Windows.UI.Xaml.FocusState.Programmatic);
            }

        }


        private void bttnRemoveFromGrid_Click_1(object sender, RoutedEventArgs e)
        {
           if(grdToDos.SelectedItams.Count > 0)
            {
               try
                {
                  if(toDosCollection.Count >1)
                   {
                     toDosCollection.Remove(grdToDos.SelectedItam as ToDos);
                     grdToDos.ItemsSource = toDosCollection;
                   }
                   else
                   {
                      toDosCollection.Clear();
                      gedToDos.ItemsSource = null;
                   }
                }
                catch (Exception)
                 {
                    
                 }
            }
        }


                    

        private void grdToDos_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
        {
            if (grdToDos.Items.Count > 0 && grdToDos.SelectedItems.Count > 0)
                bttnRemoveToDo.Visibility = Windows.UI.Xaml.Visibility.Visible;
            else
                bttnRemoveToDo.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

        private void Grid_Tapped_1(object sender, TappedRoutedEventArgs e)
        {
            appbar.IsOpen = false;
        }

        private void txtTaskDescription_GotFocus(object sender, RoutedEventArgs e)
        {
            appbar.IsOpen = false;
        }
    }
}




3.Ryan, a Windows Store app developer, needs to create a recipe app for desserts. The app is expected to display the images of the various desserts whose recipes are available, as shown in the following figure. The Expected Interface of the App

Ryan, a Windows Store app developer, needs to create a recipe app for desserts. The app is
expected to display the images of the various desserts whose recipes are available, as shown in
the following figure.
The Expected Interface of the App

Whenever a user clicks the image of a dessert, the app should navigate to a page containing the
recipe for the same. The expected interface of the recipe page is shown in the following figure.
The Expected Interface of the Recipe Page
In addition, each recipe page should allow the user to go back to the main page of the app.
Help Ryan to develop the preceding app.


Solution::::

DOWNLOAD from here:

Coding  Link

Account Gmail


Share:
GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

Unordered List