Search Results

Search found 1226 results on 50 pages for 'kendo mvvm'.

Page 2/50 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Cleanup vs Dispose(bool) in MVVM-light

    - by Budda
    In the lastest version of MVVM-light (V3 SP1) both "Dispose()" and "Dipose(bool)" methods in ViewModel class are marked Do not use this method anymore, it will be removed in a future version. Use ICleanup.Cleanup() instead Does this mean that IDisposable interface must not be implemented in all ViewModel classes that are derived from GalaSoft.MvvmLight.ViewModelBase (and cleanup must be overrided)? If yes, using can't be used for view-model instances... Probably I didn't understand something... Please clarify... What are the benefits of such cleaning up? Thanks.

    Read the article

  • How to play Sound and Animations in MVVM

    - by user275561
    I have read alot of blogs about the best way to play sound/Animation but if possible I would like to see a simplified example on how this is done so I understand better. So to my understanding in MVVM The View--Sound and Animation The ViewModel--If some value is true, i would like to play the Sound and Animation on the view. Now How would I go about doing this. I was told to use interfaces like ISoundService and IAnimationService. Implement in the View and then do what? If possible, a workable bare bone example will help alot.

    Read the article

  • Proper way in MVVM to drive visual states.

    - by firoso
    Given a content presenter that can display one of 4 different application pages, and I want to fade/otherwise animate a transition between pages based on view model state. Ideally I'd like to have these all defined within a DataTemplate, and then trigger transitions based on an enum from the view model, so that when some enum representing state changes, the transitions trigger to the appropriate page. Is there a known best practice to handle things like this? Immediately coming to mind is the possibiltiy to use Enter and Exit actions on data triggers to play storyboards, but this definately doesn't use the parts and states model, so I'd like to shy away from that. I've also tried using the DataStateSwitchBehavior from the codeplex Expression project, but found it to be incompatable with the latest builds of WPF 4.0/Blend 4 RC's SDK. Does anyone have any ideas on how to handle this elegantly? I'm using the MVVM-Light framework. Also I'd like to point out that as long as this resides on a DataTemplate in a Resource Dictionary, code-behind is not an option without refactoring.

    Read the article

  • Please suggest me the ( Interaction model of view model) MVVM design in the simple scenario discusse

    - by Jack
    Data Layer I have an Order class as an entity. This Order entity is my model object. Order can be different types, let it be A B C D Also Order class may have common properties like Name, Time of creation, etc. Also based on the order type there are different fields that are not common. View Layer The view contains the following Main Menu ListView The Main Menu contains the drop down menu button which is used to create the order based on the type selected from the drop down. The drop down contains the Order types ( A ,B , C and D). There are different user control based on the order type. Like for example if user chooses to create an order of type A then different view with different inputs field is popped up. Hence, there are four user control for each order type. If user selects A option from the drop down then Order of type A is created and vica versa. Now below is the List View that contains the List of orders so far created by the user. To Edit any particular order user may double click the list view row. Based on the order type clicked by the user in the listview, the view of that order type opens in edit mode. For example if user selects an order type A from the list view then view for order type A open in edit mode. Please suggest me interaction model for view model's in the scenario discussed above. Please excume me if the query is very basic, since I am new new to MVVM and WPF ,

    Read the article

  • SL3 Nav framework + MVVM ligh

    - by Murari
    Hi All, Thanks for taking time to read through my question. Any guidance is really appreciated. I am using SL3 Navigation framework in my LOB application. I m currently using MVVM Light as the framework guidance. I have a datagrid consisting of employees and when the "user" clicks on "employee id link" in the datagrid, i am transferring the user to "Edit Page". I would like to transfer the "employee id" as query parameter to "edit page". The issue here is: I can access the query parameter in the EditStaffView.xaml.cs - which i don't want to do. protected override void OnNavigatedTo(NavigationEventArgs e) { if (this.NavigationContext.QueryString.ContainsKey("staffcode")) { string title = this.NavigationContext.QueryString["staffcode"]; } } I would like to retrieve the query parameter in my viewmodel and based on the query parameter, i will perform certain operations. When the constructor is called I would like the "view" to pass the staffid as shown below public EditStaffViewModel(int staffId) { LoadData(staffId); } I am constructing my hyperlink buttons in the datagrid dyanmically as shown below: staffListingModel.HyperlinkNavigationUri = string.Format("{0}{1}", NavigationUri.DataEntryEditStaff,"?staffcode={" + staffListingModel.StaffCode + "}"); and XAML looks HyperlinkButton Content="{Binding StaffCode,Mode=TwoWay}" NavigateUri="{Binding HyperlinkNavigationUri}" HyperlinkButton Any idea how to do this ?? Thanks for the help. Murari

    Read the article

  • When does implementing MVVM not make sense

    - by Kelly Sommers
    I am a big fan of various patterns and enjoy learning new ones all the time however I think with all the evangelism around popular patterns and anti-patterns sometimes this causes blind adoption. I think most things have individual pros and cons and it's important to educate what the cons are and when it doesn't make sense to make a particular choice. The pros are constantly advocated. "It depends" I think applies most times but the industry does a poor job at communicating what it depends ON. Also many patterns surfaced from inheriting values from previous patterns or have derivatives, which each one brings another set of pros and cons to the table. The sooner we are more aware of the trade off's of decisions we make in software architecture the sooner we make better decisions. This is my first challenge to the community. Even if you are a big fan of said pattern, I challenge you to discover the cons and when you shouldn't use it. Define when MVVM (Model-View-ViewModel) may not make sense in a particular piece of software and based on what reasons. MVVM has a set of pros and cons. Let's try to define them. GO! :)

    Read the article

  • Silverlight 4 + MVVM + KeyDown event

    - by jturn
    I'm trying to build a sample game in Silverlight 4 using the MVVM design pattern to broaden my knowledge. I'm using Laurent Bugnion's MvvmLight toolkit as well (found here: http://mvvmlight.codeplex.com/ ). All I want to do right now is move a shape around within a Canvas by pressing specific keys. My solution contains a Player.xaml (just a rectangle; this will be moved around) and MainPage.xaml (the Canvas and an instance of the Player control). To my understanding, Silverlight doesn't support tunneling routed events, only bubbling. My big problem is that Player.xaml never recognizes the KeyDown event. It's always intercepted by MainPage.xaml first and it never reaches any child controls because it bubbles upward. I'd prefer that the logic to move the Player be in the PlayerViewModel class, but I don't think the Player can know about any KeyDown events firing without me explicitly passing them on down from the MainPage. I ended up adding the handler logic to the MainPageViewModel class. Now my problem is that the MainPageViewModel has no knowledge of Player.xaml so it cannot move this object when handling KeyDown events. I guess this is expected, as ViewModels should not have any knowledge of their associated Views. In not so many words...is there a way this Player user control within my MainPage.xaml can directly accept and handle KeyDown events? If not, what's the ideal method for my MainPageViewModel to communicate with its View's child controls? I'm trying to keep code out of the code-behind files as much as possible. Seems like it's best to put logic in the ViewModels for ease of testing and to decouple UI from logic. (MainPage.xaml) <UserControl x:Class="MvvmSampleGame.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:game="clr-namespace:MvvmSampleGame" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4" mc:Ignorable="d" Height="300" Width="300" DataContext="{Binding Main, Source={StaticResource Locator}}"> <i:Interaction.Triggers> <i:EventTrigger EventName="KeyDown"> <cmd:EventToCommand Command="{Binding KeyPressCommand}" PassEventArgsToCommand="True" /> </i:EventTrigger> </i:Interaction.Triggers> <Canvas x:Name="LayoutRoot"> <game:Player x:Name="Player1"></game:Player> </Canvas> (MainViewModel.cs) public MainViewModel() { KeyPressCommand = new RelayCommand<KeyEventArgs>(KeyPressed); } public RelayCommand<KeyEventArgs> KeyPressCommand { get; private set; } private void KeyPressed(KeyEventArgs e) { if (e.Key == Key.Up || e.Key == Key.W) { // move player up } else if (e.Key == Key.Left || e.Key == Key.A) { // move player left } else if (e.Key == Key.Down || e.Key == Key.S) { // move player down } else if (e.Key == Key.Right || e.Key == Key.D) { // move player right } } Thanks in advance, Jeremy

    Read the article

  • MVVM Light toolkit - maintained? Here today - gone tomorrow? ...

    - by mark smith
    Hi there, I have been taking a look at mvvm light toolkit, i must admit i haven't got a lot of experience with it but i live what i see.. I did use the mvvm toolkit (microsoft) but currently use vs 2010 and no templates are available as yet. I was looking for some insight into mvvm light toolkit... Is it always maintained ? i..e its not going to be gone tomorrow... Or shoudl i be looking elsewhere?? I would really appreciate any feedback... I also saw some info on how it is blendable which the mvvm toolkit (microsoft) didn't seem to have.. Prism also seems to be also a likely candidate but from what i understand its not a MVVM framework / toolkit i would be using it with wpf Any help really appreciated Thank you

    Read the article

  • Is MVVM in WPF outdated?

    - by Benjol
    I'm currently trying to get my head round MVVM for WPF - I don't mean get my head round the concept, but around the actual nuts and bolts of doing anything that is further off the beaten track than dumb CRUD. What I've noticed is that lots of the frameworks, and most/all blog posts are from 'ages' ago. Is this because it is now old hat and the bloggers have moved onto the Next Big Thing, or just because they've said everything there is to say? In other words, is there something I'm missing here?

    Read the article

  • KendoGrid with in a new custom kendo ui widget

    - by Aakif
    Please guide me how to make a custom kendo ui widget, like if you could refer to some tutorial or anything. Secondly the main question is that I want to use kendo grid to consume webapi and i want to use it in a widget in which and pass the datasource to this widget. Bascially I want to make a widget which will consume the webapi using a particular url, and which will return a data source that I can add to this kendogrid widget.

    Read the article

  • MVVM - Master/Detail scenario with Navigation and Blendability

    - by vidalsasoon
    Hi, I'll start off with what I want so it may be simpler to understand: I have a Page (Master.xaml) that has has a listbox of PersonViewModel. When the user selects a PersonViewModel from the listbox, I want to Navigate to a details (Details.xaml) page of the selected PersonViewModel. The details page does some extra heavy lifting that I only want done once the user navigates to the page. (I don't want too much stuff loaded in each PersonViewModel of the master listbox) So how do you guys handle master/detail scenarios with navigation while maintaining "blendability"? I've been turing in circles for the past week. there seems to be no clean solution for something that should be quite common?

    Read the article

  • MVVM - child windows and data contexts

    - by GlenH7
    Should a child window have it's own data context (View-Model) or use the data context of the parent? More broadly, should each View have its own View-Model? Are there are any rules to guide making that decision? What if the various View-Models will be accessing the same Model? I haven't been able to find any consistent guidance on my question. The MS definition of MVVM appears to be silent on child windows. For one example, I have created a warning message notification View. It really didn't need a data context since it was passed the message to display. But if I needed to fancy it up a bit, I would have tapped the parent's data context. I have run into another scenario that needs a child window and is more complicated than the notification box. The parent's View-Model is already getting cluttered, so I had planned on generating a dedicated VM for the child window. But I can't find any guidance on whether this is a good idea or what the potential consequences may be. FWIW, I happen to be working in Silverlight, but I don't know that this question is strictly a Silverlight issue.

    Read the article

  • MVVM and service pattern

    - by alfa-alfa
    I'm building a WPF application using the MVVM pattern. Right now, my viewmodels calls the service layer to retrieve models (how is not relevant to the viewmodel) and convert them to viewmodels. I'm using constructor injection to pass the service required to the viewmodel. It's easily testable and works well for viewmodels with few dependencies, but as soon as I try to create viewModels for complex models, I have a constructor with a LOT of services injected in it (one to retrieve each dependencies and a list of all available values to bind to an itemsSource for example). I'm wondering how to handle multiple services like that and still have a viewmodel that I can unit test easily. I'm thinking of a few solutions: Creating a services singleton (IServices) containing all the available services as interfaces. Example: Services.Current.XXXService.Retrieve(), Services.Current.YYYService.Retrieve(). That way, I don't have a huge constructor with a ton of services parameters in them. Creating a facade for the services used by the viewModel and passing this object in the ctor of my viewmodel. But then, I'll have to create a facade for each of my complexe viewmodels, and it might be a bit much... What do you think is the "right" way to implement this kind of architecture ?

    Read the article

  • Best Practice Method for Including Images in a DataGrid using MVVM

    - by Killercam
    All, I have a WPF DataGrid. This DataGrid shows files ready for compilation and should also show the progress of my compiler as it compiles the files. The format of the DataGrid is Image|File Path|State -----|---------|----- * |C:\AA\BB |Compiled & |F:PP\QQ |Failed > |G:HH\LL |Processing .... The problem is the image column (the *, &, and are for representation only). I have a ResourceDictionary that contains hundreds of vector images as Canvas objects: <ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <Canvas x:Key="appbar_acorn" Width="48" Height="48" Clip="F1 M 0,0L 48,0L 48,48L 0,48L 0,0"> <Path Width="22.3248" Height="25.8518" Canvas.Left="13.6757" Canvas.Top="11.4012" Stretch="Fill" Fill="{DynamicResource BlackBrush}" Data="F1 M 16.6309,18.6563C 17.1309,8.15625 29.8809,14.1563 29.8809,14.1563C 30.8809,11.1563 34.1308,11.4063 34.1308,11.4063C 33.5,12 34.6309,13.1563 34.6309,13.1563C 32.1309,13.1562 31.1309,14.9062 31.1309,14.9062C 41.1309,23.9062 32.6309,27.9063 32.6309,27.9062C 24.6309,24.9063 21.1309,22.1562 16.6309,18.6563 Z M 16.6309,19.9063C 21.6309,24.1563 25.1309,26.1562 31.6309,28.6562C 31.6309,28.6562 26.3809,39.1562 18.3809,36.1563C 18.3809,36.1563 18,38 16.3809,36.9063C 15,36 16.3809,34.9063 16.3809,34.9063C 16.3809,34.9063 10.1309,30.9062 16.6309,19.9063 Z "/> </Canvas> </ResourceDictionary> Now, I want to be able to include these in my image column and change them at run-time. I was going to attempt to do this by setting up a property in my View Model that was of type Image and binding this to my View via: <DataGrid.Columns> <DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Image Source="{Binding Canvas}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> Where in the View Model I have the appropriate property. Now, I was told this is not 'pure' MVVM. I don't fully accept this, but I want to know if there is a better way of doing this. Say, binding to an enum and using a converter to get the image? Any advice would be appreciated.

    Read the article

  • Kendo Grid: Foreign Key Dropdown does not update grid cell after update

    - by JookyDFW
    I have a Kendo MVC grid that contains a nullable property (short) that is bound as a foreign key and uses a dropdown list as an editor template. I am also using inline editing. When the property value is null, the dropdown list selected value does not get set into the grid cell after the update button is clicked. This works fine if incell editing is used. I am looking for a workaround that will solve my problem. I am including a stripped down version of my code below Everything works if the nullable value is set to a non-null value. GRID @(Html.Kendo().Grid<AssetViewModel>() .Name("DealAssets") .Columns(c => { c.Bound(x => x.Name); c.ForeignKey(x => x.AssetTypeID, (IEnumerable<SelectListItem>)ViewBag.AssetTypeList, "Value", "Text"); c.ForeignKey(x => x.SeniorityTypeID, seniorityTypeList, "Value", "Text").EditorTemplateName("GridNullableForeignKey"); c.ForeignKey(x => x.RateBaseID, rateBaseList, "Value", "Text").EditorTemplateName("GridNullableForeignKey"); ; c.Command(m => { m.Edit(); m.Destroy(); }); }) .ToolBar(toolbar => toolbar.Create().Text("Add New Asset")) .Editable(x => x.Mode(GridEditMode.InLine)) .DataSource(ds => ds .Ajax() .Model(model => model.Id(request => request.ID)) .Read(read => read.Action("ReadAssets", "Deal", new { id = Model.ID })) .Create(create => create.Action("CreateAsset", "Deal", new { currentDealID = Model.ID })) .Update(update => update.Action("UpdateAsset", "Deal")) .Destroy(destroy => destroy.Action("DeleteAsset", "Deal")) ) ) EDITOR TEMPLATE @model short? @{ var controlName = ViewData.TemplateInfo.GetFullHtmlFieldName(""); } @( Html.Kendo().DropDownListFor(m => m) .Name(controlName) .OptionLabel("- Please select -") .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"]) ) UPDATE ACTION public ActionResult UpdateAsset([DataSourceRequest] DataSourceRequest request, int ID) { var dealAsset = DataContext.DealAssets.SingleOrDefault(o => o.ID == ID); if (dealAsset != null) { if (TryUpdateModel(dealAsset.Asset, new[] {"Name","AssetTypeID","SeniorityTypeID","RateBaseID" })) { DataContext.SaveChanges(); } } return Json(new[] { new AssetViewModel(dealAsset) }.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet); }

    Read the article

  • How to bind Data to Dropdownlist in Kendo Ui Mobile

    - by dinesh Haraveer
    I have been using Kendo Mobile to develop an application, previously same application i have done in Kendo web,it's works fine.The main problem is that i have to bind data to two dropdownlist which the below code i have written,when my application is running it show an error like "Microsoft JScript runtime error: Object doesn't support property or method 'append'". in HTML <div id="forms" data-role="view" data-title="Form Elements" data-init="initForm"> <table> <tr> <td> <label style="margin-left: 20px"> Company:</label> </td> <td> <select id="ddlCompany" style="width: 200px"> <option>Select Company</option> </select> </td> <td class="style1"> <label style="margin-left: 20px"> Category:</label> </td> <td> <select id="ddlCategory" style="width: 200px"> <option>Select Category</option> </select> </td> <td> <label style="margin-left: 20px"> Product :</label> </td> <td> <select id="ddlProduct" style="width: 200px"> <option>Select Product</option> </select> </td> </tr> </table> </div> function initForm() { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "FlashReportMobileWebService.asmx/GetCompany", dataType: "json", success: function (data) { for (i = 0; i < data.d.length; i++) { ddlCompany.append($("<option></option>").val(data.d[i].Company).html(data.d[i].Company)); }; $("#ddlCompany").kendoDropDownList(); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "FlashReportMobileWebService.asmx/ToCategoryDropDown", dataType: "json", success: function (data) { for (i = 0; i < data.d.length; i++) { ddlCategory.append($("<option></option>").val(data.d[i].Category).html(data.d[i].Category)); }; $("#ddlCategory").kendoDropDownList(); }, failure: function (msg) { alert(msg); } }); } $("#ddlCategory").change( function (e) { var ddlProduct= $("#ddlProduct"); var dataItem = $("#ddlCategory").val(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", data: "{'Category':'" + dataItem + "'}", url: "FlashReportWebService.asmx/ToFillProductDropDown", dataType: "json", success: function (data) { ddlProduct.empty(); for (i = 0; i < data.d.length; i++) { ddlProduct.append($("<option></option>").val(data.d[i].ProductName).html(data.d[i].ProductName)); }; $("#ddlProduct").kendoDropDownList(); }, failure: function (msg) { alert(msg); } }); }); var app = new kendo.mobile.Application(document.body); thanks for reading this

    Read the article

  • Using the BackgroundWorker in a Silverlight MVVM Application

    - by axshon
    With Silverlight 4 and the Entity Framework you get a lot of work done on your behalf in terms of standard UI CRUD-style operations. Validations and I/O are pretty easy to accommodate out of the box. But sometimes you need to perform some long running tasks either on the client or on the server via service calls. To prevent your UI from hanging and annoying your users, you should consider placing these operations on a background thread. The BackgroundWorker object is the perfect solution for this...(read more)

    Read the article

  • Silverlight hierarchy gridview with MVVM

    - by Suresh Behera
    Since few days i have been struggling to bind a gridview from a simple WCF async call. Following article look promising… http://blogs.telerik.com/vladimirenchev/posts/09-10-16/how_to_silverlight_grid_hierarchy_load_on_demand_using_mvvm_and_ria_services.aspx I conclude binding is not simple traditional databind() method call from gridview if you don’t know howto ;) Thanks, Suresh...(read more)

    Read the article

  • Help with complex MVVM (multiple views)

    - by jsjslim
    I need help creating view models for the following scenario: Deep, hierarchical data Multiple views for the same set of data Each view is a single, dynamically-changing view, based on the active selection Depending on the value of a property, display different types of tabs in a tab control My questions: Should I create a view-model representation for each view (VM1, VM2, etc)? 1. Yes: a. Should I model the entire hierarchical relationship? (ie, SubVM1, HouseVM1, RoomVM1) b. How do I keep all hierarchies in sync? (e.g, adding/removing nodes) 2. No: a. Do I use a huge, single view model that caters for all views? Here's an example of a single view Figure 1: Multiple views updated based on active room. Notice Tab control Figure 2: Different active room. Multiple views updated. Tab control items changed based on object's property. Figure 3: Different selection type. Entire view changes

    Read the article

  • kendo ui filtering the grid table, need some idea

    - by cool_spirit
    I want to filter the table by last name, but cant work, here is my code in controller public JsonResult Filtering() { HealthContext rc = new HealthContext(); var last = rc.Profiles.Select(lastt => new SelectListItem { Text = lastt.LastName, Value = lastt.Id.ToString() }).ToList(); return Json(last.ToList(), JsonRequestBehavior.AllowGet); } in view <script type="text/x-kendo-template" id="template"> <div class="toolbar"> <label class="category-label" for="Last name"> by last name:</label> <input type="search" id="LastName" style="width: 230px"></input> </div> </script> and also <script> $(document).ready(function() { $("#grid").kendoGrid({ dataSource: { transport: { read: { url: "/Profiles/GetJsonData", dataType: "json" } }, pageSize: 10, }, toolbar: kendo.template($("#template").html()), height: 250, filterable: true, sortable: true, pageable: true, defaultSorting: 'LastName ASC', columns: [{ field: "Id", filterable: false }, { field: "FirstName", title: "First Name", width: 100, }, { field: "LastName", title: "Last Name", width: 200 }, { field: "Gender", title: "Gender" } ] }); var dropDown = grid.find("#LastName").kendoDropDownList({ dataTextField: "LastName", dataValueField: "Id", autoBind: false, optionLabel: "All", dataSource: { severFiltering: true, transport: { read: { url: "/Profiles/Filtering", dataType: "json" } }, }, change: function() { var value = this.value(); if (value) { grid.data("kendoGrid").dataSource.filter({ field: "Id", operator: "eq", value: parseInt(value) }); } else { grid.data("kendoGrid").dataSource.filter({}); } } }); }); </script> so the problem is the drop down list is not show up as well as the value/ data, any idea guys?

    Read the article

  • Kendo UI TabStrip with MVC3

    - by Dheyvendaran
    I was working on Kendo UI Grid. I need to work with Grid TabStrip. When the user clicks on the tabstrip it should get the currently selected Id and navigate to the next page. Sample code items.Add().Text("Add New Details").Action("action","controller", new { Id = "#=Id#" }) Here the Current Id is not getting properly. It always shows "/#=Id#". Please tell me How can i get the current selected Id to the above action.

    Read the article

  • What the best way to wire up Entity Framework database context (model) to ViewModel in MVVM WPF?

    - by hal9k2
    As in the question above: What the best way to wire up Entity Framework database model (context) to viewModel in MVVM (WPF)? I am learning MVVM pattern in WPF, alot of examples shows how to implement model to viewModel, but models in that examples are just simple classes, I want to use MVVM together with entity framework model (base first approach). Whats the best way to wire model to viewModel. Thanks for answers. //ctor of ViewModel public ViewModel() { db = new PackageShipmentDBEntities(); // Entity Framework generated class ListaZBazy = new ObservableCollection<Pack>(db.Packs.Where(w => w.IsSent == false)); } This is my usual ctor of ViewModel, think there is a better way, I was reading about repository pattern, not sure if I can adapt this to WPF MVVM

    Read the article

  • Learning WPF and MVVM - best approach for learning from scratch

    - by bplus
    Hello, I've got about three years c# experience. I'd like to learn some WPF and the MVVM pattern. There are a lot of links to articles on this site but I'm getting a little overwhelmed. Would a sensible approach for a begginer to be forget mvvm for a while and just quickly learn a bit a of WPF, then come back to MVVM? I had a leaf through this book in work today, it doesn't seem to mention MVVM (at least not in the index). I was pretty surprised by this as I thought MVVM was supposed to be the "lingua franca" of WPF? Also I've just started working at a new company and they are using MVVM with WinForms, has anyone come across this before? Can anyone recommend a book that will teach me both WPF and MVVM?

    Read the article

  • Suppressing a Kendo UI Grid selectable event when clicking a link within a cell

    - by Jensen Ching
    I have a Kendo grid that has links, which I also set to selectable, snippet here: columns: [{ field: 'link', title: 'Link', template: '<a href="${link}">Click Here</a>' }], ... selectable: 'row', change: function(e) { var rowUid = this.select().data('uid'); rowDs = this.dataSource.getByUid(rowUid); console.log('Went (1): ' + rowDs); return false; } When I click on the external link <a>, I also select the row. Is there any way to suppress the selectable event?

    Read the article

  • MVVM for Dummies

    - by Martin Hinshelwood
    I think that I have found one of the best articles on MVVM that I have ever read: http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/432/MVVM-for-Tarded-Folks-Like-Me-or-MVVM-and-What-it-Means-to-Me.aspx This article sums up what is in MVVM and what is outside of MVVM. Note, when I and most other people say MVVM, they really mean MVVM, Commanding, Dependency Injection + any other Patterns you need to create your application. In WPF a lot of use is made of the Decorator and Behaviour pattern as well. The goal of all of this is to have pure separation of concerns. This is what every code behind file of every Control / Window / Page  should look like if you are engineering your WPF and Silverlight correctly: C# – Ideal public partial class IdealView : UserControl { public IdealView() { InitializeComponent(); } } Figure: This is the ideal code behind for a Control / Window / Page when using MVVM. C# – Compromise, but works public partial class IdealView : UserControl { public IdealView() { InitializeComponent(); this.DataContext = new IdealViewModel(); } } Figure: This is a compromise, but the best you can do without Dependency Injection VB.NET – Ideal Partial Public Class ServerExplorerConnectView End Class Figure: This is the ideal code behind for a Control / Window / Page when using MVVM. VB.NET – Compromise, but works Partial Public Class ServerExplorerConnectView Private Sub ServerExplorerConnectView_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded Me.DataContext = New ServerExplorerConnectViewModel End Sub End Class Figure: This is a compromise, but the best you can do without Dependency Injection Technorati Tags: MVVM,.NET,WPF,Silverlight

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >