WPF
Originally published on my old Charteris blog This is part 6 of the training course originally described here with parts 2,3, 4 and 5 available here, here, here and here respectively. So far we have covered WPF fundamentals, XAML, brushes, shapes, controls, styling, resources and layout. Part6 Data Binding class Converter property ...
Originally published on my old Charteris blog
Debugging layout issues is something I had to do fairly often particularly with some of the complex layouts we were trying in the past. Trying to work out why "such and such" FrameworkElement would not stretch to the size of "whatever" layout panel I was using.
Before we get to the detail of stretching there is one simple layout, debugging technique that I think is worth sharing; It is that setting the backgrounds of all the various panels that you are using, whilst debugging, makes life much easier. Take this relatively simple layout problem
Imagine if we are trying to find work out...
Originally published on my old Charteris blog This is part 5 of the training course originally described here with parts 2,3 and 4 available here, here and here respectively. So far we have covered WPF fundamentals, XAML, brushes, shapes, controls, styling and resources. Again if anyone wants to contact me for clarifications or to talk over part of the course just use a Comment or the Contact link at the top of the page. Good luck! The details of part 5 are below, the labs and any associated code are in the download package. LAB...
Originally published on my old Charteris blog This is part 4 of the training course originally described here with parts 2 & 3 available here and here respectively. So far we have covered WPF fundamentals, XAML, brushes, shapes, controls and control templating. Again if anyone wants to contact me for clarifications or to talk over part of the course just use a Comment or the Contact link at the top of the page. Good luck! The details of part 4 are below, the labs and any associated code are in the download package ...
Originally published on my old Charteris blog This is part 3 of the training course originally described here with part 2 available here. From this part onwards the course tends to concentrate more on labs and classroom interaction than on plain slide content. This worked great in a classroom scenario but it may make it hard otherwise. I have edited some of the downloadable slides to make them easier to read in isolation. Again if anyone wants to contact me for clarifications or to talk over part of the course just use a Comment or the Contact...
Originally published on my old Charteris blog This is part 2 of a training course I originally put together for the Charteris team and am now posting online. See here for the original Post and details on Part1 Part2 2D Graphics Colour and RGB Brushes SolidColorBrush VisualBrush ...
Originally published on my old Charteris blog Back in April I was asked to put together a training course on Windows Presentation Foundation (WPF) for the Charteris team. The course was well received here and it was agreed that after a bit of time I could release it publically. So I am going to make most the course available here. I will post it in parts and I am happy to take questions, clarifications and comments about each part. Each one will include the relevant powerpoint slides and relevant labs, with code to start you off. Part1 ...
Originally published on my old Charteris blog
So out of the box WPF's default template will use a VirtualizingStackPanel. The virtualizing part of the VirtualizingStackPanel (VSP) is that it will only generate the UI elements for the items that are currently visible on screen. This can have big benefits when you are working with a large dataset and complex UI.
Things to remember if you think virtualization is not happening
Make sure that ScrollViewer.CanContentScroll is set to True & IsVirtualizing is set to True. These are ListBox's defaults but remember them if you are customising the ListBox...
Originally published on my old Charteris blog
Just as Reflector is great learning tool for seeing how Microsoft put together their .Net class libraries ShowMeTheTemplate! is a great learning tool for seeing how Microsoft put together the control Templates for the standard WPF Controls.
They are good example of the use of TemplateBinding and how you should respect the properties that a consumer has set on the control you are retemplating.
Originally published on my old Charteris blog
I am blogging this for my own benefit as much as anyone else's because I am always forgetting this relatively simple thing.
Often in XAML you will need to specify a property by class and member such as "Image.IsMouseOver". This simple syntax is straight forward, easy to remember, and known as PropertyPath syntax. What is not so obvious is that you can move down the object hierarchy to access child properties. I needed to do this today and it is this that prompted my post.
On the Loaded event of an Image, in a...
Full WPF Archive