Saturday, November 27, 2010

Kenstar Conventional Oven Study

PRISM 4 Review - Part 4

This section will be a little unusual.

For the record, I note that the entire review of the PRISM 4 is based on ebook'a Fri "Developers Guide to Microsoft Prism. MVVM and Building Modular Applications with WPF and Silverlight"
Part 4 deals with the most awaited my chapter, "Implementing the MVVM pattern" and " MVVM Advanced Scenarios" . Since in this part of the book, the author described the pattern MVVM assumptions, which are described in my earlier posts, I will use them for reference to the description of each department as part of the above chapters.

Implementing the pattern MVVM
Class Responsibilities and Characteristics


In this section you will find a description of the design pattern MVVM. If you are interested I refer to post "Official Healthy Diet - Standard MVVM - The concept of"

Class interactions
Part This report describes a binding mechanism and the interaction between the View and ViewModel'em using INotifyPropertyChanged interfaces, INotifyCollectionChanged, ICollectionView, Commanding, IDataError, INotifyDataErrorInfo.

The use of the first two interfaces can be found also in the post "Official Healthy Diet - Standard MVVM - The concept of" . Commandingu mechanism is presented in the post "Official Healthy Diet - Standard MVVM - Commanding"

Below I will present the opportunities offered to us and interface ICollectionView DelegateCommand who PRISM'ową interface ICommand implementation.

ICollectionView is an interface that allows us to sorting, filtering, grouping, and tracking of the currently selected item in the collection. This is very helpful from the point of view because we get quite MVVM rich functionality of operations on the collections side ViewModel.
PagedCollectionView is a class that in Silverlight (in WPF is a class ListCollectionView) implements the interface in question.
Below a brief example of how to use it (the implementation of DevPrototype )

 SelectedDictionary public Dictionary {get; set;}  
public ObservableCollection DictionariesCollection
{
get { return _dictionariesCollection; }
set
{
_dictionariesCollection = value;
Dictionaries = new PagedCollectionView(_dictionariesCollection);
Dictionaries.CurrentChanged += SelectedItemChanged;
NotifyOfPropertyChange(() => DictionariesCollection);
}
}
public ICollectionView Dictionaries
{
get { return _dictionaries; }
set
{
_dictionaries = value;
NotifyOfPropertyChange(() => Dictionaries);
}
}

private void SelectedItemChanged( object sender, EventArgs e )
{
SelectedDictionary = Dictionaries.CurrentItem as Dictionary;
}
private void OnGroupCommand(object obj)
{
Dictionaries.GroupDescriptions.Add(new PropertyGroupDescription("Description"));
}
private void OnUngroupCommand(object obj)
{
Dictionaries.GroupDescriptions.Clear();
}
private void OnSortCommand(object obj)
{
Dictionaries.SortDescriptions.Add(new SortDescription("Description",ListSortDirection.Ascending));
}

DelegateCommand implementuje interfejs ICommand (polecam post „Dziennik Healthy Diets - Standard MVVM - Commanding " and provide two things. The first is the ability to force re-check method CanExecute by RaiseCanExecuteChanged method (); The second thing is to link the values \u200b\u200bof the ISENABLED with the result of the method CanExecute . These two things perfectly complement in scenarios where for example we have validated the field and click "Save." Keep in mind that podpinając DelegateCommand the Button, we do not have the personal capacity zbindowania propercji ISENABLED. This class was also built for the controls that inherit from ButtonBase. People from the Prisma themselves in the book suggest that, for other controls, and other events worth looking into the SDK Behavior'om Blenda. Mostly they mean InvokeCommandAction and CallMethodAction . For details on these two Behavior'ów refer to post "Review of Action (Blend SDK) in the context MVVM part. 1 "

Construction and Wire-Up
This section describes the management starategie View and ViewModel. We are here for election:
- ViewModel First - first initialized is ViewModel, and then inside ViewModelu instancjonowana The form is View. Remember to keep in such ViewModelu bezparametrowy constructor in order to properly display our View in VS designer or Blend.
- First View - View is initialized first. Creating an instance ViewModelu can be done either in the XAML as well as in Loaded event. For details on this strategy, refer to post "Official Healthy Diet - Blendability MVVM"

and MessageBox PopUp
is a total of only original thing I've created a team for the PRISM MVVM pattern. A set of classes and interfaces IInteractionRequest, InteractionRequestTrigger, Confirmation and Notification is intended to help the programmer to create popup windows MessageBox type in such a way that the ViewModelu there was a direct appeal to such specific items are only available in Silverlight. This facilitates the testing, which trigger this type of components is carried out on an event. A simple example


 var result = interactionService.ShowMessageBox (
"Are you sure you want to cancel this operation?"
"Confirm",
MessageBoxButton.OK);

if (result == MessageBoxResult.Yes)
{
CancelRequest ();}


ViewModel'uz Regarding the interaction of our UI logic, I refer to post "Official Healthy Diets - The logic of UI in MVVM" , where he presented his own idea of \u200b\u200bhow our ViewModel can operate with the logic available on the side view are not directly affiliated with this view.

Thursday, November 25, 2010

Dissertation Questionnaire About Food

Review PRISM 4 - part 3 Review

Agenda
• Is there a modular application? • Initializing modules


What is a module? It allowed me
to translate the first paragraph of chapter 4 of Prism 4th ebook Here it is.

modular application is an application divided into a set of functional units (called modules) that can be integrated into one larger application.
module is a kind of container parts funkcjonalnościcałej applications and typically represents a set of interrelated issues. Such a module may include elements describing zbirór part of business logic, part of the application infrastructure such as sites responsible for the login or user authentication. The modules are independent relative to each other, but they can communicate with each other based on a broadcast mechanism.
modular application can help you with the development, testing, implementation or expansion.


is how to divide an application depends only on you. This may be due to the breakdown of the relevant business topics such as procurement module, the module invoices. It may also be due to the breakdown of application architecture such as data access module, the module UI module utility. Take advantage of both worlds and have the application division of the technical modules and business modules. From my own experience I would not recommend creating separate modules for each view or couples views (eg view the list of users with a view of the details of the user). With the development of applications, increase the number of such modules, and your work with Visual Studio for example, 50 modules (projects) will become a nightmare.

initialization modules

SketchFlow - nowy projekt


whole process of loading the module starts with a function call:
 _moduleManager.LoadModule (CalendarModule "); 

The figure shows almost everything you need to know is:

Register module in modules directory
For Silverlight'a Prism provides two ways to register the modules (modules are recorded in bootstraperze)
The first is the initialization of a module directly in the code protected override
 IModuleCatalog GetModuleCatalog () 
{var
ModuleCatalog moduleCatalog = new ();

calendarModuleInfo var = new ModuleInfo
{
ModuleName = "CalendarModule"
ModuleType = "MVVMBasic.CalendarModule.Module, MVVMBasic.CalendarModule, Version = 1.0.0.0" ,
Ref = "MVVMBasic.CalendarModule.xap"
InitializationMode = InitializationMode.WhenAvailable
};
moduleCatalog.AddModule (waitWindowModuleInfo);
moduleCatalog return;}


second way is to load modules to a directory on the XAML file

private const string
 ModuleCatalogUri = "/ MVVMBasic; component / ModulesCatalog.xaml" 
protected override IModuleCatalog CreateModuleCatalog () {


Microsoft.Practices.Prism.Modularity.ModuleCatalog.CreateFromXaml return (new Uri (ModuleCatalogUri,
UriKind.Relative));}


Where XAML file is:

 \u0026lt;modularity: ModuleCatalog xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
xmlns: sys = "clr-namespace: System; assembly = mscorlib" xmlns
: modularity = "clr-namespace: Microsoft.Practices.Prism. modularity; assembly = Microsoft.Practices.Prism ">
\u0026lt;Modularity:ModuleInfoGroup Ref="MVVMBasic.CalendarModule.xap" InitializationMode="WhenAvailable">
\u0026lt;Modularity:ModuleInfo ModuleName="MVVMBasic.CalendarModule" ModuleType = "MVVMBasic.CalendarModule.Module, MVVMBasic.CalendarModule, Version=1.0.0.0",/>
\u0026lt;/ modularity: ModuleInfoGroup>
\u0026lt;/ modularity: ModuleCatalog>

Finding modules
This step relates to WPF. The programmer must indicate the location of the directory that contains modules.
Get the module you are interested in the proper location
for Silverlight applications, in this step is taken the module with the appropriate network location (directory / ClientBin in the virtual directory of our hosted applications), and transferred and loaded into memory on the client side. Since
download the module from the server to download further data packets (which can be large), we can determine how the module is to be levied. He tells us about this property InitializationMode, which takes the values:

• InitializationMode.OnDemand - get a module on demand,
• InitializationMode.WhenAvailable - get a module in the background in a separate thread.

Initialize module
After downloading the module, followed by its initialization, which aims to integrate this module with your application. Initialization occurs by looking at the downloaded module type specified in the modules folder as ModuleType .
is the class that implements the interface IModule .
 namespace MVVMBasic.CalendarModule 

{public class Module: IModule

{# region init
private readonly IRegionManager _regionManager;
readonly IUnityContainer _container;
readonly IEventAggregator _eventAggregator;

public Module (IRegionManager regionManager, IUnityContainer container,
IEventAggregator eventAggregator)
{
_regionManager = regionManager;
_container = container;
_eventAggregator = eventAggregator;

} # endregion # region

IModule
Members public void Initialize () {

/ / register new types of container
_container.RegisterType \u0026lt;ICalendarView, CalendarView> ();
_container.RegisterType \u0026lt;ICalendarViewModel, CalendarViewModel> ();

/ / Inform manager of regions, in which the region displays a view
_regionManager.RegisterViewWithRegion (CalendarView ", () => new CalendarView ());

/ / Tell all about the listening end of the module initialization
_eventAggregator.GetEvent \u0026lt;ViewInitializedEvent> (.) Publish (" CalendarModule ");}


} # endregion}


stark minimum to initialize the module is to implement the Initialize method . However, our module consists of a set of views that should be recorded in appropriate containers, managers.

Wednesday, November 24, 2010

Pds Training In Philippines

PRISM 4 - Part 2 Overview of PRISM

Agenda
• DI container container
• The role of DI in Prism
• Use container DI
• ServiceLocator

DI Box DI Box
( called Dependency Injection) is a design pattern aimed at removed from the system depending on the class and inject the objects implementing the interface. Verbal and musically: the container is a kind of map, to which record links between the interface and class on a key value. If you need an object that implements the interface that the container indicating the polls the most appropriate key (interfaces), which in return we get the value (class). This approach makes them independent
our application on the specific implementation of which will be very easy to replace the mechanism of operation, eg

 ICalendarDataService 
public interface {void
GetAllCalendars (Action \u0026lt;Calendar> result, object state);}


interface has declaration of the method that returns all klendarze.

 public class AzureCalendarDataService: ICalendarDataService 
{public void
GetAllCalendars (Action \u0026lt;Calendar> result, object state)

{/ / get calendars with SQL Azure

}} public class

XMLCalendarDataService: ICalendarDataService
{public void
GetAllCalendars (Action \u0026lt;Calendar> result, object state) {

/ / get calendars from the XML file

}} public class

EFCalendarDataService: ICalendarDataService
{public void
GetAllCalendars (Action \u0026lt;Calendar> result, object state) {

/ / get calendars from the DB using the Entity Framework

}}

These classes implement our interface downloading calendars from different data sources.
Because the application is based on interfaces, does not need to know where data is retrieved. Substitution
data source is registered in the container of the appropriate class for your interface ICalendarDataService .
Benefits are interesting (testable, simple configuration, independence, etc.).

role in the DI container
Prism Prisma Concept is the ability to create applications composed of modules. Not really interested in how the functionality will be implemented. Important module indicated that implemented the interface.

implementation of Prism provides two containers:
- MEF,
- Unity.

To use them, just to make our Boostraper podziedziczył the appropriate class. And just for the MEF will MefBootstraper, and it will be for Unity UnityBootstraper. Of course, if you like StructureMap, AutoFac or another DI container, there is nothing in the way to write their own implementation of recording your favorite Boostrapera Konter.

use DI container
Frequently used commands when working with a container of DI are:
- registration type
- Collection of instances of the type of container,
- registration set instance (Singleton),
- injecting objects to the constructor

registration type container Unity
 this.Container.RegisterType \u0026lt;ICalendarDataService, XMLCalendarDataService> (); 

type registration in the container MEF
 [Export (typeof (ICalendarDataService))] public class 
XMLCalendarDataService: ICalendarDataService
} {


Downloading instance type of container Unity
 var inch = this.Container.Resolve \u0026lt;ICalendarDataService> (); 

Downloads instance of the type of container MEF
 var inch = this.Container.GetExportedValue \u0026lt;ICalendarDataService> (); 

registration set instance (Singleton) in the Unity container
 container.RegisterInstance \u0026lt;ICalendarDataService> (new AzureCalendarDataService); 

registration set instance (Singleton) in the container MEF
 this.Container.ComposeExportedValue \u0026lt;ICalendarDataService> (this.serwisKalendarza); 

Injecting objects to the constructor. In Unity
this operation happens automatically or, for example public class
 CalendarViewModel 
{
private IEventAggregator _eventAggregator;

public CalendarViewModel (IEventAggregator eventAggregator)
{
_eventAggregator = eventAggregator;

}}

will close _eventAggregator initializing the object registered in the appropriate container, Unity.

The MEF does this by analogy with the fact that we have put the class attribute

 [ImportingConstructor] public class 
CalendarViewModel

These examples are just quick downloading. For details, refer to the addresses:
http://unity.codeplex.com
http://mef.codeplex.com

ServiceLocator
ServiceLocator is simply an overlay of our containers to facilitate you try to change the container during the application development process.
only option offered is the ability to download ServiceLocator object type and is in addition wrapped object by which we are still impinge on an interface.
 ServiceLocator.Current.GetInstance \u0026lt;IRegionNavigationService> (); 

ServiceLocatorem Cool thing of is that it is a static class available in the entire application so useful in situations where you need to download something from the container, and we do not have him Access our example, we create style ViewModel'ew Blendability, where the instance is created by the View (View First strategy).

Thursday, November 4, 2010

Funny Things Yo Say When Playing Telephone

exciting news for investors.

Today's post I want to start with a summary of the latest news. Today, an online conference of "New Franchising Systems, Inc." made by the President with a report on progress work. By results can draw some conclusions:
1. Opened an office management company LLC Makstri Limited.
2. A corporate style of the company.
3. Created a team of technologists to work out the process.
4. Developed menu offered in cafe pancake .
5. Initiated selection suppliers of raw materials for production of quality products.
6. Selects equipment appropriate concept of doing business in cafe pancakes franchise .
7. Organized a tender for construction of the project (design, equipment installation).
8. Leased premises under the first cafe.

About placing I want to say specifically. A very long time, all investors have waited for this moment and finally, after much searching the premises rented near the station Metro Semenovskaya, near the high-rise business tsetnrom (see photo) address: Moscow, per.Semenovsky, Building 21.

And now, VERY IMPORTANT INFORMATION FOR INVESTORS (both existing and potential)!
Announced winning new program called WIN-WIN "START» , which allows anyone get the company up to 80 gift shares, and this is at today's prices per share of Euro 7120. Agree, not a bad GIFT. The details shares can be accessed by clicking on the link above.