Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SomeClass : INotifyPropertyChanged
- {
- public SomeClass() {}
- public IList<string> Categories
- {
- get
- {
- return _categories;
- }
- set
- {
- _categories = value;
- OnPropertyChanged(nameof(Categories));
- }
- }
- public IList<string> Forms
- {
- get
- {
- return _forms;
- }
- set
- {
- _forms = value;
- OnPropertyChanged(nameof(Forms));
- }
- }
- public void OnPropertyChanged(string propertyName)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- <Window.Resources>
- <local:SomeClass x:key="MyClass"/>
- </Window.Resources>
- <ToolBarPanel x:Name="myToolStripName" DataContext="{StaticResource MyClass}">
- <ToolBarTray>
- <ToolBar Height="25px">
- <ComboBox x:Name="cboCategories"
- ItemsSource="{Binding Path=Categories}"
- SelectionChanged="CboCategories_SelectionChanged" />
- <ComboBox x:Name="cboForms"
- ItemsSource="{Binding Path=Forms}" />
- </ToolBar>
- </ToolBarTray>
- </ToolBarPanel>
- private void CboCategories_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
- {
- string categoryName = e.AddedItems[0].ToString();
- if (!string.IsNullOrEmpty(categoryName))
- {
- [problem: MyClass/SomeClass].GetFormNames(categoryName);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement