Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #43 from haevg-rz/Backlog-for-not-assigned-topics
Browse files Browse the repository at this point in the history
create visual two buckets
  • Loading branch information
dhcgn authored Apr 1, 2020
2 parents 96bb001 + 40b07e3 commit 55c0c2f
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 30 deletions.
7 changes: 6 additions & 1 deletion Planungsboard.Presentation/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
StartupUri="Views/MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<viewModels:ViewModelLocator x:Key="Locator" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<viewModels:ViewModelLocator x:Key="Locator" />
</ResourceDictionary>
<ResourceDictionary Source="DesignData/ResourceDictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

Expand Down
7 changes: 7 additions & 0 deletions Planungsboard.Presentation/DesignData/ResourceDictionary.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:viewModels="clr-namespace:Planungsboard.Presentation.ViewModels">

<viewModels:Card x:Key="DesignDataCard" Id="23422" Title="BER" Color="#003087" Effort="16" />

</ResourceDictionary>
33 changes: 10 additions & 23 deletions Planungsboard.Presentation/UserControls/Card.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Planungsboard.Presentation.UserControls"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance local:Card}"
d:DesignHeight="100" d:DesignWidth="200">

d:DesignWidth="200">

<Border BorderBrush="{Binding Color}" BorderThickness="5,2,2,2" CornerRadius="2">
<Border BorderBrush="{Binding Color}" BorderThickness="5,2,2,2" CornerRadius="2"
Background="White"
DataContext="{Binding Path=Item, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
d:DataContext="{StaticResource DesignDataCard}"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -19,27 +23,10 @@
<ColumnDefinition Width="Auto" MinWidth="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding Title}" HorizontalAlignment="Center" />
<Border Grid.Column="0" Grid.Row="1" BorderBrush="DarkGray" BorderThickness="0.5" Margin="5,0,5,0" />
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding Path=Title}" HorizontalAlignment="Center" />
<Border Grid.Column="0" Grid.Row="1" BorderBrush="Black" BorderThickness="0.5" Margin="5,0,5,0" />
<TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding Effort}" HorizontalAlignment="Center" />

<Rectangle Grid.Column="1" Grid.Row="0" Grid.RowSpan="3">
<Rectangle.Fill>
<VisualBrush TileMode="Tile"
Viewport="0,0,5,5" ViewportUnits="Absolute"
Viewbox="0,0,5,5" ViewboxUnits="Absolute">
<VisualBrush.Visual>
<Grid Background="Transparent">
<Path Stroke="AliceBlue" Data="M 0 3 l 8 0" Opacity="0.5" />
</Grid>
</VisualBrush.Visual>
<VisualBrush.RelativeTransform>
<RotateTransform CenterX="0.5" CenterY="0.5" Angle="45" />
</VisualBrush.RelativeTransform>
</VisualBrush>
</Rectangle.Fill>
</Rectangle>

<Rectangle Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" Fill="{Binding Color}" Opacity="0.5" />
</Grid>
</Border>
</UserControl>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Setter Property="Padding" Value="5,2.5,5,2.5" />
</Style>
<Style x:Key="SideBarHintStyle" TargetType="TextBlock" BasedOn="{StaticResource BaseStyle}">
<Setter Property="FontSize" Value="8" />
<Setter Property="FontSize" Value="10" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>

Expand Down
27 changes: 26 additions & 1 deletion Planungsboard.Presentation/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,33 @@ public MainViewModel()
};
teams.ForEach(team => team.SetColor());
this.Teams = new ObservableCollection<Team>(teams);

var backlogCards = Enumerable.Range(0, 12).Select(_ => new Card()).ToList();
var rnd = new Random();
var alpha = "qwertzuioplkjhgfdsayxcvbnm";
foreach (var c in backlogCards)
{
c.Effort = rnd.Next(1, 10) ^ 2;
c.Id = rnd.Next(10000, 99999).ToString();
c.Title = alpha.OrderBy(c => Guid.NewGuid()).Take(rnd.Next(3, 5)).Select(c => c.ToString()).Aggregate((s, s1) => s + s1).ToUpper();
}

this.BacklogCards = backlogCards;

var futureCards = Enumerable.Range(0, 21).Select(_ => new Card()).ToList();
foreach (var c in futureCards)
{
c.Id = rnd.Next(10000, 99999).ToString();
c.Title = alpha.OrderBy(c => Guid.NewGuid()).Take(rnd.Next(3, 5)).Select(c => c.ToString()).Aggregate((s, s1) => s + s1).ToUpper();
}

this.FutureCards = futureCards;
}

public List<Card> FutureCards { get; set; }

public List<Card> BacklogCards { get; set; }

private (int quarter, int year) ConvertFromQuater(string input)
{
var quarter = int.Parse(input[1].ToString());
Expand Down Expand Up @@ -254,7 +279,7 @@ public class Card
public string Title { get; set; }
public int Effort { get; set; }
public List<string> AssignedQuarter { get; set; }
public string Color { get; set; }
public string Color { get; set; } = "#FA58F4";
}

public class Team
Expand Down
67 changes: 63 additions & 4 deletions Planungsboard.Presentation/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
xmlns:userControls="clr-namespace:Planungsboard.Presentation.UserControls"
mc:Ignorable="d"
Title="Planungsboard" Height="990" Width="1566"
Background="#0F2E45"
DataContext="{Binding MainViewModel, Source={StaticResource Locator}}">

<i:Interaction.Triggers>
Expand All @@ -30,18 +31,19 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<local:MenuUserControl />
<local:MenuUserControl Background="#0F2E45" Padding="10,5,5,5" />

<Grid Grid.Column="1" Margin="10">
<Grid Grid.Column="1" Margin="10" Background="White">

<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>

<Grid Grid.Row="0">
<Grid Grid.Row="0" Margin="20,0,20,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Path=TeamLabelWidth}" />
<ColumnDefinition />
Expand All @@ -64,7 +66,7 @@

</Grid>

<ItemsControl Grid.Row="1" ItemsSource="{Binding Teams}">
<ItemsControl Grid.Row="1" ItemsSource="{Binding Teams}" Margin="20,0,0,0" >
<ItemsControl.Template>
<ControlTemplate>
<ScrollViewer>
Expand Down Expand Up @@ -153,6 +155,63 @@
</ItemsControl.ItemTemplate>
</ItemsControl>


</Grid>

<Grid Grid.Column="2" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto"/>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.Resources>
<Style x:Key="BacklogItemsControlStyle" TargetType="ItemsControl">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<userControls:Card Item="{Binding}" Margin="2" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="#93B1C6" />
<Setter Property="MaxWidth" Value="200" />
<Setter Property="Margin" Value="10" />
<Setter Property="Padding" Value="10" />
</Style>
<Style x:Key="BacklogHeaderStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="HorizontalAlignment" Value="Center"></Setter>
</Style>
<Style x:Key="BacklogButtonStyle" TargetType="Button">
<Setter Property="Margin" Value="10,2.5,5,2.5" />
<Setter Property="Padding" Value="5,2.5,5,2.5" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
</Grid.Resources>

<TextBlock Text="Backlog" Grid.Row="0" Style="{StaticResource BacklogHeaderStyle}" />
<ItemsControl Grid.Row="1"
ItemsSource="{Binding BacklogCards}"
Style="{StaticResource BacklogItemsControlStyle}" />

<TextBlock Text="Future" Grid.Row="2" Style="{StaticResource BacklogHeaderStyle}" />
<ItemsControl Grid.Row="3"
ItemsSource="{Binding FutureCards}"
Style="{StaticResource BacklogItemsControlStyle}"
/>

<Button Content="Collapse" Grid.Row="4" Style="{StaticResource BacklogButtonStyle}" />
</Grid>


</Grid>
</Window>

0 comments on commit 55c0c2f

Please sign in to comment.