15,911,786 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Marvin Ma (Top 40 by date)
Marvin Ma
30-Oct-13 5:36am
View
Define a property which handles the visibilities (e.g. UserControlVisibility) and BIND this to the visibility property of your user control.
You have to use the BoolToVisibilityConverter.
The property you created (UserControlVisbility) will be set if you select an item of your list (in your case the name).
Make sure to switch the visibility when no name is selected (have a look at selected item).
Now, try to write this logic...I could to this for you, but this would not have any learning effect to you.
Remember: Learning by doing!
Marvin Ma
30-Oct-13 3:39am
View
The fact that you are using a user control allows you to use the routed event of the list box, because you do not produce code behind in your view.
You handle the code within your user control.
Same is valid for a custom control.
Marvin Ma
29-Oct-13 10:22am
View
Yeah, sorry wanted to edit that, but you have been faster.
The list box has the events you are looking for:
SelectionChanged for example.
If the event got fired, just set the visibility, this is not the 'cleanest' way, but If you are new to MVVM, this would be the first step.
Marvin Ma
29-Oct-13 10:12am
View
You could define a property to handle the visibilities.
Also define a command or routed event to handle the button click, which sets the property to the value you want.
Try for yourself, it's simple.
If you need help, just ask.
Marvin Ma
29-Oct-13 6:26am
View
Edited my solution.
Marvin Ma
29-Oct-13 6:09am
View
The text you enter in your text box is bound to your property, which you have to add to your collection because your list box needs an item source.
There are two possibilities for the add functionality for the button:
1) use a routed event
2) use a delegate command
I would prefer the second option because if you're using MVVM this would be the right way because you shouldn't have any code behind in your view.
Are you familiar with delegate commands?
Marvin Ma
29-Oct-13 5:15am
View
I edited my solution.
Marvin Ma
28-Oct-13 6:11am
View
Try to Deserialize the XML document and convert the byte[] to image.
Marvin Ma
25-Oct-13 9:31am
View
Ok, if it is really an Image you just can invoke your method and pass this image...
imageToByteArray(yourImage)
Marvin Ma
25-Oct-13 9:26am
View
Where do you get the Image from?
From your hard disk?
Marvin Ma
24-Oct-13 3:25am
View
DO you have to do it in code or is XAML also possible?
Marvin Ma
8-Oct-13 5:49am
View
Thank you for your answer...this worked for me :)
Marvin Ma
1-Oct-13 3:18am
View
It's not the solution to your Problem but a little tip:
You could source out the if-statement in a method, so you save some writing work.
E.g:
public void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyname));
}
}
Then in your setter, you could just call NotifyPropertyChanged("YourProperty");
Marvin Ma
10-Sep-13 3:51am
View
Have a look at this and try on your own first:
http://msdn.microsoft.com/en-us/library/2s05feca.aspx
Marvin Ma
10-Sep-13 3:09am
View
Any work done yet ?
Marvin Ma
6-Sep-13 9:13am
View
Good to hear, that you found a solution :)
And thank you for your kindly words.
Marvin Ma
6-Sep-13 8:00am
View
Would like to know that, too.
Why would you like to reinvent the wheel ?
Marvin Ma
6-Sep-13 7:41am
View
I did.
Marvin Ma
6-Sep-13 4:49am
View
Have a look at this one:
http://stackoverflow.com/questions/2300757/c-sharp-api-for-ms-word-equation-editor
Marvin Ma
6-Sep-13 4:07am
View
Could you post the code for Form2 please?
Marvin Ma
6-Sep-13 3:51am
View
Do you only want to compare if they're equal to each other?
Marvin Ma
6-Sep-13 3:23am
View
You could have a look at this article:
http://wpf-mettyz.blogspot.de/2012/01/datagrid-with-datagridcheckboxcolumn.html
It explains how to check all check boxes with the one in the header, so you could set this one in code and all rows with data will be checked, too.
Got what I'm trying to explain?
Marvin Ma
6-Sep-13 3:14am
View
Is there a check box in each row of the table?
Marvin Ma
6-Sep-13 2:57am
View
For understanding: You have a text box in the column header and want it to be checked if the data from database were loaded succesfully?
Let me know if I'm right.
Marvin Ma
6-Sep-13 2:35am
View
“conversion faild when converting the nvarchar value ‘Gold’ to data type int.”
Try to change the data type in your database's column, where 'Gold' is saved to int.
I dont't know if this works but you could give it a try.
Marvin Ma
5-Sep-13 6:41am
View
Have you done any work yet?
Marvin Ma
5-Sep-13 5:52am
View
So, you want the buttons to be disabled when the application updates?
I hope i got it correctly?
Marvin Ma
5-Sep-13 4:48am
View
You should solve this problem by using binding, if you are familiar with this.
So you could bind the text property one way to the selected item in your datagrid.
Marvin Ma
5-Sep-13 3:49am
View
Have a look at this article:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/57c2a1ac-d4f1-41c6-850f-264d30a873cb/how-to-insert-content-of-data-table-to-database
I hope it helps :)
Marvin Ma
4-Sep-13 6:43am
View
Deleted
I think he wants to do this with binding.
Marvin Ma
4-Sep-13 6:34am
View
Deleted
Can you post your code please, so I can try to help you.
Dont forget the XAML please.
Marvin Ma
4-Sep-13 4:00am
View
Please post your code.
Marvin Ma
4-Sep-13 3:43am
View
Are you familiar with binding?
Would be the easiest way to handle your Problem.
Marvin Ma
3-Sep-13 4:57am
View
Deleted
Seems logical to me.
Marvin Ma
3-Sep-13 4:02am
View
The relevant part of your code would be nice to see, so we can help you.
Marvin Ma
2-Sep-13 10:08am
View
Could you post your code please?
Marvin Ma
27-Aug-13 6:37am
View
You should check the payment values for null before calling your method.
Marvin Ma
27-Aug-13 2:50am
View
Did you mean a ComboBox?
Marvin Ma
21-Aug-13 5:17am
View
Sorry, but I really can't get, what you're trying to achieve.
Maybe you could just describe what you're expecting of your program.
Marvin Ma
21-Aug-13 4:21am
View
So, would like the upper Snippet to work like the lower?
Show More