Advertisement
Guest User

XAML CategoryViewer

a guest
Sep 24th, 2010
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.53 KB | None | 0 0
  1. <UserControl x:Class="ePharma.Silverlight.View.Controls.CategoryControl"
  2.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5.     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6.     xmlns:vm="clr-namespace:ePharma.Silverlight.ViewModel"
  7.     mc:Ignorable="d"
  8.     xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" Height="300" Width="300">
  9.  
  10.     <UserControl.Resources>
  11.         <vm:MenuGroupBoxViewModel x:Key="MenuGroupBoxVM"></vm:MenuGroupBoxViewModel>
  12.  
  13.         <sdk:HierarchicalDataTemplate x:Key="SubItemTemplate" ItemsSource="{Binding Path=Categorie.SubCategorie}">
  14.             <TextBlock Text="{Binding Path=SubCategoryId}" Foreground="Red"/>
  15.         </sdk:HierarchicalDataTemplate>
  16.  
  17.         <sdk:HierarchicalDataTemplate x:Key="MainItemTemplate" ItemTemplate="{StaticResource SubItemTemplate}" >
  18.             <TextBlock Text="{Binding Path=CategoryId}" Foreground="Blue"/>
  19.         </sdk:HierarchicalDataTemplate>
  20.  
  21.     </UserControl.Resources>
  22.  
  23.     <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource MenuGroupBoxVM}}">
  24.         <sdk:TreeView Height="200" HorizontalAlignment="Left" Name="treeView" VerticalAlignment="Top" Width="174"
  25.                       ItemTemplate="{StaticResource MainItemTemplate}" ItemsSource="{Binding Path=Categories}" />
  26.     </Grid>
  27. </UserControl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement