|
|
browse.develop.com
Browse.develop.com is a community that was established to collect and
organize valuable web information. Our technical staff have selected and
indexed information and courses that they feel will help you stay
current on best practices across the SDLC.
|
14 Articles match "Base Classes","WPF"
|
The Latest from DevelopMentor
|
MORE
|
|
NativeActivity – A Tricky Beast
At this point you have to fall back to writing code and there are three options for your base class when writing an activity in code: CodeActivity. talked about is a while back here when the PDC CTP first came out (that’s what the reference to some base class called WorkflowElement is about) but to expand a little: The Activity is really just a template containing the code to execute for the activity. If you are using a CodeActivity base class then most of this is hidden from you except that you have to access arguments by passing in the ExecutionContext.
.NET Meanderings
- Tuesday, February 9, 2010
MVVM: Introducing the message visualizers
public class TitledCommand. {. ///. /// Title to display. ///. public class MainViewModel : ViewModel. {. public class MainViewModel : ViewModel. {. ///. /// Visualization Command list. ///. Using the visualizer is very easy – request the service from the service locator using the Resolve method (this requires you derive from the JulMar.Windows.Mvvm.ViewModel base class, or hit the service locator using the static property): {rtf1ansiansicpglang1024noproof65001uc1 deff0{fonttbl{f0fnilfcharset0fprq1 Consolas;}}{colortbl;??red0green0blue0;red255green255blue255;red0green0blue255;red43green145blue175;}??fs28
Mark's Blog of Random Thoughts
- Monday, February 1, 2010
MVVM: Service Locator
In the MVVM Helpers library, this pattern is implemented in the JulMar.Windows.Mvvm.ServiceProvider class in JulMar.Wpf.Helpers.dll. The basis for the interface is you call the GetService method, passing a System.Type (generally an interface or abstract class type) and it returns the concrete implementation if the resolver knows about it. From a client perspective, you simply request a service using the interface or class key. public class ViewModel : SimpleViewModel , IDisposable. {. ///. /// Service resolver for view models. public partial class App. {.
Mark's Blog of Random Thoughts
- Wednesday, January 27, 2010
|
-
|
The Best from DevelopMentor
|
MORE
|
-
WPF MVVM Helper Library (WPF + MVVM = testability)
There's been a lot of talk about the Model-View-ViewModel pattern recently and it's usage around the WPF and Silverlight technology stack. 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. lt; Window x : Class ="TestMvvm.MainWindow". Tags: NET WPF that I tend to use a lot. file -.
-
(Possibly) better validations in WPF
I've never cared much for the built-in validation mechanisms provided by WPF. just don't think any of them feel natural to the way we build WPF applications today. Basically, there are essentially three mechanisms built into WPF for validations: Validation Rules. Finally, IDataErrorInfo was added with WPF 3.5 Often, you will use one or several of these validation techniques in your WPF application to check the input. And so I came up with an attribute-based validation system. public abstract class ValidatorBase : Attribute, IValidator. {.
-
Part 3: Shifting focus to the first available element in WPF
We've seen how to programatically control focus and that's all great stuff, but one thing I like to do with WPF is see how much of the repetitive or UI-specific code I can move into the XAML and keep out of the code behind. 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". Tags: NET;WPF So it might seem we are stuck with adding code behind logic (blech!)
-
(Possibly) better validations in WPF
I've never cared much for the built-in validation mechanisms provided by WPF. just don't think any of them feel natural to the way we build WPF applications today. Basically, there are essentially three mechanisms built into WPF for validations: Validation Rules. Finally, IDataErrorInfo was added with WPF 3.5 Often, you will use one or several of these validation techniques in your WPF application to check the input. And so I came up with an attribute-based validation system. public abstract class ValidatorBase : Attribute, IValidator. {.
-
Part 3: Shifting focus to the first available element in WPF
We've seen how to programatically control focus and that's all great stuff, but one thing I like to do with WPF is see how much of the repetitive or UI-specific code I can move into the XAML and keep out of the code behind. 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". Tags: NET WPF So it might seem we are stuck with adding code behind logic (blech!)
-
MVVM: Introducing the message visualizers
public class TitledCommand. {. ///. /// Title to display. ///. public class MainViewModel : ViewModel. {. public class MainViewModel : ViewModel. {. ///. /// Visualization Command list. ///. Using the visualizer is very easy – request the service from the service locator using the Resolve method (this requires you derive from the JulMar.Windows.Mvvm.ViewModel base class, or hit the service locator using the static property): {rtf1ansiansicpglang1024noproof65001uc1 deff0{fonttbl{f0fnilfcharset0fprq1 Consolas;}}{colortbl;??red0green0blue0;red255green255blue255;red0green0blue255;red43green145blue175;}??fs28
-
MVVM: Views and ViewModels
Views are the UI presentation of data - in the case of a WPF/Silverlight application this is most commonly the XAML and XAML code behind files (they are considered a single element together). That way, my ViewModel sticks with base (non-WPF) types. This is necessary under WPF 3.5 public class FileViewModel : SimpleViewModel. {. ///. /// Marker file that signals expansion of the tree. ///. This is one of three primary VM classes in the MVVM helper library. No other services are provided by this base class, and as such it is very light.
|
|
|