Category Archives: XAML

Make a 3D globe in WPF and C#

This example shows how you can draw a 3D globe. More generally it shows how you can make a three-dimensional textured sphere in WPF. The example Draw smooth spheres using WPF and C# shows how to make smooth colored spheres. … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Move and resize multiple rectangles in WPF and C#

The example Let the user move and resize a rectangle in WPF and C# shows how to let the user move and resize a single rectangle in a WPF program. This example extends that one to let you move and … Continue reading

Posted in controls, graphics, wpf, XAML | Tagged , , , , , , , , , , , | Leave a comment

Draw a smiley face with WPF in C#

Often I need to use images for demonstration purposes or for a book, and a smiley face makes a neutral, pleasant image. This example shows how to draw a smiley face with XAML and WPF, and then save an image … Continue reading

Posted in drawing, graphics, image processing, wpf, XAML | Tagged , , , , , , , , , , , , , , | Leave a comment

Use WPF code to display subscripts and superscripts in C#

In the post Display subscripts and superscripts in a WPF TextBlock in C# I mentioned that you could make subscripts and superscripts in WPF code but it was easier in XAML code. Juan Manuel Montes asked for an example, so … Continue reading

Posted in fonts, formatting, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , | Leave a comment

Display subscripts and superscripts in a WPF TextBlock in C#

The following examples show how to display subscripts and superscripts in a RichTextBox in a Windows Forms program. Easily display subscripts and superscripts in a RichTextBox in C# Display subscripts and superscripts in a RichTextBox in C# In a WPF … Continue reading

Posted in fonts, formatting, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , | 1 Comment

Draw smoother cones using WPF and C#

The example Draw smooth cones using WPF and C# shows how to draw some fairly smooth cones in WPF and C#. This example shows how to make even smoother cones. In the picture on the right, the cone on the … Continue reading

Posted in algorithms, drawing, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , , | Leave a comment

Draw smooth cones using WPF and C#

The example Draw cones using WPF and C# shows how to draw cones in WPF and C#. This example shows how to draw smooth cones. Or at least smoother cones. To make smooth cones, the program simply ensures that adjacent … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , | 1 Comment

Draw cones using WPF and C#

This example shows how to draw cones in WPF and C#. The program uses a method very similar to the one used by the example Draw cylinders using WPF and C#. The picture on the right shows the approach used … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Find an image URI in a WPF program in C#

One of the more annoying changes introduced in WPF and XAML is the image URI. Now instead of simply selecting an file from a resource, you need to supply an arcane string such as: pack://application:,,,/howto_wpf_learn_uri;component/csharp_prog_ref.png It’s another case of WPF’s … Continue reading

Posted in files, wpf, XAML | Tagged , , , , , , , , , | 1 Comment

Load a WPF TreeView control from an XML file in C#

The post Load a TreeView control from an XML file in C# explains how you can display XML data in a Windows Forms TreeView control. This example does something similar for a WPF project. In keeping with the unofficial WPF … Continue reading

Posted in controls, wpf, XAML, XML | Tagged , , , , , , , , , , , , | 3 Comments