Browse by Tags
All Tags »
WPF (
RSS)
In my previous post I created a 3D cube, mapped a MediaElement onto each of its faces and animated the camera around the cube. In this post, I will replace the 3D cube with a sphere and wrap the video onto the surface of the sphere. I omit the camera animation for simplicity, but you can add it back, of course. You can download the source code here . In order to create the sphere mesh I made use of Charles Petzold’s elegant SphereMeshGenerator. In Chapter 6 of his book (3D Programming for Windows...
For 2D graphics WPF provides three classes for animating points: PointAnimation (for linear interpolation), PointAnimationUsingKeyFrames and PointAnimationUsingPath. For 3D graphics WPF provides only two: Point3DAnimation (for linear interpolation) and Point3DAnimationUsingKeyFrames. There is no built in class for animating points over a path in three dimensions. In this post I will show you a custom animation class that I wrote to partially fill that gap. In the next post I will put it to use in...
In the previous post I demonstrated use of the HierarchicalDataTemplate to style nodes based on the type of the object that they are bound to. That declarative recursion gets you true separation between data and presentation. In this post, I will show how I made use of the Composite Pattern , INotifyPropertyChanged and BindingSource<T> to implement objects for DataBinding with the TreeView. In the next post I will show how I used LINQ to XML to read the data from an XML file. The Composite...
Continued from Part 2 . So now for the second scenario. Hosting WPF controls in legacy containers. Well let’s start with hosting a WPF control in a Windows Form. Then we’ll have a bash at hosting a WPF control in an unmanaged application (hee, hee). Here is the source code for the three projects described in this post. Hosting WPF Controls in a Windows Form Hosting WPF Controls in a Windows Forms application is quite straightforward. The key is the ElementHost control in the Systems.Windows.Forms...
Continuing from Part 1 . We are still discussing the first scenario for WPF Interop, namely using COM and Windows Forms User Controls in a WPF application. Here I will be giving some examples. In the next post I will discuss the second scenario – hosting a WPF control in a Windows Form application. You can download all the source code for Part 1 and Part 2 of this article here . Please note: All projects were prepared with Visual Studio 2010 Beta 1. WPF Application using a Simple COM Object (ATL...
OK. I finally managed to create the sample ATL called Polygon from the ATL Tutorial on MSDN using the Visual Studio 2010 Beta 1. The problems I mention in the previous post remain; I simply hand-coded the text that the ATL wizard failed to create (well, maybe simply is not appropriate here). Anyway, back to interop. We have two scenarios to examine: WPF using COM objects and Windows Forms User Controls Windows Forms using WPF controls Let’s start with the first. In the rest of this post I will describe...
I am working on a post or two on the subject of WPF Interop with ATL and Windows Forms. I would like to demonstrate: ATL Simple Control in a WPF Window ATL ActiveX in a WPF Window Windows Form user control in a WPF Window WPF control in a Windows Form However, I encountered an unexpected setback: Its very difficult to create ATL projects with Visual Studio 2010 Beta 1! The ATL Wizard doesnt add implementations in the control to methods you add to the interface. When implementing connection points...
I described the problem at hand in the first post in this series. In the previous post I described the high level design of the source code that demonstrates my solution. In this post, I will describe the EmployeeUserControl and summarize. You can download the complete source code for the article here . DataBinding Design First, let’s decide what should be bound to what. From the very start we made the fairly obvious decision to use an ObservableCollection<Employee> as out ItemsSource. Combined...
In the previous post I described the requirement to create an aggregate CheckBox for a DataGridCheckBoxColumn. You can download the source code for my solution here . In this post I describe the high level design of my solution as documentation for the source code. If you are looking for the WPF techniques themselves, you can skip to the next post ( Part 3 ). Setting the Scene The project contains three assemblies: PresentationLayer: This is a WPF window application. UserControls: A class library...
I am currently working on a UI project for a customer. The natural choice was WPF – but I’ll get back to that later. I encountered some interesting problems and starting to prepare some posts with the solutions I found. They not quite ready yet so I delayed posting them for a few more days. And then … then … I found Mole 4.2 - and I was flabbergasted! This you have just got to see. Mole is an extremely powerful Visual Studio visualizer. Visualizers allow you to drill down into objects (and sometimes...