Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8786991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:46:22+00:00 2026-06-13T21:46:22+00:00

If, lets say I have a FormA with a ListView and an Update() function.

  • 0

If, lets say I have a FormA with a ListView and an Update() function. Then I also have one Math-Class with a function A() wich does some magic… Can a delegate be used to call Update() from A()? Or Is there a better way? I’ve realized it’s risky to update a gui form from another class…. Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:46:24+00:00Added an answer on June 13, 2026 at 9:46 pm

    Yes. Its not that risky as long as the Math class has no knowledge of what its actually calling. You just give it a rough idea by pointing it to the desired function from your Form:

    public class MathClass {
        public Action FunctionToCall { get; set; }
    
        public void DoSomeMathOperation() {
            // do something here.. then call the function:
    
            FunctionToCall();
        }
    }
    

    In your form you would do this:

    // Form.cs
    public void Update() {
         // this is your update function
    }
    
    public void DoMathStuff() {
        MathClass m = new MathClass() { FunctionToCall = Update };
        m.DoSomeMathOperation(); // MathClass will end up calling the Update method above.
    }
    

    Your MathClass calls Update, but it has no knowledge of the object that told it to call Update or where Update is.. making it safer than tightly coupling your objects together.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have some view models set up as follows: public class User
So lets say I have some forms like this: Form A: <form name=formA> <input
This one is driving me crazy:-) Lets say I have some test xaml code:
Lets say I have two tables, one for transactions, and another table who's primary
Lets say I have a 3D model of room in some format. How can
Lets say I have some domain objects that will need to be serialized/packed using
Lets say we have the 10 integers from 1 to 10. We also have
I have a question concerning multiple similair forms on one page. Lets say you
Lets say I have three webpages - one for big cars, one for middle
Lets say I have a form: <form id=form1 method=post> <ul> <li class=button> Button 1!

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.