Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to bind AuraTabView Items to Observable Collection #9

Open
hematec opened this issue Apr 13, 2021 · 1 comment
Open

How to bind AuraTabView Items to Observable Collection #9

hematec opened this issue Apr 13, 2021 · 1 comment
Projects
Milestone

Comments

@hematec
Copy link

hematec commented Apr 13, 2021

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

@PieroCastillo
Copy link
Owner

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 PieroCastillo added this to To do in 0.1.5 Nov 5, 2021
@PieroCastillo PieroCastillo moved this from To do to To Do (Priority) in 0.1.5 Nov 5, 2021
@PieroCastillo PieroCastillo moved this from To Do (Priority) to In progress in 0.1.5 Nov 14, 2021
@PieroCastillo PieroCastillo changed the title How to bind a ObservableCollection to NavigationView How to bind AuraTabView Items to Observable Collection Jan 7, 2022
@PieroCastillo PieroCastillo added this to the v0.1.5 milestone Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
0.1.5
In progress
Development

No branches or pull requests

2 participants