For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
Twice in my code. One draws a blue line (which works, exact same code but different collection), and this one draws a yellow line. However, as per my code, it WILL draw the line (although a dotted line, which as actually kind of a cool effect for what I'm going for), but only when I add the +1 to x1.
I have verified all my data is being read. Why is this happening? Thanks.
I have an xsd defined dataset which I use as the data class to send data back and forth between presentation layer and model/controller layer. For the same result, based on user selection of unit: U.S. v.s. Metric, I need to display differently. I am thinking to use xslt for the transformation, any suggestion? the software is an engineering calculator written in c# and used WPF. I have about 1000 data points in each calculation result, the original result is in U.S. units, if user select Metric, I need to flip to metric unit, but don't need to do the calculation again.
It really depends on how you want to display your data. Is it going to change frequently or are you just going to get it once and display it (switching backwards and forwards between the Metric/US version as appropriate). If it's just going to be a one off retrieval of the data and you don't need high resolution of your data, you could simply bind the data directly to the UI and use a value converter (a class that implements IValueConverter) to convert the data to US units if necessary, or just return the raw data if it's Metric.
My dataset is in U.S unit, if user select Metric, I will capture metric input and converted to U.S. units and populate the dataset. The U.S. dataset is passed to model/controller to get the ouptput dataset also in U.S units, before display the result dataset back, if it is in Metric, I need to convert to metric. Currently the dataset is bound to WPF controls, directly e.g. and in U.S unit alone. I am going to look into ValueConverter.
If you convert them yourself, you'll need to convert all of them. You really only care about the ones the user is looking at. If you have 100,000 items and the user only looks at 100, there is no need to do the computations to convert the rest. The IValueConverter will accomplish this for you. It'll only call in to do the conversion on whats needed by the UI. Small optimization, but can make a huge difference in performance.
There's a couple of ways you could do this. One way is to hook into the property itself and call the method when you're changing the value. The other way is to use RX to observe the property and call the method whenever the property changes. There's a pretty decent primer here[^] that should give you a heads up.