Community
Hi,
I'm trying to get an event to fire when a user changes a selection in a combo box. The goal is to change the appearance of the dialog depending on the value selected.
The combo box in question is in fact the default one from file.xaml,
<ComboBox ItemsSource="{Binding Source={StaticResource DocTypes}, XPath=DocTypeInfo}" x:Name="DocTypeCombo" Grid.Row="2" Grid.Column="1" IsEnabled="{Binding IsNewEntryDialog}" DisplayMemberPath="DocName" SelectedValuePath="Path" SelectedValue="{Binding TemplatePath}" SelectedIndex="0">
Problem is, the value is not attached to a property as I can see, so I can't use ,
$Prop["MyProperty"].add_PropertyChanged({ MyPropertyOnChangedEvent })
Autodesk help has a page for this, but I can't seem to get the code-beind file correct: what is CustomerViewModelBase and how do I access "base.".
I tried adding this inside the <combobox> in xaml.
SelectionChanged="{Binding PsCmd[OnPropertyChanged_DocTypeCombo]}">
I also tried
<ComboBox ItemsSource="{Binding Source={StaticResource DocTypes}, XPath=DocTypeInfo}" x:Name="DocTypeCombo" Grid.Row="2" Grid.Column="1" IsEnabled="{Binding IsNewEntryDialog}" DisplayMemberPath="DocName" SelectedValuePath="Path" SelectedValue="{Binding TemplatePath}" SelectedIndex="0"
SelectionChanged="OnSelectionChanged_DocTypeCombo"> </ComboBox> <x:Code> <![CDATA[ void OnSelectionChanged_DocTypeCombo(object sender, RoutedEventArgs e) { textblock.Text = "Hello World"; } ]]> </x:Code>
How should I solve this?
Regards,
Björn