Skip to content

Commit

Permalink
更新界面UI
Browse files Browse the repository at this point in the history
  • Loading branch information
noberumotto committed Aug 3, 2021
1 parent 23142c1 commit a98b289
Show file tree
Hide file tree
Showing 28 changed files with 498 additions and 95 deletions.
4 changes: 2 additions & 2 deletions src/Local/Project1.UI/Controls/ChartControl/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@ private void RenderTick()
Y = -averageLabelY
};
//AverageLabel.Text = TickText.Replace("{value}", Math.Round(averageValue, 1).ToString());

BottomValueBorder.Margin = new Thickness(0, 0, 0, bottomTickMargin - BottomValueBorder.ActualHeight / 2 - BottomTick.Height / 2);
double bottomTickHeight = (BottomTick.Height == double.NaN ? 2 : BottomTick.Height);
BottomValueBorder.Margin = new Thickness(0, 0, 0, bottomTickMargin - BottomValueBorder.ActualHeight / 2 - bottomTickHeight / 2);
BottomValueLabel.Text = TickText.Replace("{value}", bottomValue.ToString());

}
Expand Down
17 changes: 17 additions & 0 deletions src/Local/Project1.UI/Controls/ContentCard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace Project1.UI.Controls
{
public class ContentCard : ContentControl
{
public ContentCard()
{
DefaultStyleKey = typeof(ContentCard);
}
}
}
5 changes: 5 additions & 0 deletions src/Local/Project1.UI/Project1.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\ContentCard.cs" />
<Compile Include="Controls\ChartControl\ChartItem.cs" />
<Compile Include="Controls\ChartControl\Chart.cs" />
<Compile Include="Controls\ChartControl\Models\ChartDataModel.cs" />
Expand Down Expand Up @@ -246,6 +247,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\ContentCard.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\TimeBox.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
31 changes: 31 additions & 0 deletions src/Local/Project1.UI/Themes/ContentCard.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Project1.UI.Controls"
xmlns:converter="clr-namespace:Project1.UI.Controls.Converters"
>
<Style TargetType="{x:Type controls:ContentCard}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="SnapsToDevicePixels" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:ContentCard}">

<Border
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
RecognizesAccessKey="True"
SnapsToDevicePixels="False"
/>
</Border>

</ControlTemplate>
</Setter.Value>
</Setter>

</Style>


</ResourceDictionary>
17 changes: 12 additions & 5 deletions src/Local/Project1.UI/Themes/DatePicker/DatePicker.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<Style TargetType="{x:Type controls:DatePicker}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="#ccc" />
<Setter Property="Width" Value="130" />
<Setter Property="Height" Value="36" />
<Setter Property="Width" Value="150" />
<Setter Property="Height" Value="26" />

<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="SnapsToDevicePixels" Value="False" />
<Setter Property="Template">
<Setter.Value>
Expand All @@ -30,9 +30,10 @@
BorderThickness="1"
Padding="10"
Margin="15"
CornerRadius="6"
>
<Border.Effect>
<DropShadowEffect BlurRadius="5" Opacity="0.2" ShadowDepth="1"/>
<DropShadowEffect BlurRadius="10" Opacity="0.2" ShadowDepth="1"/>
</Border.Effect>
<Grid>
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -73,9 +74,15 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
CornerRadius="18">
CornerRadius="6">
<!--<Border.Effect>
<DropShadowEffect BlurRadius="10" Direction="0" ShadowDepth="0" Opacity=".2" RenderingBias="Performance" ></DropShadowEffect>
</Border.Effect>-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock FontFamily="/Project1.UI;component/Assets/IconFonts/#Fabric External MDL2 Assets" Text="&#xEE93;" VerticalAlignment="Center" FontSize="14" TextAlignment="Center" Foreground="#37363d"/>

<TextBlock Margin="5,0,0,0" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" Grid.Column="1" Foreground="#37363d" Text="{DynamicResource Lang_Monthly}"/>

<TextBlock Margin="5,0,0,0" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" Grid.Column="1" Foreground="#37363d">
<Run Text="{TemplateBinding SelectedYear,Converter={StaticResource StringConverter}}"/> <Run Text="/"/> <Run Text="{TemplateBinding SelectedMonth,Converter={StaticResource StringConverter}}"/>
</TextBlock>
Expand Down
2 changes: 2 additions & 0 deletions src/Local/Project1.UI/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<ResourceDictionary Source="/Project1.UI;component/Themes/DatePicker/DatePicker.xaml"/>
<ResourceDictionary Source="/Project1.UI;component/Themes/DatePicker/ItemList.xaml"/>
<ResourceDictionary Source="/Project1.UI;component/Themes/TimeBox.xaml"/>
<ResourceDictionary Source="/Project1.UI;component/Themes/ContentCard.xaml"/>

</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>
8 changes: 8 additions & 0 deletions src/Local/ProjectEye/ProjectEye.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Resource>
<Page Include="Resources\Themes\Blue\ContentCard.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Themes\Dark\Button.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -227,6 +231,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Themes\Dark\ContentCard.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Themes\Dark\ContextMenu.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
2 changes: 1 addition & 1 deletion src/Local/ProjectEye/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.7")]
[assembly: AssemblyVersion("1.3.8")]
[assembly: AssemblyFileVersion("1.0.0.1")]
51 changes: 50 additions & 1 deletion src/Local/ProjectEye/Resources/Themes/Blue/Button.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
CornerRadius="{TemplateBinding CornerRadius}"
Padding="{TemplateBinding Padding}"
>
<Border.Effect>
<DropShadowEffect x:Name="Shadow" BlurRadius="10" Direction="0" ShadowDepth="0" Opacity="0" RenderingBias="Performance" ></DropShadowEffect>
</Border.Effect>
<TextBlock.Foreground>
<SolidColorBrush Color="#2f2e41"/>
</TextBlock.Foreground>
Expand Down Expand Up @@ -185,6 +188,29 @@


</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<MultiTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Shadow" To=".2" />
</Storyboard>
</BeginStoryboard>
</MultiTrigger.EnterActions>
<MultiTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Shadow" To="0" />
</Storyboard>
</BeginStoryboard>
</MultiTrigger.ExitActions>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down Expand Up @@ -227,7 +253,7 @@
<SolidColorBrush x:Name="ButtonBackground" Color="{DynamicResource ThemeColor}" Opacity="1"/>
</Border.Background>
<Border.Effect>
<DropShadowEffect x:Name="ButtonEffect" Direction="270" ShadowDepth="4" BlurRadius="10.8" Opacity="0"/>
<DropShadowEffect x:Name="Shadow" BlurRadius="10" Direction="0" ShadowDepth="0" Opacity="0" RenderingBias="Performance" ></DropShadowEffect>
</Border.Effect>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
Expand Down Expand Up @@ -274,6 +300,29 @@
</Grid>

</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<MultiTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Shadow" To=".2" />
</Storyboard>
</BeginStoryboard>
</MultiTrigger.EnterActions>
<MultiTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Shadow" To="0" />
</Storyboard>
</BeginStoryboard>
</MultiTrigger.ExitActions>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down
4 changes: 2 additions & 2 deletions src/Local/ProjectEye/Resources/Themes/Blue/Config.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<!--按钮默认边框-->
<Thickness x:Key="ButtonThickness">1</Thickness>
<!--按钮默认圆角幅度-->
<CornerRadius x:Key="ButtonCornerRadius">1</CornerRadius>
<CornerRadius x:Key="ButtonCornerRadius">6</CornerRadius>


<!--按钮经过背景颜色-->
Expand Down Expand Up @@ -116,7 +116,7 @@
<!--按钮默认边框-->
<Thickness x:Key="BasicButtonThickness">1</Thickness>
<!--按钮默认圆角幅度-->
<CornerRadius x:Key="BasicButtonCornerRadius">1</CornerRadius>
<CornerRadius x:Key="BasicButtonCornerRadius">6</CornerRadius>


<!--按钮经过颜色-->
Expand Down
81 changes: 81 additions & 0 deletions src/Local/ProjectEye/Resources/Themes/Blue/ContentCard.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Project1.UI.Controls;assembly=Project1.UI"
>

<Style TargetType="{x:Type controls:ContentCard}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="SnapsToDevicePixels" Value="False" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />

<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:ContentCard}">
<Grid>
<Border
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Margin="15"
Padding="{TemplateBinding Padding}"
CornerRadius="6"
RenderTransformOrigin=".5,.5"
>
<Border.RenderTransform>
<ScaleTransform x:Name="Scale" ScaleX="0.99" ScaleY="0.99"/>
</Border.RenderTransform>
<Border.Effect>
<DropShadowEffect x:Name="Shadow" BlurRadius="30" Direction="0" ShadowDepth="0" Opacity="0" RenderingBias="Performance" ></DropShadowEffect>
</Border.Effect>
<ContentPresenter
RecognizesAccessKey="True" Margin="0"
SnapsToDevicePixels="True"
/>
</Border>


</Grid>

<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<MultiTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Shadow" To=".1" />
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="Scale" To="1" />
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="Scale" To="1" />
</Storyboard>
</BeginStoryboard>
</MultiTrigger.EnterActions>
<MultiTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Shadow" To="0" />
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="Scale" To=".99" />
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="Scale" To=".99" />
</Storyboard>
</BeginStoryboard>
</MultiTrigger.ExitActions>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>

</Style>

</ResourceDictionary>
2 changes: 1 addition & 1 deletion src/Local/ProjectEye/Resources/Themes/Blue/ListView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<ControlTemplate TargetType="ListView">
<!--整体背景和外边框-->
<Border Name="Border"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource ControlBorderBrush}" Background="{TemplateBinding Background}">
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource ControlBorderBrush}" Background="{TemplateBinding Background}" CornerRadius="6">

<ScrollViewer Style="{DynamicResource
{x:Static GridView.GridViewScrollViewerStyleKey}}">
Expand Down
1 change: 1 addition & 0 deletions src/Local/ProjectEye/Resources/Themes/Blue/Style.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<ResourceDictionary Source="ListBox.xaml" />
<ResourceDictionary Source="TabControl.xaml" />
<ResourceDictionary Source="Slider.xaml" />
<ResourceDictionary Source="ContentCard.xaml" />

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
Loading

0 comments on commit a98b289

Please sign in to comment.