Skip to main content

Posts

Showing posts from October, 2014

PopUps with Interactivity using ConfirmationRequest [Prism 5.0]

In continuation to my previous blog on PopUps with Interactivity , here we will see how to implement IConfirmation request. In order to make this post short, I'll implement IConfirmation request on top of previous example.  Let's open our viewModel and add property for InteractionRequest of type IConfirmation  as: public InteractionRequest<IConfirmation> ConfirmationRequest { get; set; } Now for every getter/setter we should have a corresponding command, which will help us in invoking this request: public ICommand ConfirmationCommand { get; set; } Just like NotificationRequest, we need to create instances of these objects in constructor as: If you will see above snippet closely, you will notice that in case of Confirmation, we are handling Status in slight different manner. Next step is to update our View as we did for NotificationRequest. Now everything is in place. Let's quickly run the application and click on PopUp button:

PopUps with Interactivity using NotificationRequest [Prism 5.0]

Just about every application has a need to notify user about an event or ask for confirmation before proceeding onto the next operation. Prior to MVVM, we would have used the MessageBox class in the code-behind. But for MVVM applications, that’s not the appropriate way as it breaks the separation of concerns from the view or viewmodel. There are lots of ways to show popups in MVVM application. In Prism, we just happen to use triggers. Triggers Triggers are used to initiate actions when a specific event is raised. So, it means we have to setup a view to detect the interaction request of event and then present an appropriate visual display for that request. What is required for raising events? Now for raising events, we need an event trigger. But not just any event trigger. We don’t want to use the built-in event trigger, instead Prism provide its own InteractionRequestTrigger. This trigger binds to the source object or the InteractionRequest object that exist in your viewm

Introducing Windows 10

Hope most of you are aware that in the mid of last week, Microsoft announced Windows 10 (Technical Preview).  This preview is a small set of new code and is not the final one. It means lot more is on the way :) This release contains desktop-focused features, primarily for business customers. Actual consumer preview is plan to launch somewhere around January. Windows 10 will run across unbelievably broad set of devices from 4 inch screens to 80 inch screens. Some of the devices we can hold in hand and others are 10 feet away. So, are you ready to dive into the new features? Well, let's start. Start Menu: Start menu with Live tiles and favourite apps Everything runs in a window: Windows store apps now opens in the same fashion as desktop apps format – can be re-sized and move around – have title bars Snap Enhancements: New quadrant layout to view four snapped apps in single shot M