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.
Could you please help me figure out how I could bind "SelectedItems" of a listbox?
Here I have a 'listbox_2' that contains a list of fruits and vegetables
There's another 'listbox_1' that contains groups of fruits and vegetables (under a list<of string=""> format...maybe is it my first error? Should it rather be a list of fruits/vegetables?) and a recipe.
I would like that on each group selection (in listbox_1), the corresponding fruits and vegetables would be selected (in listbox_2)...and make it possible to modify that list
As far as I can see, the Microsoft version has been abandoned.
The GitHub fork is more up-to-date, but it hasn't been updated since July 2017. It also has no documentation, since they were relying on the CodePlex documentation for the original Microsoft version.
There are some suggestions for alternatives - both free and commercial - in this StackOverflow thread[^]. A lot of the answers are quite old, but the top answer was edited a couple of weeks ago, so it's hopefully still relevant.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
In my utility WPF library I (reinvented the wheel, yeah yeah, I know..) created a Behaviors attached property of type BehaviorList.
static DependencyPropertyKey BehaviorsKey = DependencyProperty.RegisterAttachedReadOnly(
"PrivateBehaviors", // REMARK: name is different from property to force GetBehaviors() calltypeof(BehaviorList),
publicstatic DependencyProperty BehaviorsProperty = BehaviorsKey.DependencyProperty;
publicstatic BehaviorList GetBehaviors(DependencyObject target)
var result = (BehaviorList)target.GetValue(BehaviorsProperty);
if (result == null)
result = new BehaviorList(target);
then I used this property in XAML to add my own custome behavior type:
This works well and good (at runtime) but the designer has red underlines and show the following errors:
Error XLS0503, A value of type 'DragLayerGroupBehavior' cannot be added to a collection or dictionary of type 'BehaviorList'.
Error XDG0048, The specified value cannot be assigned to the collection. The following type was expected: "Behavior".
So the question is, how to "solve" those errors, i.e. unconfused VisualStudio WPF designer?
Is there a particular interface I need to implement, some attribute to use, or something?
I have four controls in a horizontal row.
The first and third control shouöd automatically resize and fill the available space when resizing the MainWindow. The second and forth controls have a static width and I don't want them to change horizontally in size. All four controls should fill vertically.
I have almost solved it with an UniformGrid as container for the four controls.
The columns in a UniformGrid will always be the same width. Since you have four columns, each column will be ¼ of the width of the window. The controls with a defined width are aligned in the centre of the column, which is why you're getting white-space around them.
The obvious option would be to use a standard Grid. This would require adding column definitions, and setting the Grid.Column attached property on each child control.