Showing posts with label MVVM. Show all posts
Showing posts with label MVVM. Show all posts

How to: Make XAML Content Localizable WPF application

Posted by Nantharupan on 10:22 AM in , ,
You may want to localize your XAML content by supplying resource string for XML attributes.
For example you may want to change Content of a button :
 <Button Content="Search">  </Button>

To Make Content Localizable

  1. Create a new resource file.
  2. Make the access modifier of the resource file to public.
  3. create a class that has a public constructor  Define a property that points to the resources. 
  4. Open the App.xml file and add the following to the <Application.Resources> section:
  5. To make the Content Localizable; replace the string with 



0

How to develop a Simple MVC Architecture Java Application

Posted by Nantharupan on 11:49 PM in , , ,
There are a lot of architecture in the Software industry. Basically features of most  architecture  is reduce the coupling between View and Logic. By using that we can change the view when ever we want and keep the logic same.

Some of the Architectures are

1. MVC- Model View Controller
2. MVVM- Model View ViewModel


I have been working in MVC architecture in .NET web application and MVVM  architecture  in WPF desktop application, and Mono Develop Mobile application.

When i try to develop java based desktop application, i tried to do the MVC architecture using help from internet.

Basics of MVC













M-Model
V-View
C-Controller

Model Class

Which will contain the logic of the application and data base connection and manipulation.



View Class

View will be contains the User Interface part only.

Controller

Controller will do the communication part between View and Model
<
Main Method



1

Page Navigation in WPF MVVM

Posted by Nantharupan on 3:02 AM in , ,
When i tried to follow MVVM architecture in WPF, i faced the challenge of how to do Navigation to pages in Frame. finally i figured it out in the internet.

You need to have  a navigator class like following,



In your App.xml.cs file under the OnStartup method put the following code





Now you can call any pages in the ViewModel like the code follows


Happy Coding



0

Password Box WPF

Posted by Nantharupan on 10:00 AM in , ,
WPF text box doesn't have password mode, for the password purpose WPF have another control called password box.

To get the entered text use
password property of the password box. 

example

string enteredpassword =passwordBox.Password;

 if we use MVVM architecture We can't bind to public property of our View Model. Still we can do one thing to maintain MVVM, we can set the public property for the password box change event. 

Popular posts

Copyright © 2009 On the way All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.