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 #34 from haevg-rz/milestone-mvp-0.2
Browse files Browse the repository at this point in the history
Milestone mvp 0.2
  • Loading branch information
dhcgn authored Mar 26, 2020
2 parents ce6d05f + bc8e7b4 commit 084076f
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 5 deletions.
46 changes: 46 additions & 0 deletions Planungsboard.Presentation/UserControls/MenuUserControl.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<UserControl x:Class="Planungsboard.Presentation.MenuUserControl"
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">

<UserControl.Resources>
<Style x:Key="BaseStyle" TargetType="FrameworkElement">
<Setter Property="Margin" Value="5,2.5,5,2.5" />
</Style>

<Style x:Key="SideBarButtonStyle" TargetType="Button" BasedOn="{StaticResource BaseStyle}">
<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="HorizontalAlignment" Value="Center" ></Setter>
</Style>

</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Button Content="Open On GitHib" FontSize="5" Style="{StaticResource SideBarButtonStyle}" CommandParameter="https://github.com/haevg-rz/Planungsboard/" />
<Rectangle Height="100"></Rectangle>
<Button Content="New Team" Style="{StaticResource SideBarButtonStyle}" Command="{Binding Path=(viewModels:MainViewModel.NewTeamCommand)}" />
<Button Content="New Card" Style="{StaticResource SideBarButtonStyle}" />

<Separator Style="{StaticResource BaseStyle}" />

<Button Content="Save" Style="{StaticResource SideBarButtonStyle}" />
<Button Content="Load" Style="{StaticResource SideBarButtonStyle}" />

</StackPanel>

<StackPanel Grid.Row="2">
<Button Content="Help" Style="{StaticResource SideBarButtonStyle}" />
<Button Content="Toogle Sidebar" Style="{StaticResource SideBarButtonStyle}" />
<TextBlock Text="0.0.0" Style="{StaticResource SideBarHintStyle}" />
</StackPanel>
</Grid>

</UserControl>
12 changes: 12 additions & 0 deletions Planungsboard.Presentation/UserControls/MenuUserControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Windows.Controls;

namespace Planungsboard.Presentation
{
public partial class MenuUserControl : UserControl
{
public MenuUserControl()
{
InitializeComponent();
}
}
}
14 changes: 12 additions & 2 deletions Planungsboard.Presentation/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Windows.Media.Media3D;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
using Planungsboard.Presentation.Views;

namespace Planungsboard.Presentation.ViewModels
{
Expand All @@ -16,6 +17,7 @@ public MainViewModel()
LoadedCommand = new RelayCommand(LoadedCommandHandling);
QuarterBackCommand = new RelayCommand(QuarterBackCommandHandling);
QuarterNextCommand = new RelayCommand(QuarterNextCommandHandling);
NewTeamCommand = new RelayCommand(NewTeamCommandHandling);

this.DisplayQuarters = new List<string>
{
Expand Down Expand Up @@ -48,8 +50,6 @@ public MainViewModel()
};
teams.ForEach(team => team.SetColor());
this.Teams = teams;


}

private void QuarterNextCommandHandling()
Expand All @@ -75,6 +75,14 @@ private void QuarterNextCommandHandling()
this.DisplayQuarters = newQuarterList;
}

private void NewTeamCommandHandling()
{
var newEntityWindows = new NewGenericEntityWindows<Team>();
newEntityWindows.ShowDialog();

this.Teams.Add(newEntityWindows.Instance);
}

private void QuarterBackCommandHandling()
{
var newQuarterList = new List<string>();
Expand Down Expand Up @@ -134,6 +142,8 @@ public double TeamLabelWidth
public RelayCommand QuarterNextCommand { get; set; }
public RelayCommand QuarterBackCommand { get; set; }

public RelayCommand NewTeamCommand { get; set; }

#endregion

#region Commands Handling
Expand Down
14 changes: 12 additions & 2 deletions Planungsboard.Presentation/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@
<local:CardsQuarterFilterForSingles x:Key="CardsQuarterFilterForSingles" />
<local:CardsQuarterFilterForMultiples x:Key="CardsQuarterFilterForMultiples" />
</Window.Resources>
<Grid Margin="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<local:MenuUserControl />

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

<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand Down Expand Up @@ -64,7 +72,7 @@
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
</DataTemplate.Resources>
<Grid Margin="0,10,0,0" SizeChanged="FrameworkElement_OnSizeChanged2">
<Grid Margin="0,10,0,0" SizeChanged="FrameworkElement_OnSizeChanged">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
Expand Down Expand Up @@ -129,6 +137,7 @@
</MultiBinding>
</userControls:CardsWarpPanel.Quarter4Cards>
</userControls:CardsWarpPanel>

<Border Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="2"
BorderBrush="{Binding Color}" BorderThickness="2" />

Expand All @@ -138,4 +147,5 @@
</ItemsControl>

</Grid>
</Grid>
</Window>
2 changes: 1 addition & 1 deletion Planungsboard.Presentation/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public MainWindow()
InitializeComponent();
}

private void FrameworkElement_OnSizeChanged2(object sender, SizeChangedEventArgs e)
private void FrameworkElement_OnSizeChanged(object sender, SizeChangedEventArgs e)
{
var grid = sender as Grid;
var firstColumn = grid.ColumnDefinitions.FirstOrDefault();
Expand Down
12 changes: 12 additions & 0 deletions Planungsboard.Presentation/Views/NewEntityWindows.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Window x:Class="Planungsboard.Presentation.Views.NewEntityWindows"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Planungsboard.Presentation.Views"
mc:Ignorable="d"
Title="NewEntityWindows" Height="450" Width="800">
<Grid>

</Grid>
</Window>
37 changes: 37 additions & 0 deletions Planungsboard.Presentation/Views/NewEntityWindows.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Planungsboard.Presentation.Views
{
/// <summary>
/// Interaktionslogik für NewEntityWindows.xaml
/// </summary>
public partial class NewEntityWindows : Window
{
public NewEntityWindows()
{
InitializeComponent();
}

}

public class NewGenericEntityWindows<T> : NewEntityWindows
{
public NewGenericEntityWindows()
{

}

public T Instance { get; set; }
}
}

0 comments on commit 084076f

Please sign in to comment.