How to call a method from one viewmodel to another viewmodel

Hi,
I have a functionality in first viewmodel , i need the functionality to be functioned in the second viewmodel . How can i do that . Help would be much appriciated .
Jeevan Vinay

Perhaps derive both of the classes from common base. The common functionality and data will be defined (moved) inside the base class.

Similar Messages

  • How to call a function from one viewmodel to another viewmodel

    Hi ,
    How to call a funtion of another viewmodel in a viewmodel . This help would be much appreciated
    Thank You
    Jeevan Vinay

    Please close your previous threads by marking helpful posts as answer before you start a new one.
    You need to either get a reference to the second view model from the first one or you could use some kind of messenger or event aggregator to pass a message from the first view model to the second one. The latter approach is preferable as it doesn't create
    a tight coupling between the two view model classes.
    Please refer to my blog post for more information and an example of how to use Prism's EventAggregator to do this:
    http://blog.magnusmontin.net/2014/02/28/using-the-event-aggregator-pattern-to-communicate-between-view-models/
    You will need to download and install Prism to be able use the EventAggregator class:
    https://www.nuget.org/packages/Prism/
    Another popular framework out there is the MvvmLight which contains a Messenger class that works pretty much the same. Andy has provided and example of how to use this one:
    http://social.technet.microsoft.com/wiki/contents/articles/26070.communicating-between-classes.aspx
    You can download and install MvvmLight via Nuget (Tools->Nuget Package Manager->Package Manager Console in Visual Studio):
    https://www.nuget.org/packages/MvvmLight/
    Please remember to close your threads by marking all helpful posts as answer and then start a new thread if you have a new question.

  • How to call a form from one form to another form with parameter..

    i'm having a from that will shows the info about the orders that the client has. and i want to show the information of the client. for that i have created one form and i want to call the form from my current form with the given client name as a parameter. then the client_info form has to query with the given parameter. so im passing the :client_order_info.client_name as parameter to the call_form('client_info.fmx',:client_order_info.client_name); but my question is how to access that parameter in the client_info form.. plz help me.. i tried a lot ..

    Create a parameter (object navigator -> parameters) with the name client_name and you can access that value in your client info form using :PARAMETER.client_name.
    P.S. while calling you can pass parameter using 'cilent_name =>' to make sure that the correct parameter is getting assigned to the value.

  • How to call a method of one dc in another dc

    Hi,
          i have two dcs dc1 and dc2
    i want to call the method of dc1 interface controller in component controller of dc2
    plz help me, how to acheive it
    Thanks & regards,
    v santhosh

    Hi Vanama,
    Hope you have defined a method say method1() in interface controller of DC1
    Add this to public part.
    In DC2 , set DC1 as used DC.
    give <DCUsageName>
    now you can access the method in DC1 like this.
    wdThis.wdGet<DCUsageName>().getmethod1();
    Regards,
    Murtuza

  • Calling Parameterized Method from one class to another class

    Hi, below is my sample code
    test.java
    public class test
         int op1[][]=new int[][]{{1,2},{2,3},{4,5}};
         int row=0;
        public void  test() {
              int op2[][]=new int[][]{{2,3},{4,5},{6,7}};
                             row=1010;
              getRow(row);
        int[][] getList()
             return op1;
       public  int getRow(int klm)
             System.out.println("Row Value in GetRow Method  is:     "+row);
             return klm;
    test_2.java
    package aa;
    public class test_2
    int a;
         test t11=new test();
         int abc[][] = t11.getList();
         int rowCount=t11.getRow(a);
         public void test_2()
              System.out.println("Row Value is:     "+rowCount);
              System.out.println("Value in abc[1][1] is:     "+abc[0][1]);
    main_class.java
    package aa;
    public class main_class {
         public static void main(String args[])
              test ab=new test();
              ab.test();
              test_2 ba=new test_2();
              ba.test_2();
        public main_class() {
    }now that my question is,for 'rowCount' in class test_2.java i need to get the value of 'row'(which is 1010)from class test.java. How could that be done?
    Any reply is highly appreciable.
    Thanks in advance

    netbeans2eclipse wrote:
    hmm, i did chaged the test object in main method to same as the test object that i used in test_2 (ie; i changed test ab=new test() in main_class.java to test t1=new test()).What? How does this help?
    Again, simplify the problem
    For instance, say you have a class, Fubar1, like so:
    class Fubar1
      int value = 0;
      public void setValue(int v)
        value = v;
      public int getValue()
        return value;
    }and two different Fubar2 classes, both which try to get the value from Fubar1, one doing it badly:
    class Fubar2Bad
      Fubar1 f1 = new Fubar1(); // totally internal Fubar1 object
      public int getFubar1Value()
        return f1.getValue();
    }and one that does it well, that holds a reference to whatever Fubar1 object is passed to it:
    class Fubar2Good
      Fubar1 f1;
      public Fubar2Good(Fubar1 f1)
        this.f1 = f1;
      public int getFubar1Value()
        return f1.getValue();
    }Then if you test these:
    public class TestFubars
      public static void main(String[] args)
        Fubar1 f1 = new Fubar1();
        f1.setValue(35);
        Fubar2Bad f2Bad = new Fubar2Bad();
        Fubar2Good f2Good = new Fubar2Good(f1); // here we pass a reference to the main's Fubar1 object into the Fubar2Good object.
        System.out.println("Bad: " + f2Bad.getFubar1Value());
        System.out.println("Good: " + f2Good.getFubar1Value());
    }

  • How to call  a method of one view in other view

    Hi
      could any one suggest "how to call  a method of one view in other view "
    thanks
    kaushik

    Hi Kausic,
    Its not possible to call a method from view to View.
    Since view is private entity we can not pass the data directly.
    I suggest you to declare the method in Component/Custom controller and call.
    the code is,
    wdThis.wdGet<Component/Custom Name>Controller().<methodName>();
    Regards,
    <b>Ramganesan K</b>

  • How to call java method from workflow script?

    Hi
    I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
    Is there any alternative better way to achive this requirement from workflow? Please suggest.
    Thanks,
    Sarang

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • How to get a value from one item into another

    How can i get value from one item into another item.
    Ex: I have a report, in there i have check boxes, and when i have checked some rows, and press submitt, a prosses computates it into a item on another page, and a branche redirects to page 3. Then i'm going to use the value in the item into a PL/SQL script in an report to show the submittet items.
    How can i do this?
    Computation script, pages and all that is fixed. But i dont know which PL/SQL statement to use to get th value from the item.

    Hi Fredr1k,
    Use the V() function from pl/sql.
    e.g. V('P3_MY_ITEM')
    will return the value of that page item.
    As long as the pl/sql is called from within the Apex environment.
    Regards
    Michael

  • How do I transfer iTunes from one computer to another?

    How do I transfer iTunes from one computer to another?

    This really depends on how technical you want to get, and how much of the library data you want to retain. First, there is getting the actual song files over to your new computer. If both computers are on the same network and are on iTunes 9, you can use home sharing to transfer the song files to your new computer.
    Once the files are transferred, now you have to get all of the metadata transferred, like Playlists and Song Ratings. There is a method for doing this that involves editing your Library.xml file to transfer Playlists, Playcounts, etc..
    If all you want to transfer is your Playlists and song files, there are programs that will back up your playlists so you can transfer them to a new computer, but if you're able to do the above XML edits (which are pretty simple), that is preferred (and cheaper).
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • How do i download music from one ipod to another ipod

    how do i download music from one ipod to another ipod ?

    It needs to go through your computer's iTunes library.  If all the songs on the iPods are already in your computer's iTunes library, just sync each iPod as desired from your iTunes library. 
    If the songs on your iPods are not in your iTunes library, the approach here is to first off-load the song files from the iPods to your computer's hard drive.  Then, add the song files to your iTunes library, so that it is "consolidated" with ALL of your music.
    You cannot transfer song files from iPod to computer using iTunes, except for songs purchased from the iTunes Store.  However, there are third-party methods and utilities that can transfer from iPod to computer.  If you do an Internet search on something like "ipod transfer," you should get some links.
    Once you have ALL of your music in one iTunes library on your computer, sync your iPods as desired.

  • HT1329 How do I transfer playlists from one ipod to another?

    How do I transfer playlists from one ipod to another?

    It needs to go through iTunes.  But there is no way to transfer songs from iPod to iTunes library (except for music you purchased from iTunes Store).  However, there are third-party methods and utilities that can transfer from iPod to computer.  If you do a Google search on "ipod transfer," you should get some links.
    Once the song files are on your computer, add them to your iTunes library.  You can then sync your iPhone to the iTunes library.
    Alternately, if you sign up for the iTunes Match service, your iTunes music library on your computer will become available from iCloud.  You can set your new iPhone (assuming you bought a "new" iPhone) to sync from iCloud, instead of from your computer's iTunes.  All of your music will be available wirelessly, wherever you have an Internet connection. 

  • Calling a drawLine() from one class to another from an ActionEvent

    I have several JPanel objects called and placed on a JFrame. The JFrame has a RadioButton group with radio buttons. If I select a radio button and call a drawLine() method from a JPanel, I receive a "NullPointerException". Is it not possible to call this graphic method from one class to another?
    Thanks for any input you can provide.
    John

    Remember that each panel draws it's own current state. So you need the ActionPerformed to change the state in your target panel.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class PanelComm extends JPanel {
      private SubPanelOne subPanelOne = new SubPanelOne();
      private SubPanelTwo subPanelTwo = new SubPanelTwo();
      public class SubPanelOne extends JPanel {
        public SubPanelOne () {
          setLayout ( new BorderLayout() );
          setBorder ( BorderFactory.createTitledBorder ( "SubPanel One" ) );
          Reactor     reactor    = new Reactor();
          ButtonGroup group      = new ButtonGroup();
          JPanel      radioPanel = new JPanel(new GridLayout(0, 1));
          JRadioButton buttonOne = new JRadioButton ( "One" );
          buttonOne.addActionListener ( reactor );
          group.add ( buttonOne );
          radioPanel.add ( buttonOne );
          JRadioButton buttonTwo = new JRadioButton ( "Two" );
          buttonTwo.addActionListener ( reactor );
          group.add ( buttonTwo );
          radioPanel.add ( buttonTwo );
          JRadioButton buttonThree = new JRadioButton ( "Three" );
          buttonThree.addActionListener ( reactor );
          group.add ( buttonThree );
          radioPanel.add ( buttonThree );
          add ( radioPanel ,BorderLayout.LINE_START );
        protected void paintComponent ( Graphics _g ) {
          super.paintComponent ( _g );
          Graphics2D g = (Graphics2D)_g;
          g.setRenderingHint ( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
      public class SubPanelTwo extends JPanel {
        private JLabel text = new JLabel();
        public SubPanelTwo () {
          setLayout ( new BorderLayout() );
          setBorder ( BorderFactory.createTitledBorder ( "SubPanel Two" ) );
          text.setFont ( new Font ( "Verdana" ,Font.PLAIN ,30 ) );
          text.setHorizontalAlignment ( JLabel.CENTER );
          add ( text ,BorderLayout.CENTER );
        protected void paintComponent ( Graphics _g ) {
          super.paintComponent ( _g );
          Graphics2D g = (Graphics2D)_g;
          g.setRenderingHint ( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
        public void setChoice ( String cmd ) {
          text.setText ( cmd );
      public class Reactor implements ActionListener {
        public void actionPerformed ( ActionEvent e ) {
          subPanelTwo.setChoice ( e.getActionCommand() );
      public PanelComm () {
        setLayout ( new GridLayout ( 1 ,2 ) );
        add ( subPanelOne );
        add ( subPanelTwo );
      //  main
      public static void main ( String[] args ) {
        JFrame f = new JFrame ( "Panel Communication" );
        f.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
        f.getContentPane().add ( new PanelComm() ,BorderLayout.CENTER );
        f.setSize ( 320 ,120 );
        f.setVisible ( true );
      }  // main
    }

  • How can I transfer work from one computer to another?

    How can I transfer work from one computer to another?

    Welcome to the forum.
    I can think of three basic ways to accomplish what you wish to do:
    Use the Project Archiver to archive your Project (and check the box to gather the media files), to an external HDD. Probably the easiest way to do it.
    Copy the Project and ALL media files to an external HDD, but be prepared to relink the media files to the Project, as the drive letter (part of the Absolute Path) will have changed.
    Edit loosely, and Share to an AV file, which will be Imported into a New Project on that second computer. Or, edit VERY tightly, and do the same. I like the first, as removing, replacing Transitions, etc., can be much more difficult, unless that "tight edit" is 100% done.
    Good luck,
    Hunt
    Message was edited by: Bill Hunt to correct formatting

Maybe you are looking for

  • Need help on sql on full month

    Hi, I have one table as below: Table name: Information staff_number date clock_in clock_out remark I want to create sql that will list down all date for staffnumber selection Select staff_number, date, clock_in, clock_out, remark from information whe

  • Create an Excel format file in background w/DATASET Cmds?

    I have heard that you can create a file into an excel format file in background mode using dataset commands - anyone know how to do this?  Thanks!

  • Adobe Elements 11 on Mac OSX 10.9 has crashed. What should I do?

    I opened Elements 11 today and tried to open a photo from my file, and instead of opening it stops responding, I even have to force quit because all options are greyed out. This has never happened before. What should I do?

  • Win Server 2003 DC repair the Schema owner

    Hello, I prepare a new server on Win 2012 R2 64b to add to our DC, with 2 Win Server 2003 R2 32b. At the begin, I view the configuration of the actuel DC / W2003, but I see some trouble : - Dcdiag         Warning: CN=NTDS Settings\0ADEL:d96382dc-30df

  • Want to change the alias for guest user

    Hi All,            I am creating one application in portal where i am displaying the guest user as default but for displaying guest user i have to hit the https://portal-dev.freescale.net/irj/portal/anonymou URL.            Is there any way to load t