This repository contains several demo programs from my C# WPF Course. Even without my course, you can use this repository to learn C#.
- Shows how to use grids to create regions in your User Interface.
- Use BackgroundColor to Debug your regions.
- Use LiveUpdate to see your code changes while your app is running.
- Shows how to align controls horizontally or vertically using the StackPanel.
- Shows how to react on size changes and align your controls with a wrap panel.
- How to create a simple menu bar with icons instead of text.
- Use MouseLeftButtonDown to react
- How to change control properties when the user hovers over them with the mouse.
- This example changes the item backgrounds on hover
- It makes your app more "living".
- Just a WPF layout with four resizable sections, to be used as boilerplate
- There's no logic behind, just a WPF showcase
- How to rotate controls with transformations
- Creating a kind of "round table" with plates
- Save the positions and sizes of controls, to restore the users choices on the next run.
- Refer to https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/controls-by-category?view=netframeworkdesktop-4.8 to learn more about all the layout controls.
- How to make controls visible/unvisible smoothly
- How to use dictionaries to organize your XAML code better
- This example applies a set of styles to a bunch of buttons
- How to make XAML animate text and graphics
- Animate controls on mouse hovering over
- How to animate rotating gears, as a loading indicator or so
- How to change the look and feel of your app dynamically at runtime.
- Shows a simple method to switch between a "light" and a "dark" theme
- Precompiled, fixed themes (not dynamically loaded skins)
- How to add icons to a data grid column
- Icons can bring more clarity to your grid
- Refer to https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/alignment-margins-and-padding-overview?view=netframeworkdesktop-4.8 to learn more about Alignment, Margins and padding.
- How to display an image dynamically (instead of a precompiled resource)
- How to write graphics onto you app background
- This demonstrates how to create the simple pong game, with just one moving ball
- Use timers to make automatic UI changes
- How to draw primitive graphic elements
- This can be used to build a simple game called "catch the red one"
- uses a timer to redraw the elements every second
- Shows how to "pick" a shape with the mouse and drag it
- There's a small bug in it: When the user picks a shape, it jumps a bit. Can you fix it?
- Improved version of drag and drop
- This is the spoiler of the previous example! Try to solve the task first!
- How to use Single value controls for editing (Textboxes, Comboboxes, Checkboxes, Radiobuttons)
- Binding row properties to your controls
- How to implement radiobuttons for a single property
- How to implement a simple data grid for row editing
- insert new rows by cliking on the empty row
- delete rows with the DEL key
- Updating a data grid automatically when the ItemSource changes
- How to validate datagrid entries
- How to use Icons in a data grid column to visualize a state
- How to use Icons in a data grid column to visualize a state
- Editing grid cells, to save the details window
- Display a small help text when you hover over a control
- Display introductory texts that explain the usage
- Help texts appear at program start and the user has to click them away
- This is meant for explanatory texts, when the user starts your app the first time
- Writing settings dialogs is boring. Use a property grid instead!
- This app demonstrates how to load/save settings easily from a file
- This app demonstrates how to easily edit your setting in a property grid.
- You don't need to edit controls
- Demonstrates the approach to write a clock with 7 segment digits
- This is the first take to create and design a single 7 segment display
- This is the WPF user control that we use for the final app
- This is the final app that uses the user control
- Create a ViewModel that has no references to the UI
- Create unit tests for the ViewModel
- Fully functional app
- Demonstrates how to do text input in two text controls, and filling them vica versa.
- Demonstrate how to encrypt and decrypt text
- The user can enter plain text in the upper or encrypted text in the lower entryfield
- Fully functional app
- Demonstrates how to do separate the UI from domain logic
- How to implement an editible combobox
- Useful for small models, where a data grid is overkill
- The user can choose an item out of the combobox, add and delete items
- Shows how to aquire elevated rights from the operating system and restart you app with more rights
- Shows how to read and display the current temperature from openweathermap.org
- Temperature reading is a black box! The focus is on the WPF part.
- Reading values from the internet is part of my Pro course
- Shows how to generate random passwords
- How to copy a string to the clipboard
- Shows how to build an app that saves all your data automatically
- You don't need to press save buttons
Licensed under Apache licence. https://www.apache.org/licenses/LICENSE-2.0
The nuget package was build with DotNET 6.
Oliver Abraham, [email protected], https://www.oliver-abraham.de
Please feel free to comment and suggest improvements!
The source code is hosted at:
https://github.com/OliverAbraham/WPF-Course
If you find this application useful, buy me a coffee! I would appreciate a small donation on https://www.buymeacoffee.com/oliverabraham