Hello,
today, I've got this question: How can I link 2 combox box? The objective is to link a french material with and English Material for example.
So I create an xml to get a table with the english and french material associated like this:
My xaml looks like this to get the xml list in my combo box:
<XmlDataProvider x:Key="myMaterial" Source="C:\ProgramData\Autodesk\Vault 2014\Extensions\DataStandard\CAD\Configuration\myMaterial.xml"/>
<ComboBox x:Name="Material_FRA" Grid.Column="1" ItemsSource="{Binding Source={StaticResource myMaterial}, XPath=/myMaterial/Material}" DisplayMemberPath="@FRA" SelectedValuePath="@FRA" SelectedValue="{Binding Prop[Material_FRA].Value}"/>
I create an event in my PowerScript to get back the value.At this time I have no idea to get the value of the selectedindex.
# Event Material
$Prop
["Material_FRA"].add_PropertyChanged({
param($parameter, $source)
if($source.PropertyName -eq"Value") {
Material_Update_FRA}
})
$Prop
["Material_ENG"].add_PropertyChanged({
param($parameter, $source)
if($source.PropertyName -eq"Value") {
Material_Update_ENG}
})
# Update Material
function
Material_Update_FRA
{
$FRA=$Prop["Material_FRA"].Value
$Prop["Material_UPDATE"].Value =$FRA
}
function
Material_Update_ENG
{
$code=$Prop["Material_ENG"].Value
$Prop["Material_UPDATE"].Value =$code
}
So my questions are:
How can you get the selectedindex or do you prefer another method?
Do you have any sample to achive this?
Thanks,
-Bertrand MASURE