rename 'GroupItem' -> 'HierarchicalGroupItem' to avoid name conflict with System.Windows.Controls.GroupItem

This commit is contained in:
John Colvin committed 2019-08-19 13:14:57 -05:00
1 parent 4590dbc056
commit be006051b5
2 files changed
+4 -4

No files matched your search

@@ -30,7 +30,7 @@
<HierarchicalDataTemplate DataType="{x:Type local:LaunchItem}">
<Button Style="{DynamicResource StartMenuButton}" Content="{Binding name}" Command="{Binding command}" CommandParameter="{Binding args}" MinWidth="100" Padding="4" />
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:GroupItem}" ItemsSource="{Binding Value}" >
<HierarchicalDataTemplate DataType="{x:Type local:HierarchicalGroupItem}" ItemsSource="{Binding Value}" >
<TextBlock Text="{Binding Key}" Margin="4" />
</HierarchicalDataTemplate>
</TreeView.Resources>
@@ -35,10 +35,10 @@ namespace mbts.ui.controls {
private Dictionary<string, ObservableCollection<object>> _data;
public Dictionary<string, ObservableCollection<object>> Data { get { return _data; } set { _data = value; RaisePropertyChanged("InternalData"); } }
// A hack to provide a non-generic type for template binding
public IEnumerable<GroupItem> InternalData {
public IEnumerable<HierarchicalGroupItem> InternalData {
get {
if (_data == null) return null;
return _data.Select(k => new GroupItem() { Key = k.Key, Value = k.Value }); }
return _data.Select(k => new HierarchicalGroupItem() { Key = k.Key, Value = k.Value }); }
}
string _btext = string.Empty;
public string ButtonText { get { return _btext; } set { _btext = value; RaisePropertyChanged("ButtonText"); RaisePropertyChanged("ButtonVisibility"); } }
@@ -46,7 +46,7 @@ namespace mbts.ui.controls {
public ICommand Command { get; set; }
}
public class GroupItem
public class HierarchicalGroupItem
{
public string Key { get; set; }
public object Value { get; set; }