In mvc pattern how to show another view - winforms

Hi im developing an winform application using mvc pattern,
If i have a windows form as a view with a button in it, and i want to show another view(winform) on click of button in the first form.
In this case whether the view should should notify the button click to the controller and the contoller will instantiate the second form and show or the first view itself will do this.

The controller should probably handle it. In the purest form of the MVC pattern, views should be for displaying their own content, and any other logic, including displaying other views, is up to the controller. (In fact, for many actions, that is all the controller ends up doing.)

Related

Angularjs - Loading a form from a template without using ng-view

I have a crud application, The situation I want is when you click in the list, the edit form will be opened up in a modal dialog or toggling from the side.
the form is a template (/templates/form.html).
If I use ng-view, everything is simple, I set the templateUrl in the router and I get the form recompiled in the view.
But since I want to still see the grid, I want to open the form above it. so ng-view is not going to work.
how can I do the following from the controller:
load the template form maybe via ngInclude remember Im in the JS controller.
Bind the model
append the form with the binded model to the html
Thanks
Have you tried https://docs.angularjs.org/api/ng/directive/ngInclude ?
Hope it suits your case =)

Dynamically "Delete" Icon hide show in in kendo scheduler

I have create new event in kendo scheduler.There is some problems in my scheduler.I want to show delete button only authorize person who is created this event.And I want to hide delete button who is not created this event,Only show event scheduler and hide icon.
I am so tired but not solved this problems please help
I think that you need to create different types of users and give them different perks. For example, the person who created that event will be an administrator. You have to create some function where the administrator will have the create and the destroy properties as true. To other users, you'll set those properties false. As for the hiding or not buttons, I suggest you to make your own custom edit form template. This was just a general idea but I hope you get the bigger picture.
updated answer:
Not only I think you should implement the CRUD operations manually but also customize the Scheduler behavior. Just like you can wire edit event and hide the save button if an user is not authorized or just like you can wire a save event and control wheather you allow or not event modifications, the same can be made with a delete event. Anyway, from what I understood, I think that using a custom editor template to control the state of any components should be enough. Basically, define a custom template and allow/disable/hide/show some widgets depending on the user that is logged in. The credentials can be loaded and used directly in the template. Check this dojo, it might be useful.

iOS8 Universal storyboard how to refactor split view controller using size classes on iPhone?

I've converted my storyboard that uses split view controller to size classes using xCode 6 beta 3. Upon running the application, I see that the detail panel shows up first and has a "back" button in navigation. That button brings me to the master view. However, I cannot navigate back to detail view controller from master.
Is there a way for me to keep using master/detail approach in a universal storyboard?

Silverlight Page Navigation with usercontrol and MVVM Light

I'm developing a silerlight application and have settled on the MVVM Light framework. One of the things I'm trying to do is create a "LoginStatus" control that can be used on multiple locations because we have different layouts that the pages are grouped into.
My challenge is how to redirect the page from a user control. When the users "logout" I want to redirect them to a different page not just a different View. Anybody have any thoughts or some examples that might do something like this.
Most of the examples I have seen out there just change the status on the current view.
dbl
If you really want to navigate to a new page - i.e. leaving the silverlight application - you can use the Navigate method of the System.Windows.Browser.HtmlWindow class (documentation).
System.Windows.Browser.HtmlPage.Window.Navigate(
new Uri("http://silverlight.net")
);
Otherwise, if you do not want to leave the silverlight application you simply navigate to a default view that informs the user that he is not logged in.
Edit:
For implementing a navigation service in Silverlight see for example this post or this post.

Setting the ViewModel of a View when using Navigation Service in Silverlight

I'm am having trouble finding out how I would create an instance of a view model and set that as the view model of a view am I am going to navigate to using the Silverlight navigation framework.
for instance, If I have a list view with a view model, I would like the list view to use the navigation service to navigate to the details view and and set the view model of the details view to the same instance of the view model that the list view is using.
From what I have read and understand, there is no way to pass data along when using the Navigate method. And the navigate method does not return the instance of the view that will be navigated to?
So my question is... Once I have used .Navigate(URI) to navigate my silverlight application to the detail view, how can I set the viewmodel of detail view to the instance in list view before i navigate away from the list view.
First of all, your statement "From what I have read and understand, there is no way to pass data along when using the Navigate method" is incorrect. You can pass simple data values via parameters.
You can also share a datacontext between views by using a navigation frame. Check this SL3 article out:
http://timheuer.com/blog/archive/2009/04/03/share-data-between-navigation-pages-in-silverlight-3.aspx
You can use the query string to pass parameters to the view you want to navigate to, then use those parameters to create the ViewModel.
here is a post about "Site Navigation Basics in Silverlight 4" that shows how to use query string parameters in Silverlight navigation.

Resources