-
|
The Best from DevelopMentor
|
MORE
|
-
WPF MVVM Helper Library (WPF + MVVM = testability)
When teaching WPF, I always introduce students to MVVM as part of the Essential WPF class, it's an incredibly useful pattern that really separates the UI from the code behind behavior. bit of history -- the library is really just a place where I dump all kinds of useful utility classes, helpers, wrappers, etc. It's evolution owes a lot to various blog posts, WPF Disciples, and other WPF leaders; I certainly didn't invent anything radically new but borrowed heavily from all kinds of places as I built various classes I needed for my own work. that I tend to use a lot. file -.
-
SOS: finding the method bound to an EventHandler with WinDbg.
I was preparing a sample memory leak application for an Advanced C# class at Microsoft this past week and debugging through it with SOS.DLL ("Son of Strike"). But as I said, this was a sample. So, I was debugging through it prior to the class just to make sure it exhibited the behavior I was looking for. total 519 objects Statistics: MT Count TotalSize Class Name 0548cbd4 519 197220 ASP.default_aspx Total 519 objects. we could start dumping method descriptors and trying to match up the address (DumpClass -md) for this class and it's base class.
-
Part 3: Shifting focus to the first available element in WPF
Creating a markup extension is trivial - you just extend the MarkupExtension base class and implement the ProvideValue method. With this new extension, I can now add a single line of code to each user control: <UserControl x:Class="FocusTest.Page2". didn't in the sample (or in my production app) but I could certainly see that being a common reality. We can use the FocusManager.FocusedElement property to shift focus in XAML but it only works when the element exists in the main XAML file. So it might seem we are stuck with adding code behind logic (blech!)
-
More asynchronous work in Windows Workflow Foundation 4
One big difference is the activity base class. In the previous sample I was using the CodeActivity as the baseclass for my custom activity while in this case I am using the more powerful NativeActivity. class AsyncWorker : NativeActivity. {. In my previous post I showed how to use an AsyncOperationBlock to do some basic asynchronous work in WF 4. As I mentioned this was for relatively short lived asynchronous operations as the workflow could not be persisted and unloaded while this asynchronous work was executing. So what do we need to use here? Enjoy!
The Problem Solver
- Wednesday, July 15, 2009
-
Using SAML as a Client Credential Type in WCF (with Geneva)
The service receiving this credential could be a normal WCF service or a STS that issues tokens based on the client credential. Using Geneva you can generate a SAML token like this: public static class ClientToken. {. Geneva has a built-in handler for SAML tokens but it does not know how to authenticate the client based on the values of certain SAML attributes. base ( new SamlSecurityTokenRequirement { AudienceUriMode = AudienceUriMode.Never }). { }. // extensibility point for authentication and claims filtering. Disclaimer. of multi-tenant apps). Client. Service.
www.leastprivilege.com
- Monday, March 9, 2009
-
MVVM: Views and ViewModels
fs28 cf1 par ??} --> < Window x : Class ="WpfMVVMApplication1.Views.MainWindow" xmlns ="[link] xmlns : x ="[link] xmlns : julmar ="[link] xmlns : ViewModels ="clr-namespace:WpfMVVMApplication1.ViewModels" xmlns : Converters ="clr-namespace:WpfMVVMApplication1.Converters" DataContext ="{ julmar : ViewModelCreator { x : Type ViewModels : MainViewModel }}" Title ="File Explorer" Height ="400" Width ="500"> First, notice how the DataContext is established – through a custom MarkupExtension called ViewModelCreator. That way, my ViewModel sticks with base (non-WPF) types. Views.
-
Part 3: Shifting focus to the first available element in WPF
Creating a markup extension is trivial - you just extend the MarkupExtension base class and implement the ProvideValue method. With this new extension, I can now add a single line of code to each user control: <UserControl x:Class="FocusTest.Page2". didn't in the sample (or in my production app) but I could certainly see that being a common reality. We can use the FocusManager.FocusedElement property to shift focus in XAML but it only works when the element exists in the main XAML file. So it might seem we are stuck with adding code behind logic (blech!)