wpf-tutorial.com
The RadioButton control - The complete WPF tutorial
http://www.wpf-tutorial.com/basic-controls/the-radiobutton-control
The RadioButton control allows you to give your user a list of possible options, with only one of them selected at the same time. You can achieve the same effect, using less space, with the ComboBox control, but a set of radio buttons tend to give the user a better overview of the options they have. Label RadioButton Yes /RadioButton RadioButton No /RadioButton RadioButton IsChecked="True" Maybe /RadioButton /StackPanel /Window. If you try running the example above, you will see that, as promised, only o...
wpf-tutorial.com
Handling exceptions in WPF - The complete WPF tutorial
http://www.wpf-tutorial.com/wpf-application/handling-exceptions
Handling exceptions in WPF. If you're familiar with C# or any of the other .NET languages that you may use with WPF, then exception handling should not be new to you: Whenever you have a piece of code that are likely to throw an exception, then you should wrap it in a try-catch block to handle the exception gracefully. For instance, consider this example:. Private void Button Click(object sender, RoutedEventArgs e) { string s = null; s.Trim(); }. Event on the Application class. If subscribed to, WPF ...
wpf-tutorial.com
A WPF Application - Introduction - The complete WPF tutorial
http://www.wpf-tutorial.com/wpf-application/introduction
A WPF Application - Introduction. A WPF application requires the .NET framework to run, just like any other .NET application type. Fortunately, Microsoft has been including the .NET framework on all versions of Windows since Vista, and they have been pushing out the framework on older versions through Windows Update. In other words, you can be pretty sure that most Windows users out there will be able to run your WPF application. Download this entire tutorial as PDF. WPF vs. WinForms. The Grid - Units.
wpf-tutorial.com
Working with App.xaml - The complete WPF tutorial
http://www.wpf-tutorial.com/wpf-application/working-with-app-xaml
Working with App.xaml. Appxaml is the declarative starting point of your application. Visual Studio will automatically create it for you when you start a new WPF application, including a Code-behind file called App.xaml.cs. They work much like for a Window, where the two files are partial classes, working together to allow you to work in both markup (XAML) and Code-behind. When creating a new application, the automatically generated App.xaml will look something like this:. The main thing to notice here i...
wpf-tutorial.com
Command-line parameters in WPF - The complete WPF tutorial
http://www.wpf-tutorial.com/wpf-application/command-line-parameters
Command-line parameters in WPF. Command-line parameters are a technique where you can pass a set of parameters to an application that you wish to start, to somehow influence it. The most common example is to make the application open with a specific file, e.g. in an editor. You can try this yourself with the built-in Notepad application of Windows, by running (select Run from the Start menu or press [WindowsKey-R]):. Notepad.exe c: Windows win.ini. All we do here is to subscribe to the Startup. Using Sys...
wpf-tutorial.com
Hello, WPF! - The complete WPF tutorial
http://www.wpf-tutorial.com/getting-started/hello-wpf
The first and very classic example in pretty much any programming tutorial is the "Hello, world! Example, but in this tutorial we'll go nuts and change that into "Hello, WPF! Instead. The goal is simply to get this piece of text onto the screen, to show you how easy it is to get started. In Visual Studio, start by selecting New project. From the tree. This will give you a list of possible Windows application types to the right, where you should select a WPF Application. This is the applications primary w...
wpf-tutorial.com
Basic XAML - The complete WPF tutorial
http://www.wpf-tutorial.com/xaml/basic-xaml
In the previous chapter, we talked about what XAML is and what you use it for, but how do you create a control in XAML? As you will see from the next example, creating a control in XAML is as easy as writing it's name, surrounded by angle brackets. For instance, a Button looks like this:. XAML tags has to be ended, either by writing the end tag or by putting a forward slash at the end of the start tag:. Button A button /Button. Button FontWeight="Bold" Content="A button" /. We set the FontWeight property...
wpf-tutorial.com
The PasswordBox control - The complete WPF tutorial
http://www.wpf-tutorial.com/basic-controls/the-passwordbox-control
For editing regular text in WPF we have the TextBox, but what about editing passwords? The functionality is very much the same, but we want WPF to display something else than the actual characters when typing in a password, to shield it from nosy people looking over your shoulder. For this purpose, WPF has the PasswordBox. Control, which is just as easy to use as the TextBox. Allow me to illustrate with an example:. I have used both properties in this updated example:. Window x:Class="WpfTutorialSamples&...
wpf-tutorial.com
The TextBlock control - Inline formatting - The complete WPF tutorial
http://www.wpf-tutorial.com/basic-controls/the-textblock-control-inline-formatting
The TextBlock control - Inline formatting. In the last article we looked at the core functionality of the TextBlock control: Displaying a simple string and wrapping it if necessary. We even used another color than the default for rendering the text, but what if you wanted to do more than just define a static color for all the text in the TextBlock? Bold, Italic and Underline. Window x:Class="WpfTutorialSamples.Basic controls.TextBlockInlineSample" xmlns="http:/ schemas.microsoft.com/winfx...All three of ...