15,744,304 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 Javascript questions
View C++ questions
View Python questions
View Java 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 J. Calhoun (Top 19 by date)
J. Calhoun
28-Jul-18 16:44pm
View
Are you just looking for someone to code it for you or is there a point in which you need help? What have you tried?
For example if you wanted to create a button which selects a color, override mouse move with left mouse down, then constantly create a shape with the desired shape/size with a stroke/fill of that color would be one way to do it.
J. Calhoun
10-Feb-18 8:14am
View
Are you saying it is stopping at the statement con.open()? If so I believe it would be an issue with your connection string. First I would wrap your OleDBConnection logic in a Try/Catch, then when you debug if something was to break the catch would make it easier to debug, not to mention gracefully handle the error if there was to be one. Also judging by the + in your string, you don't have a space between the ; and Persist, which might be your issue.
J. Calhoun
10-Feb-18 8:04am
View
No worries! Glad I could help!
J. Calhoun
9-Feb-18 19:49pm
View
https://github.com/JACWagon/SampleMVVMExample
I posted a public repository here where you can download the example. If you have trouble getting it I can email you the project.
Basically I show the same structure you have, there are a couple of minor differences, but I also included an Execute Path project that you can copy and past that will help you with Commands when it comes to buttons. If you want to know more about how that works, Google ICommand it is a powerful interface that you can use in MVVM. I use it ALOT. Also, I am happy to answer any questions you have about that project.
J. Calhoun
9-Feb-18 14:14pm
View
In updating my solution, I noticed you don't need to extend ObservableObject from your model. And I put the loading of the list in the constructor, but you can use your CreateCheckboxList() instead. Either way shouldn't matter. With the datacontext set, then all of this should work. I threw together a test project real quick, and this all works fine.
J. Calhoun
9-Feb-18 13:50pm
View
In TestViewModel do you do
public TestViewModel()
{
CreateCheckBoxList()
}
J. Calhoun
9-Feb-18 13:06pm
View
I assumed you had set the datacontext if you are seeing that your listview is being populated by your itemssource? If you are setting your datacontext then the property should update, if you need a way to call GetSelectedCheckboxes() you could always set up a button, or some sort of command control to call it.
I typically never use the xaml.cs file as I just reference the viewmodel from the xaml.
xmlns:vm="clr-namespace:yourtestviewmodelproject"
Then put it in the datacontext
<Window.DataContext>
<vm:testviewmodel>
**there should be a closing datacontext tag here but when I type it it doesnt show for whatever reason**
or if you use the xaml.cs, then in the constructor you would just set
this.DataContext = new TestViewModel();
you can do it either way I just am kind of a purist that never uses a code behind.
If you do these things and it still doesn't work, let me know and I can make a quick sample project and show you.
J. Calhoun
31-Jan-18 13:44pm
View
More than likely if you just set the button's BorderThickness=0 and/or BorderBrush=Transparent then that border will go away.
I often create ResourceDictionaries for all of my controls in which you can override the default style and declare your own Template for any control. You should google creating a custom button control in WPF and you will see many tutorials on how to create a custom button control in which you can control every element of a button.
J. Calhoun
1-Jun-17 10:51am
View
Well if you are "Dynamically" generating this control, and you are making more than one text box with this code, you will have more than one textbox trying to register the name "txt_subject"; I would breakpoint the line where you set txt.Name and see how many times it tries to run that code.
J. Calhoun
4-May-17 16:04pm
View
I overlooked the "Settings Designer" part, my apologies. However I do have one more question. When you say you created one application scope, and one user scope, are you using just the startup project designer? Is it possible that you have those settings in more than one project? I set up a project and set my startup project with the same settings you have shown and it creates properly, working on other ways to try and recreate your problem. Also, in the app.config file you should see only one set of settings, if you manually edited that and did it in the designer that could cause a duplicate. So far all I have been able to do is created one user and one application setting, no duplicates :/
J. Calhoun
4-May-17 13:05pm
View
Did you break point the function that you are using to create the settings file? I don't know what your code looks like, but it sounds like you are calling it multiple times on start up maybe due to some inheritance calling the constructor that creates these settings multiple times?
J. Calhoun
18-Apr-17 16:03pm
View
What does your WindowSizeChangedCommand look like? Also, a tip, there was an issue that CommandParameter needed to be declared before the Command, I am not sure if that issue was resolved, or what version you are using but it is worth a try... but with command paramater declared first the relay should have something like "new RelayCommand(param => WindowSizeChange(param)); the param would be the CommandParameter that you passed in.
Also, I found that using width gave me NaN, but the property "Actual Width" gave me the actual number.
J. Calhoun
22-Nov-16 8:51am
View
Well, now users is a list so you could do one of two things, add another listbox inside of your grid view that has an item source of users and that is bound to Title1, or you can iterate through users and assign a property per title.
J. Calhoun
18-Nov-16 13:44pm
View
I was not able to see the link here at my location due to restrictions; however, from what I understand is when you are not selecting the combobox, you would like the style to look more like a textblock. The link that NotPolitcallyCorrect posted is the documentation on how a combobox is created from scratch; however you can change it without that much work. I would however create a control template in a resource dictionary that targets combobox. Then I would add a trigger on the control template that fires when the combobox does not have focus that changes the style of the template to look like a textblock.
>This is a less intense link of a combobox control template style.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/af2b067b-6416-4381-a7c1-63cf6f74b3aa/combobox-custom-controltemplate?forum=wpf
J. Calhoun
15-Nov-16 15:15pm
View
I was having trouble with that, but when I actually used the string it worked for me for whatever reason. But thank you for the reference as I will look further into it and have updated my solution to reflect the only thing I see that is missing that maybe could affect the binding.
J. Calhoun
15-Jul-16 12:30pm
View
This is hard to troubleshoot because I can't see how you are using these things so I am not sure the context of calculation, but judging that you are putting these properties in the view model then I am guessing that summary/total is something like the summary or total of the entire collection of RMAs/Escalations/Events.
Also, are these grids in separate views? So you are saying in each view model you would need something like Calculation {get; set;}
The way you can keep track of all of this is the observer pattern which Sunil Kumar explains here
Observer Pattern in .NET
[
^
] also Islam ElDemery has a good implementation
Design Patterns - Observer Pattern
[
^
] So each view model that needs to know about the OnChanged event could just register to that event so they will all update when needed.
Another thing I don't understand is Tickets.ViewModel.ObservableCollection<ticketsviewmodel> so you have multiple instances of the same View Model? Doesn't that break your bindings? There should only ever be 1 TicketsViewModel therefore shouldn't be a collection.
J. Calhoun
8-Mar-16 12:04pm
View
There was a similar issue that someone had where an unnamed style, or a style without a key, that was conflicting with the treeview. Could this be your issue? The description of the issue could be found
here
[
^
]
J. Calhoun
29-Jan-16 8:57am
View
It seems to me that you are trying to catch a text changed "Event", and your problem is that you are trying to just call a public function to get that event. The problem here is that every time you rebuild the control you are using the "new" keyword. It would be my suggestion that you would set up a delegate/event that would fire when the user control uses its text changed function. This is known as the observer pattern. You could then register these events on the forms where you would want to listen for that text changed event.
J. Calhoun
29-Sep-15 13:23pm
View
We are not going to write all the code for you; however, if you would like to post your code and explain where you are having difficulty we can help to correct your issues. With that being said if you need help on where to start with creating a data grid I found this article by David Veeneman on this very site that might help you.
http://www.codeproject.com/Articles/42548/MVVM-and-the-WPF-DataGrid
Show More