Category Archives: 8708

WAQS: PropertyChanged

7 reasons to use WAQS WAQS documentation   PropertyChanged logic Imagine that you want to calculate OrderDetail amount and Order total. So, using WAQS, you write the following two methods in specifications to generate Amount and Total calculated properties, as … Continue reading

Posted in 16402, 16868, 18343, 18344, 8708 | Leave a comment

WAQS: Add a bindable dynamic property

7 reasons to use WAQS WAQS documentation   This feature is only usable with WPF. It does not work with PCL. MVVM wrappers are a pain Imagine a master detail with suppliers as master and products as details. In this … Continue reading

Posted in 16868, 8708 | Leave a comment

WAQS: Non metadata validation rules

7 reasons to use WAQS WAQS documentation   Metadata allows to define some basic validation rules. But sometimes, validation is more complex. For example imagine that we want to be sure that order’s OrderDate is always less than ShippedDate with … Continue reading

Posted in 16868, 8708 | Leave a comment

WAQS: Metadata definition

7 reasons to use WAQS WAQS documentation   WAQS uses edmx metadata for validation: MaxLength (for string and byte array) and Nullable. However, edmx metadata often are insufficient: no MinValue, no MaxValue, no MinLength, no Pattern and even less dynamic … Continue reading

Posted in 16868, 18204, 8708 | Leave a comment

How to use WAQS?

7 reasons to use WAQS WAQS documentation   WAQS could be used in many kinds of applications. Some of my customers already use it for these kinds ones: 3-Tiers application Web application (ASP.NET MVC) Web service In this post, I … Continue reading

Posted in 16868, 17894, 17895, 18204, 8708 | Leave a comment

WPF/SL: lazy loading TreeView

01/26/2012: Code update Imagine the following scenario: you have a WCF service with two methods: List<Customer> GetCustomers(); List<Order> GetOrders(int CustomerId); You want a treeview with lazy loading in a WPF Window. There is many way to do it. I identify … Continue reading

Posted in 13461, 7671, 8708 | 2 Comments

EnumerableCollection

Imagine the following scenario. You use MVVM, you have two classes on your model: public class Child{} public class Parent{    private ObservableCollection<Child> _children;    public ObservableCollection<Child> Children    {        get { return _children ?? (_children = new ObservableCollection<Child>()); }    }} You have two more classes on your ViewModel: public class ChildViewModel{    … Continue reading

Posted in 13461, 7671, 7672, 8708 | Leave a comment

INotifyPropertyChanged

When we want to use binding with WPF or SL, we use INotifyPropertyChanged interface most of time. This interface has only one member: event PropertyChangedEventHandler PropertyChanged; We generally use it like this: protected virtual void RaisePropertyChanged(string property){    if (PropertyChanged != null)        PropertyChanged(this, new PropertyChangedEventArgs(property));} … Continue reading

Posted in 13461, 7671, 8708 | Leave a comment

XAML: How to use a ConverterParameter which is not a string in XAML?

Imagine the following case: I have a TextBox and a TextBlock and a boolean property IsEditing. If IsEditing is true, the TextBox is visible and the TextBlock is hidden and reversely. In this case I could use a ViewModel with … Continue reading

Posted in 13461, 14489, 8708 | 4 Comments

ObservableCollection… better

ObservableCollection class is probably one of the worst classes I have ever seen in the .NET fx: Some current collection methods are missing: (AddRange for example) Bad for performance when we Refresh the collection (1 Clear + n Add) => … Continue reading

Posted in 13461, 7671, 7672, 8708 | 3 Comments