Aura.UI icon indicating copy to clipboard operation
Aura.UI copied to clipboard

How to bind AuraTabView Items to Observable Collection

Open hematec opened this issue 3 years ago • 1 comments

Hello,

i'm currently trying to use the NAvigationView for one of our Apps main menu. The menu items are stored in an obervable collection and are menu groups and menu elements which belong to one group. Till now, we're using a treeview to show the menu by binding to the collection with the following code:

<TreeView x:Name="tvwMainMenu" Width="250" Grid.Column="0" Items="{Binding MenuElements}">
  <TreeView.DataTemplates>
    <TreeDataTemplate DataType="caocore:CNavigationGroup" ItemsSource="{Binding NavigationElements}">
      <StackPanel Orientation="Horizontal">
        <Image Source="{Binding Icon, Converter={StaticResource BitmapConverter}}" />
        <TextBlock Text="{Binding Name}" />
      </StackPanel>
    </TreeDataTemplate>
    
    <DataTemplate DataType="caocore:CNavigationElement">
      <StackPanel Orientation="Horizontal">
        <Image Source="{Binding Icon, Converter={StaticResource BitmapConverter}}" />
        <TextBlock Text="{Binding Name}" />
      </StackPanel>
    </DataTemplate>
  </TreeView.DataTemplates>
</TreeView>

Could you please give me a hint, how to bind to the NavigationView?

BR

hematec avatar Apr 13 '21 10:04 hematec

Hello,

i'm currently trying to use the NAvigationView for one of our Apps main menu. The menu items are stored in an obervable collection and are menu groups and menu elements which belong to one group. Till now, we're using a treeview to show the menu by binding to the collection with the following code:

<TreeView x:Name="tvwMainMenu" Width="250" Grid.Column="0" Items="{Binding MenuElements}">
  <TreeView.DataTemplates>
    <TreeDataTemplate DataType="caocore:CNavigationGroup" ItemsSource="{Binding NavigationElements}">
      <StackPanel Orientation="Horizontal">
        <Image Source="{Binding Icon, Converter={StaticResource BitmapConverter}}" />
        <TextBlock Text="{Binding Name}" />
      </StackPanel>
    </TreeDataTemplate>
    
    <DataTemplate DataType="caocore:CNavigationElement">
      <StackPanel Orientation="Horizontal">
        <Image Source="{Binding Icon, Converter={StaticResource BitmapConverter}}" />
        <TextBlock Text="{Binding Name}" />
      </StackPanel>
    </DataTemplate>
  </TreeView.DataTemplates>
</TreeView>

Could you please give me a hint, how to bind to the NavigationView?

BR

MVVM isn't supported, but now I'm working in implement MVVM support, for now you can use controls defined by XAML only.

PieroCastillo avatar Apr 13 '21 14:04 PieroCastillo