Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF TextBox.Text VS Variable

$
0
0

There is a textbox myTextBox in my WPF application.

The myTextBox.Text value is used by a button function for a few times.

I would like to know is there any difference in PERFORMANCE and MEMORY USAGE for the following cases:

a) Directly use myTextBox.Text for a few times

Call functionA(myTextBox.Text);

Call functionB(myTextBox.Text);

or

b) Declare a variable first then use it in the latter part

string str = myTextBox.Text;

Call functionA(str);

Call functionB(str);

Thanks.

It would be great if any reference link or further reading for such information.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>