DCSIMG
WPF - Shimmy on .NET

Browse by Tags

All Tags » WPF (RSS)

Close window from ViewModel by Shimmy

Although this is somewhat corny, I will dedicate for it a post. Scenario: you want to close a window from the ViewModel, without exposing the Window to it. This can be done in a simple and clean way. (Some code removed for brevity) HTH, Shimmy XAML: < Window x : Name = "this" xmlns : i = "http://schemas.microsoft.com/expression/2010/interactivity" xmlns : ei = "http://schemas.microsoft.com/expression/2010/interactions" > < i : Interaction.Triggers > <...

ObservableDictionary<TKey, TValue> (C#) by Shimmy

Few weeks ago I posted an ObservableDictionary(Of TKey, TValue) in VB.NET, today I had some time to translate it to C# (not tested, just translated, kindly notice me for any error). using System ; using System . Linq ; using System . ComponentModel ; using System . Collections . Generic ; using System . Collections . Specialized ; namespace System . Collections . ObjectModel { public class ObservableDictionary < TKey , TValue > : IDictionary <TKey, TValue>, INotifyCollectionChanged ,...

ObservableDictionary(Of TKey, TValue) - VB.NET by Shimmy

Here you go with an ObservableDictionary<TKey, TValue> that will allow you to create a UI connected to a dictionary, getting notified on dictionary item-changes. This one supports an AddRange method that allows adding a bulk of items (will throw for existing keys) without notifying for each item (opposed to ObservableCollection<T > that doesn't). To the C# version . NOTE: This class is not tested and thus not meant to be used in a multi-threaded application. HTH, Shimmy Imports System...

RequiredAttribute that validates collection fields by Shimmy

The System.ComponentModel.DataAnnotations namespace includes great classes for all that concerns validation and UI matters, for every .NET technology, especially ASP.NET MVC and Silverlight RIA Services . I think that the most used class of this namespace is the RequiredAttribute , that validates a field against nullity, or that a string should not be empty or whitespace. Today I created a class that has a List<T> (same applies to arrays, collections etc.) property, and I wondered if the RequiredAttribute...
Powered by Community Server (Commercial Edition), by Telligent Systems