Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- XAML:
- <Window x:Class="MiscSamples.KanBanSample"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="KanBanSample" Height="670" Width="1225">
- <Window.Resources>
- <DataTemplate x:Key="InnerTemplate">
- <Grid Margin="10" MaxHeight="100" MaxWidth="100">
- <Path Data="M0.5,1 L1,68.5 56.25,68.25 68,55.5 68,0.5 z M56.375,68.281 L57.75,57.75 M68.25,55.25 L57.405993,58.203003"
- Fill="#FFF4F4F5" Stroke="#3C5B8A" Stretch="Uniform"/>
- <TextBlock Text="{Binding DisplayName}"
- FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center"/>
- </Grid>
- </DataTemplate>
- <DataTemplate x:Key="OuterTemplate">
- <Grid Margin="2" MaxWidth="300">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" SharedSizeGroup="Header"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Border BorderThickness="1" BorderBrush="#6388B4">
- <Border.Background>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Color="#88D1FF" Offset="0"/>
- <GradientStop Color="#88D1FF" Offset=".1"/>
- <GradientStop Color="#4586D6" Offset="1"/>
- </LinearGradientBrush>
- </Border.Background>
- <TextBlock Text="{Binding DisplayName}"
- FontSize="20" Foreground="White" Margin="10" TextWrapping="Wrap"
- TextAlignment="Center"/>
- </Border>
- <Border BorderBrush="#6B86A4" BorderThickness="1" Background="#CDD3E1" Grid.Row="1" Margin="0,5,0,0">
- <ItemsControl ItemsSource="{Binding Items}" Margin="10"
- ItemTemplate="{StaticResource InnerTemplate}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel/>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- </ItemsControl>
- </Border>
- </Grid>
- </DataTemplate>
- </Window.Resources>
- <ItemsControl ItemsSource="{Binding}" ItemTemplate="{StaticResource OuterTemplate}"
- Grid.IsSharedSizeScope="True">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <VirtualizingStackPanel Orientation="Horizontal"/>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- </ItemsControl>
- </Window>
- Code Behind:
- public partial class KanBanSample : Window
- {
- public KanBanSample()
- {
- InitializeComponent();
- DataContext = new List<KanBanSampleOuterItem>
- {
- new KanBanSampleOuterItem()
- {
- DisplayName = "PETICION DE TAREAS",
- Items =
- {
- new KanBanSampleInnerItem("M"),
- new KanBanSampleInnerItem("N"),
- }
- },
- new KanBanSampleOuterItem()
- {
- DisplayName = "SELECCION DE TAREAS (5)",
- Items =
- {
- new KanBanSampleInnerItem("H"),
- new KanBanSampleInnerItem("I"),
- new KanBanSampleInnerItem("J"),
- new KanBanSampleInnerItem("K"),
- new KanBanSampleInnerItem("L"),
- }
- },
- new KanBanSampleOuterItem()
- {
- DisplayName = "DESARROLLO (4)",
- Items =
- {
- new KanBanSampleInnerItem("D"),
- new KanBanSampleInnerItem("E"),
- new KanBanSampleInnerItem("F"),
- new KanBanSampleInnerItem("G"),
- }
- },
- new KanBanSampleOuterItem()
- {
- DisplayName = "PRUEBA (1)",
- Items =
- {
- new KanBanSampleInnerItem("C"),
- }
- },
- new KanBanSampleOuterItem()
- {
- DisplayName = "TERMINADO",
- Items =
- {
- new KanBanSampleInnerItem("A"),
- new KanBanSampleInnerItem("B"),
- }
- }
- };
- }
- }
- public class KanBanSampleOuterItem
- {
- public string DisplayName { get; set; }
- public List<KanBanSampleInnerItem> Items { get; set; }
- public KanBanSampleOuterItem()
- {
- Items = new List<KanBanSampleInnerItem>();
- }
- }
- public class KanBanSampleInnerItem
- {
- public KanBanSampleInnerItem(string displayName)
- {
- DisplayName = displayName;
- }
- public string DisplayName { get; set; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement