Overview of Teams and Tasks
Overview of Teams and Tasks
- Team 1 & 2 (DLL Teams): Create a simple Dynamic Link Library (DLL) in C# that simulates an animal. This library should contain four methods corresponding to actions like
Eat
,Sleep
,Run
, andPlay
. Each method returns a string that describes what the animal does when it performs these actions. - Team 3 & 4 (XAML UI Teams): Design a simple graphical user interface using XAML that displays an image of a creature and a label for text output. The UI should have four buttons corresponding to the actions defined in the DLL (Eat, Sleep, Run, Play). Pressing a button will display a statement on the label.
- Integration: After completing their tasks, teams will swap their projects. DLL Teams will learn to import and use the XAML project, while XAML Teams will learn to reference and call methods from the DLL.
Step-by-Step Instructions
For DLL Teams (1 & 2):
- Create a Class Library Project:
- Open Visual Studio and create a new project.
- Choose “Class Library (.NET)” as the project type.
- Name your project appropriately, e.g., “AnimalActions”.
- Define the Animal Class:
- In the generated class file, define four public methods:
Eat
,Sleep
,Run
, andPlay
. Each should return a string describing the action.
- In the generated class file, define four public methods:
- Build the DLL:
- Compile the project to generate the DLL file.
- Upload to the Cloud:
- Upload the DLL to a cloud storage service and share the link on the “CS-110” Discord channel.
For XAML UI Teams (3 & 4):
- Create a WPF App Project:
- Open Visual Studio and create a new project.
- Choose “WPF App (.NET)” as the project type.
- Name your project appropriately, e.g., “AnimalUI”.
- Design the UI:
- Use XAML to design the interface, which will include an image of a creature, a label for the statements, and four buttons (Eat, Sleep, Run, Play).
- Handle Button Clicks:
- Implement event handlers for the buttons to update the label with a placeholder text until the DLL is integrated.
- Upload to the Cloud:
- Upload the project to a cloud storage service and share the link on the “CS-110” Discord channel.
Integration Phase:
- Importing Projects:
- Teams download each other’s projects using the Discord links.
- DLL teams import the XAML project into their solution.
- XAML teams add the DLL reference to their project.
- Linking the DLL with the UI:
- XAML teams modify the button click event handlers to call the corresponding methods from the DLL and display the returned string in the label.
- Compilation and Testing:
- Both teams compile and test the integrated application to ensure functionality.
Key Concepts to Emphasize:
- Collections: Use collections to manage the actions or messages.
- While-Iteration-Statement: Show how a loop can be used, perhaps in cycling through actions.
- Case Statement (Switch-Case in C#): Use this to decide which method to call based on the button click.
- Defining and Calling Methods: Practice with the animal actions.
- Understanding Classes: Through creating the DLL and the UI project.
Final Notes:
Ensure all students are familiar with the basics of C# and Visual Studio to prevent frustration. You might want to start with simpler exercises before diving into this project. Encourage teamwork and communication, especially during the integration phase. This project not only teaches coding concepts but also project management, collaboration, and software integration skills.