Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
WPF
SmartUI
提交
802297fa
S
SmartUI
项目概览
WPF
/
SmartUI
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SmartUI
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
802297fa
编写于
3月 26, 2021
作者:
小时後可胖了
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化日历控件
上级
7235a888
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
12 deletion
+13
-12
.gitignore
.gitignore
+1
-0
README.md
README.md
+2
-2
SmartUI.Demo/MainWindow.xaml
SmartUI.Demo/MainWindow.xaml
+1
-2
SmartUI/SmartUI.csproj
SmartUI/SmartUI.csproj
+1
-0
SmartUI/Themes/CalendarStyle.xaml
SmartUI/Themes/CalendarStyle.xaml
+3
-4
SmartUI/Themes/DatePickerStyle.xaml
SmartUI/Themes/DatePickerStyle.xaml
+5
-4
未找到文件。
.gitignore
浏览文件 @
802297fa
...
...
@@ -6,3 +6,4 @@ SmartUI/obj/
/.vs
/SmartUI/SmartUI.1.0.0.1.nupkg
/packages
/SmartUI
README.md
浏览文件 @
802297fa
...
...
@@ -15,7 +15,7 @@
3.
Button样式
!
[
image
](
https://user-images.githubusercontent.com/29591512/110083013-1ccc9480-7dc9-11eb-8c7d-336ce639d711.png
)
使用方式:如果按钮需要显示图标则需加入附加属性assist:ButtonAssist.Icon="Search"
````
csharp
<UniformGrid
Columns=
"7"
Rows=
"6"
>
<Label
Content=
"默认样式"
/>
<Button
Content=
"默认按钮"
/>
...
...
@@ -59,7 +59,7 @@
<Button Content="默认按钮" Style="{StaticResource TextButtonStyle}"/>
<Button Content="禁用按钮" IsEnabled="False" Style="{StaticResource TextButtonStyle}"/>
</UniformGrid>
````
3.
SmartWindow自定义控件,全新的窗体界面
使用方式:将Window继承自SmartWindow即可
5.
TabControl控件样式
...
...
SmartUI.Demo/MainWindow.xaml
浏览文件 @
802297fa
...
...
@@ -171,8 +171,7 @@
</WrapPanel>
<WrapPanel Orientation="Horizontal" Height="400">
<Label Content="时间控件"/>
<DatePicker Style="{StaticResource DatePickerDefault}"/>
<Calendar Width="300" Height="400"/>
<DatePicker DisplayDateStart="2021-3-18" Style="{StaticResource DatePickerDefault}"/>
</WrapPanel>
</StackPanel>
</ScrollViewer>
...
...
SmartUI/SmartUI.csproj
浏览文件 @
802297fa
...
...
@@ -76,6 +76,7 @@
<ItemGroup>
<Compile
Include=
"Assist\ButtonAssist.cs"
/>
<Compile
Include=
"Assist\DataGridAssist.cs"
/>
<Compile
Include=
"Assist\DatePickerAssist.cs"
/>
<Compile
Include=
"Controls\CascaderItem.cs"
/>
<Compile
Include=
"Controls\Cascader.cs"
/>
<Compile
Include=
"Controls\ChildWindow.cs"
/>
...
...
SmartUI/Themes/CalendarStyle.xaml
浏览文件 @
802297fa
...
...
@@ -39,15 +39,14 @@
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".5"
<DoubleAnimation Duration="0" To=".5"
Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)"
Storyboard.TargetName="path" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Grid
Background="Transparent"
>
<!--左箭头-->
<Path x:Name="path"
Data="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"
...
...
@@ -86,7 +85,7 @@
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Grid
Background="Transparent"
>
<Path x:Name="path"
Data="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"
Fill="#999999"
...
...
SmartUI/Themes/DatePickerStyle.xaml
浏览文件 @
802297fa
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:
smart="clr-namespace:SmartUI.Controls
">
xmlns:
assist="clr-namespace:SmartUI.Assist
">
<PathGeometry x:Key="pathDate1">M544 703.872H612.48c10.24 0 17.152-7.04 17.152-17.728V615.36c0-10.624-6.848-17.664-17.152-17.664H544c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m0-176.96H612.48c10.24 0 17.152-7.04 17.152-17.728V438.4c0-10.624-6.848-17.664-17.152-17.664H544c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m171.392 0h68.608c10.24 0 17.152-7.04 17.152-17.728V438.4c0-10.624-6.912-17.664-17.152-17.664h-68.608c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.912 17.728 17.152 17.728z m-342.848 0h68.608c10.24 0 17.088-7.04 17.088-17.728V438.4c0-10.624-6.848-17.664-17.088-17.664H372.48c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m342.848 176.96h68.608c10.24 0 17.152-7.04 17.152-17.728V615.36c0-10.624-6.912-17.664-17.152-17.664h-68.608c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.912 17.728 17.152 17.728z m0 176.96h68.608c10.24 0 17.152-7.04 17.152-17.728V792.32c0-10.624-6.912-17.664-17.152-17.664h-68.608c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.912 17.728 17.152 17.728z m-171.392 0H612.48c10.24 0 17.152-7.04 17.152-17.728V792.32c0-10.624-6.848-17.664-17.152-17.664H544c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m-342.848 0h68.544c10.24 0 17.152-7.04 17.152-17.728V792.32c0-10.624-6.848-17.664-17.152-17.664H201.152c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m0-176.96h68.544c10.24 0 17.152-7.04 17.152-17.728V615.36c0-10.624-6.848-17.664-17.152-17.664H201.152c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z</PathGeometry>
<PathGeometry x:Key="pathDate2">M904 84.48h-137.152V49.088c0-17.664-13.696-35.392-34.304-35.392-20.544 0-34.304 14.144-34.304 35.392v35.392H286.848V49.088c0-17.664-13.696-35.392-34.304-35.392-20.544 0-34.304 14.144-34.304 35.392v35.392H81.152c-37.76 0-68.608 31.872-68.608 70.784v778.624c0 38.976 30.848 70.784 68.608 70.784h822.848c37.76 0 68.544-31.808 68.544-70.784V155.264c0-38.912-30.848-70.784-68.544-70.784z m0 814.08c0 21.184-13.76 35.328-34.304 35.328H115.392c-20.544 0-34.24-14.144-34.24-35.392V349.952h822.848v548.544z m0-619.392H81.152V190.656c0-21.184 13.696-35.392 34.24-35.392H218.24v35.392c0 17.728 13.76 35.392 34.304 35.392 20.608 0 34.304-14.08 34.304-35.392v-35.392h411.392v35.392c0 17.728 13.76 35.392 34.304 35.392 20.608 0 34.304-14.08 34.304-35.392v-35.392h102.848c20.544 0 34.304 14.208 34.304 35.392v88.512z</PathGeometry>
<PathGeometry x:Key="pathDate3">M201.152 526.912h68.544c10.24 0 17.152-7.04 17.152-17.728V438.4c0-10.624-6.848-17.664-17.152-17.664H201.152c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m171.392 176.96h68.608c10.24 0 17.088-7.04 17.088-17.728V615.36c0-10.624-6.848-17.664-17.088-17.664H372.48c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m0 176.96h68.608c10.24 0 17.088-7.04 17.088-17.728V792.32c0-10.624-6.848-17.664-17.088-17.664H372.48c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z</PathGeometry>
...
...
@@ -12,6 +12,7 @@
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
<Setter Property="assist:DatePickerAssist.AutoClose" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DatePicker}">
...
...
@@ -41,7 +42,7 @@
</ControlTemplate>
</DockPanel.Resources>
<Button x:Name="PART_Button" DockPanel.Dock="Right" Grid.Column="1" Foreground="{TemplateBinding BorderBrush}" HorizontalAlignment="Left" Margin="3,0,3,0" Grid.Row="0" Template="{StaticResource DropDownButtonTemplate}" VerticalAlignment="Center" Width="30" MinWidth="30" Height="30"/>
<TextBox x:Name="PART_TextBox" Width="{TemplateBinding Width}" Grid.Column="0" Text="{Binding SelectedDate,StringFormat='yyyy-MM-dd',
RelativeSource={RelativeSource Mode=TemplatedParent}}" BorderThickness="0" Grid.Row="0" VerticalContentAlignment="Center"
Style="{x:Null}"/>
<TextBox x:Name="PART_TextBox" Width="{TemplateBinding Width}" Grid.Column="0" Text="{Binding SelectedDate,StringFormat='yyyy-MM-dd',
UpdateSourceTrigger=PropertyChanged,RelativeSource={RelativeSource Mode=TemplatedParent}}" BorderThickness="0" VerticalContentAlignment="Center" Padding="5 0" Grid.Row="0"
Style="{x:Null}"/>
<Grid x:Name="PART_DisabledVisual" Grid.ColumnSpan="2" Grid.Column="0" IsHitTestVisible="False" Opacity="0" Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
...
...
@@ -49,12 +50,12 @@
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Fill="#A5FFFFFF" RadiusY="1" Grid.Row="0" RadiusX="1"/>
<Rectangle Grid.Column="1" Fill="#A5FFFFFF" Height="18" Margin="3,0,3,0" RadiusY="1" Grid.Row="0" RadiusX="1" Width="19"/>
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" VerticalOffset="
3
" Placement="Bottom" PlacementTarget="{Binding ElementName=PART_TextBox}" StaysOpen="False">
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" VerticalOffset="
5
" Placement="Bottom" PlacementTarget="{Binding ElementName=PART_TextBox}" StaysOpen="False">
<Border Margin="8" Background="White">
<Border.Effect>
<DropShadowEffect Color="LightGray" Opacity="0.3" Direction="8"/>
</Border.Effect>
<Calendar Style="{DynamicResource CalendarDefaultStyle}"
SelectedDate="{TemplateBinding SelectedDate
}"/>
<Calendar Style="{DynamicResource CalendarDefaultStyle}"
DisplayDateStart="{TemplateBinding DisplayDateStart}" DisplayDateEnd="{TemplateBinding DisplayDateEnd}" SelectedDate="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=SelectedDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged
}"/>
</Border>
</Popup>
</Grid>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录