Black Theme for the WPF App

This commit is contained in:
2019-03-13 00:22:31 +01:00
parent fd076a8d63
commit 1996d0fe09
11 changed files with 3213 additions and 29 deletions

View File

@@ -1,7 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

View File

@@ -10,7 +10,8 @@
<ResourceDictionary> <ResourceDictionary>
<local:Bootstrapper x:Key="Bootstrapper" /> <local:Bootstrapper x:Key="Bootstrapper" />
</ResourceDictionary> </ResourceDictionary>
</ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Themes\Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>

View File

@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>LaDOSE.DesktopApp</RootNamespace> <RootNamespace>LaDOSE.DesktopApp</RootNamespace>
<AssemblyName>LaDOSE.DesktopApp</AssemblyName> <AssemblyName>LaDOSE.DesktopApp</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@@ -35,6 +35,9 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ApplicationIcon>64x64.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Caliburn.Micro, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL"> <Reference Include="Caliburn.Micro, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
<HintPath>..\packages\Caliburn.Micro.Core.3.2.0\lib\net45\Caliburn.Micro.dll</HintPath> <HintPath>..\packages\Caliburn.Micro.Core.3.2.0\lib\net45\Caliburn.Micro.dll</HintPath>
@@ -79,6 +82,8 @@
</ApplicationDefinition> </ApplicationDefinition>
<Compile Include="Behaviors\MultiSelectorBehaviours.cs" /> <Compile Include="Behaviors\MultiSelectorBehaviours.cs" />
<Compile Include="Bootstrapper.cs" /> <Compile Include="Bootstrapper.cs" />
<Compile Include="Themes\LeftMarginMultiplierConverter.cs" />
<Compile Include="Themes\TreeViewItemExtensions.cs" />
<Compile Include="Utils\PhpSerialize.cs" /> <Compile Include="Utils\PhpSerialize.cs" />
<Compile Include="Services\RestService.cs" /> <Compile Include="Services\RestService.cs" />
<Compile Include="UserControls\BookingUserControl.xaml.cs"> <Compile Include="UserControls\BookingUserControl.xaml.cs">
@@ -106,6 +111,10 @@
<DependentUpon>App.xaml</DependentUpon> <DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Page Include="Themes\Styles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UserControls\BookingUserControl.xaml"> <Page Include="UserControls\BookingUserControl.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -162,7 +171,9 @@
<Name>LaDOSE.DTO</Name> <Name>LaDOSE.DTO</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<Resource Include="64x64.ico" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\64x64.png" /> <Resource Include="Resources\64x64.png" />
</ItemGroup> </ItemGroup>

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
namespace DarkBlendTheme
{
public class LeftMarginMultiplierConverter : IValueConverter
{
public double Length { get; set; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var item = value as TreeViewItem;
if (item == null)
return new Thickness(0);
return new Thickness(Length * item.GetDepth(), 0, 0, 0);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new System.NotImplementedException();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
namespace DarkBlendTheme
{
public static class TreeViewItemExtensions
{
public static int GetDepth(this TreeViewItem item)
{
TreeViewItem parent;
while ((parent = GetParent(item)) != null)
{
return GetDepth(parent) + 1;
}
return 0;
}
private static TreeViewItem GetParent(TreeViewItem item)
{
var parent = VisualTreeHelper.GetParent(item);
while (!(parent is TreeViewItem || parent is TreeView))
{
if (parent == null) return null;
parent = VisualTreeHelper.GetParent(parent);
}
return parent as TreeViewItem;
}
}
}

View File

@@ -6,21 +6,24 @@
xmlns:local="clr-namespace:LaDOSE.DesktopApp.UserControls" xmlns:local="clr-namespace:LaDOSE.DesktopApp.UserControls"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" d:DesignHeight="450" d:DesignWidth="800"
> >
<UserControl.Resources> <UserControl.Resources>
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid>
<ListView Grid.Row ="1" ItemsSource="{Binding Path=Reservation}"> <ListView Grid.Row ="1" Margin="2" ItemsSource="{Binding Path=Reservation}">
<ListView.ItemTemplate> <ListView.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Background="Green" x:Name="Panel" VerticalAlignment="Stretch" > <StackPanel Orientation="Horizontal" x:Name="Panel" VerticalAlignment="Stretch" >
<Label Content="{Binding Name}"></Label> <Label x:Name="Name" Content="{Binding Name}">
</Label>
</StackPanel> </StackPanel>
<DataTemplate.Triggers> <DataTemplate.Triggers>
<DataTrigger Binding="{Binding Valid}" Value="False"> <DataTrigger Binding="{Binding Valid}" Value="True">
<Setter TargetName="Panel" Property="Background" Value="Red" /> <Setter TargetName="Name" Property="Foreground" Value="Green" />
</DataTrigger> </DataTrigger>
</DataTemplate.Triggers> </DataTemplate.Triggers>
</DataTemplate> </DataTemplate>

View File

@@ -9,7 +9,8 @@
xmlns:cal="http://www.caliburnproject.org" xmlns:cal="http://www.caliburnproject.org"
Icon="{Binding Path=AppIcon}" Icon="{Binding Path=AppIcon}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800"
Style="{StaticResource {x:Type Window}}">
<Window.Resources> <Window.Resources>
</Window.Resources> </Window.Resources>
@@ -53,11 +54,20 @@
<TabControl Grid.Row="1" x:Name="Items"> <TabControl Grid.Row="1" x:Name="Items">
<TabControl.ItemTemplate> <TabControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal"> <DockPanel>
<TextBlock Text="{Binding DisplayName}" /> <TextBlock HorizontalAlignment="Right" Text="{Binding DisplayName}" />
<Button Content="X" <Button Margin="5,0,0,0"
cal:Message.Attach="DeactivateItem($dataContext,'true')" /> cal:Message.Attach="DeactivateItem($dataContext,'true')" >
</StackPanel> <Grid>
<Canvas Width='8' Height='8'>
<Line X1='2' X2='6' Y1='2' Y2='6'
Stroke='Red' StrokeThickness='1'/>
<Line X1='6' X2='2' Y1='2' Y2='6'
Stroke='Red' StrokeThickness='1'/>
</Canvas>
</Grid>
</Button>
</DockPanel>
</DataTemplate> </DataTemplate>
</TabControl.ItemTemplate> </TabControl.ItemTemplate>
</TabControl> </TabControl>

View File

@@ -22,11 +22,11 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<DockPanel Grid.Row="0"> <DockPanel Grid.Row="0">
<Button x:Name="UpdateDb">Update DB</Button> <Button Margin="2" x:Name="UpdateDb">Update DB</Button>
<Button x:Name="LoadEvents">Load Events</Button> <Button Margin="2" x:Name="LoadEvents">Load Events</Button>
</DockPanel> </DockPanel>
<ListView Grid.Row="1" ItemsSource="{Binding Events}" x:Name="EventsList" <ListView Grid.Row="1" ItemsSource="{Binding Events}" x:Name="EventsList" Margin="0,0,0,5"
SelectedItem="{Binding SelectedWpEvent, Mode=TwoWay}"> SelectedItem="{Binding SelectedWpEvent, Mode=TwoWay}">
<ListView.ItemTemplate> <ListView.ItemTemplate>
<DataTemplate> <DataTemplate>
@@ -46,7 +46,7 @@
<ColumnDefinition Width="2*"></ColumnDefinition> <ColumnDefinition Width="2*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<ListView Grid.Column="0" ItemsSource="{Binding ElementName=EventsList,Path=SelectedItem.WpBookings}" <ListView Grid.Column="0" ItemsSource="{Binding ElementName=EventsList,Path=SelectedItem.WpBookings}"
x:Name="BookingList" IsTextSearchEnabled="True" TextSearch.TextPath="WpUserDto.Name"> x:Name="BookingList" IsTextSearchEnabled="True" TextSearch.TextPath="WpUserDto.Name" Margin="2">
<ListView.ItemTemplate> <ListView.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@@ -67,7 +67,7 @@
<userControls:BookingUserControl Grid.Row="0" <userControls:BookingUserControl Grid.Row="0"
Current="{Binding ElementName=BookingList,Path=SelectedItem.Meta,UpdateSourceTrigger=PropertyChanged}" /> Current="{Binding ElementName=BookingList,Path=SelectedItem.Meta,UpdateSourceTrigger=PropertyChanged}" />
<Label Grid.Row="1">Message</Label> <Label Grid.Row="1">Message</Label>
<TextBox Grid.Row="2" IsReadOnly="True" Text="{Binding ElementName=BookingList,Path=SelectedItem.Message}" TextWrapping="Wrap" AcceptsReturn="False" VerticalScrollBarVisibility="Auto" /> <TextBox Grid.Row="2" Margin="2" IsReadOnly="True" Text="{Binding ElementName=BookingList,Path=SelectedItem.Message}" TextWrapping="Wrap" AcceptsReturn="False" VerticalScrollBarVisibility="Auto" />
</Grid> </Grid>
@@ -79,7 +79,7 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Button Grid.Row="0" cal:Message.Attach="Generate">Generate</Button> <Button Grid.Row="0" cal:Message.Attach="Generate">Generate</Button>
<ListView Grid.Row="1" x:Name="GameFoundListView" ItemsSource="{Binding GamesFound}" <ListView Grid.Row="1" x:Name="GameFoundListView" ItemsSource="{Binding GamesFound}"
SelectedItem="{Binding SelectedGame,UpdateSourceTrigger=PropertyChanged}" IsTextSearchEnabled="True" TextSearch.TextPath="Name"> SelectedItem="{Binding SelectedGame,UpdateSourceTrigger=PropertyChanged}" IsTextSearchEnabled="True" TextSearch.TextPath="Name" Margin="2">
<ListView.ItemTemplate> <ListView.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@@ -102,7 +102,7 @@
<Label Content="{Binding Players.Count,UpdateSourceTrigger=PropertyChanged}"></Label> <Label Content="{Binding Players.Count,UpdateSourceTrigger=PropertyChanged}"></Label>
<Label>)</Label> <Label>)</Label>
</StackPanel> </StackPanel>
<ListView Grid.Row="1" Grid.Column="0" x:Name="PlayersList" ItemsSource="{Binding Players,UpdateSourceTrigger=PropertyChanged}" IsTextSearchEnabled="True" TextSearch.TextPath="Name"> <ListView Grid.Row="1" Grid.Column="0" Margin="2" x:Name="PlayersList" ItemsSource="{Binding Players,UpdateSourceTrigger=PropertyChanged}" IsTextSearchEnabled="True" TextSearch.TextPath="Name">
<ListView.ItemTemplate> <ListView.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@@ -116,7 +116,7 @@
<Label Content="{Binding PlayersOptions.Count,UpdateSourceTrigger=PropertyChanged}"></Label> <Label Content="{Binding PlayersOptions.Count,UpdateSourceTrigger=PropertyChanged}"></Label>
<Label>)</Label> <Label>)</Label>
</StackPanel> </StackPanel>
<ListView Grid.Row="1" Grid.Column="1" x:Name="PlayersOptionsList" ItemsSource="{Binding PlayersOptions,UpdateSourceTrigger=PropertyChanged}" IsTextSearchEnabled="True" TextSearch.TextPath="Name" behaviors:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding OptionalPlayers}"> <ListView Grid.Row="1" Grid.Column="1" Margin="2" x:Name="PlayersOptionsList" ItemsSource="{Binding PlayersOptions,UpdateSourceTrigger=PropertyChanged}" IsTextSearchEnabled="True" TextSearch.TextPath="Name" behaviors:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding OptionalPlayers}">
<ListView.ItemTemplate> <ListView.ItemTemplate>
<DataTemplate> <DataTemplate>

View File

@@ -3,4 +3,5 @@
<package id="Caliburn.Micro" version="3.2.0" targetFramework="net461" /> <package id="Caliburn.Micro" version="3.2.0" targetFramework="net461" />
<package id="Caliburn.Micro.Core" version="3.2.0" targetFramework="net461" /> <package id="Caliburn.Micro.Core" version="3.2.0" targetFramework="net461" />
<package id="RestSharp" version="106.6.5" targetFramework="net461" /> <package id="RestSharp" version="106.6.5" targetFramework="net461" />
<package id="WPFThemes.DarkBlend" version="1.0.8" targetFramework="net461" />
</packages> </packages>