|
I was thinking about binding to the ListView but the problem I had was that the user has the option to Add/Edit/Remove (all buttons on the view) a parameter, and I couldn't figure out how to add a new parameter and still have it be bound. Does that make sense? Can I email you offline? I would like to discuss this offline with some screen shots of what I am trying to duplicate.
modified on Friday, March 6, 2009 12:46 PM
|
|
|
|
|
I do not think it is a good idea to share yur email id in public.
|
|
|
|
|
OK well I modified that post. But is it possible that we could continue this offline?
|
|
|
|
|
I am a dedicated member, always available at CP
|
|
|
|
|
OK I am going back through now and trying you recommendations and this is the error that I am getting in the Output window
System.Windows.Data Error: 39 : BindingExpression path error: 'Name' property not found on 'object' ''ParameterName' (HashCode=62178992)'. BindingExpression:Path=Name.ParameterDisplayName; DataItem='ParameterName' (HashCode=62178992); target element is 'ComboBox' (Name='cboParameterName'); target property is 'NoTarget' (type 'Object')
|
|
|
|
|
OK I have finally figured it out, but it really is a different work around. Or at least it seems like it. If instead of creating the ParameterName objects with all of the properties associated with it, if I only create a collection of strings and then bind them to the dropdown box then I can make the binding work. But it is not the object itself it is only one piece of the object.
|
|
|
|
|
I am suprised it does not work while binding to the the string property of the object. Well, if it is so, you can use a converter taking the object and returning a string for it rather than having to have a string collection. Which particular binding was failing, the one in the combobox DataTemplate ? I still feel that your data was not being populated correct.
|
|
|
|
|
babongita wrote: but any item bound to an object (in this case a Combobox) that attribute is not populated
The above statement confuses me. It says any item bound to the object is not populated. You mean never or again just when you do something from code ?
|
|
|
|
|
OK, There is a listbox below, which is bound to Collection of Parameters(this is a class, not what you would typically think of when you think parameters), then there is a "view" above it which shows the "detail" (attributes) of the SelectedItem in the listbox. All of the TextBoxes or the CheckBoxes show the "detail" (attributes) correctly. But when the "detail" (attribute) is an item in a Combobox the item doesn't show in the Combobox even though it is bound to that "detail"(attribute). The combobox is populated with all of the possible selections, but the SelectedItem, isn't shown in that combobox.
|
|
|
|
|
I think that you are missing the ElementName in the ItemsSource Binding. In this case the ElementName is the x:Name of your window or UserControl.
<combobox x:name="cboParameterName" xmlns:x="#unknown">
IsSynchronizedWithCurrentItem="True"
TabIndex="10"
Grid.Column="1"
Grid.ColumnSpan="4"
ItemsSource="{Binding Path=ParameterNameCollection, ElementName=UserControl, Mode=Default}"
SelectedValue="{Binding SelectedParameter.Name}"
Style="{DynamicResource BaseComboBox}">
<combobox.itemtemplate>
<datatemplate>
<textblock text="{Binding ParameterDisplayName}">
|
|
|
|
|
No, he is using DataContext of the parent implicitly.
|
|
|
|
|
on a side note this happens with all of the comboboxes, but I have them all coded the same so I have the same issue.
|
|
|
|
|
|
When are you calling OnMouseUp ? Taking a guess, I think you do not need it. Looks like OnMouseDown and OnMouseMove are doing what you want ??
|
|
|
|
|
|
Prajeesh wrote: StartPoint = Args.GetPosition(PhotoBox);
In the MoveDown event, what is PhotoBox? shouldn't it be DrawingCanvas ?
I did the same thing you are doing, on the MouseMove and MouseLeftButtonDown event of the Canvas, and I never got any extra lines.
|
|
|
|
|
|
private void OnMouseMove(object Sender, MouseEventArgs Args)
{
if (Args.LeftButton == MouseButtonState.Pressed)
{
EndPoint = Args.GetPosition(DrawingCanvas);
DrawLine(StartPoint, EndPoint, DrawingCanvas);
//do not reset the startpoint
//StartPoint = EndPoint;
}
}
And in your DrawLine method, delete the old line before adding the new line.
|
|
|
|
|
|
Searching for the control and removing it from the Children collection.
Something like this,
Line previousLine = null;
foreach (UIElement child in TargetCanvas.Children )
{
if( child is Line)
{
previousLine = child as Line;
break;
}
}
if (null != previousLine)
{
TargetCanvas.Children.Remove(previousLine);
}
please update it to fit your needs.
|
|
|
|
|
|
Yes, I hope you can build ahead from the help you have been provided. What you could do is generate a new line name everytime you start drawing and use that line name in the MoveMouse for adding the new line and also for deleting the existing line.
|
|
|
|
|
I'd leave it if I were you. It looks like he wants you to give him the complete code.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
I reminded him about the advise you had provided him few posts ago, but he doesn't seem to pay any heed to it.
|
|
|
|
|
I have a WPF application (client/server). i had created .exe file. when i install it on my client box it will install all the the dll's in the program files/manufactuere/ productname folder.It will install dll's of different languages also( spanish dll's in ES folder, portugese dll's in pt folder in program files/manufactuere/ productname)
What i need is when client is installing it i need to give him an option to select the language. based on the language it should install the concerning dll's in the client box.
Setup project is not giving any option to select language.
Please help thanks.
i used this article.
http://www.eggheadcafe.com/conversation.aspx?messageid=32327069&threadid=32327069
i did whole steps accordingly but when i try to install setupEn.msi its displaying in chinese.
i was wondering i am still not getting options for selecting the language.
|
|
|
|