diff --git a/README.md b/README.md index aeeee73f..54ad73f9 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,10 @@ Step 4:enjoy coding ## Latest examples +### HoneycombPanel + +![HoneycombPanel](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/HoneycombPanel.png) + ### RunningBlock ![RunningBlock](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/RunningBlock.gif) @@ -81,12 +85,12 @@ Step 4:enjoy coding ![Card](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/Card.png) +## History publication + ### ButtonGroup ![ButtonGroup](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/ButtonGroup.png) -## History publication - ### Grid ![Grid](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/Grid.gif) diff --git a/Resources/HoneycombPanel.png b/Resources/HoneycombPanel.png new file mode 100644 index 00000000..b1fb329a Binary files /dev/null and b/Resources/HoneycombPanel.png differ diff --git a/doc/source/handycontrol/native_controls/dataGrid/index.md b/doc/source/handycontrol/native_controls/dataGrid/index.md index 7ea36f18..093d0e09 100644 --- a/doc/source/handycontrol/native_controls/dataGrid/index.md +++ b/doc/source/handycontrol/native_controls/dataGrid/index.md @@ -2,6 +2,19 @@ title: DataGrid 数据表格 --- +# 相关样式 + +| style名称 | 所属类型 | 用途描述 | +| - | - | - | +| RowHeaderGripperStyle | Thumb | 行标题拖拽条样式 | +| ColumnHeaderGripperStyle | Thumb | 列标题拖拽条样式 | +| DataGridCellStyle | DataGridCell | 单元格样式 | +| DataGridRowStyle | DataGridRow | 行样式 | +| DataGridColumnHeaderStyle | DataGridColumnHeader | 列标题样式 | +| DataGridRowHeaderStyle | DataGridRowHeader | 行标题样式 | +| TextBlockComboBoxStyle | ComboBox | ComboBox非编辑模式样式 | +| DataGridTextColumnStyle | TextBlock | 默认文本样式 | + {% note info no-icon %} 用例: @@ -29,4 +42,35 @@ title: DataGrid 数据表格 {% endcode %} ![ContextMenu](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/DataGrid.png) -{% endnote %} \ No newline at end of file +{% endnote %} + +# FAQ +{% note warning no-icon%} +对于文本显示列`DataGridTextColumn`需要设定文本内容`水平居中`或者`水平居右`,而不是HandyControl中设定的样式默认显示为`居左`时,需要继承`DataGridCellStyle`重写`HorizontalContentAlignment` 属性为`Center` 或`Right` 需要注意的是,此方式仅仅适用于引入了HandControl资源样式的项目,普通原生DataGrid使用该方式无效。 + +{% endnote %} + +用例如下: + +{% code %} + +样式: + + + +xaml中的使用: + + + + + +​ + + +{% endcode %} + +效果如下: + +![DataGridWarning01](../images/DataGrid-Warning01.png) diff --git a/doc/source/handycontrol/native_controls/images/DataGrid-Warning01.png b/doc/source/handycontrol/native_controls/images/DataGrid-Warning01.png new file mode 100644 index 00000000..f1d39abe Binary files /dev/null and b/doc/source/handycontrol/native_controls/images/DataGrid-Warning01.png differ diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj index b5293883..efb97896 100644 --- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj +++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj @@ -396,6 +396,12 @@ Resources\Img\LeftMainContent\Dynamic_16x.png + + Resources\Img\LeftMainContent\PolygonHexagon_16x.png + + + Resources\Img\LeftMainContent\HandyControl.png + Resources\Img\Dance.png diff --git a/src/Core_30/HandyControl_Core_30/Themes/Styles/DataGrid.xaml b/src/Core_30/HandyControl_Core_30/Themes/Styles/DataGrid.xaml index 3593fe3d..0381d657 100644 --- a/src/Core_30/HandyControl_Core_30/Themes/Styles/DataGrid.xaml +++ b/src/Core_30/HandyControl_Core_30/Themes/Styles/DataGrid.xaml @@ -257,6 +257,7 @@ + diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj index 0b10fbd3..530c4e9d 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -417,6 +417,12 @@ TextTemplatingFileGenerator MessageToken.cs + + Resources\Img\LeftMainContent\HandyControl.png + + + Resources\Img\LeftMainContent\PolygonHexagon_16x.png + Resources\Img\LeftMainContent\Dynamic_16x.png diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/DataGrid.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/DataGrid.xaml index 3f4bf166..a93c8b55 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Styles/DataGrid.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/DataGrid.xaml @@ -258,6 +258,7 @@ + diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj index 251e2bd5..a2e724d7 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -480,6 +480,12 @@ TextTemplatingFileGenerator MessageToken.cs + + Resources\Img\LeftMainContent\HandyControl.png + + + Resources\Img\LeftMainContent\PolygonHexagon_16x.png + Resources\Img\LeftMainContent\Dynamic_16x.png diff --git a/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/DataGrid.xaml b/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/DataGrid.xaml index c3c5a29c..41eecff7 100644 --- a/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/DataGrid.xaml +++ b/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/DataGrid.xaml @@ -257,6 +257,7 @@ + diff --git a/src/Shared/HandyControlDemo_Shared/App.xaml.cs b/src/Shared/HandyControlDemo_Shared/App.xaml.cs index c2f58f68..1392706a 100644 --- a/src/Shared/HandyControlDemo_Shared/App.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/App.xaml.cs @@ -9,9 +9,6 @@ using HandyControlDemo.Tools; namespace HandyControlDemo { - /// - /// App.xaml 的交互逻辑 - /// public partial class App { protected override void OnStartup(StartupEventArgs e) diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs index ff297a66..1e09db7a 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs @@ -108,6 +108,10 @@ public static readonly string RunningBlockDemoCtl = nameof(RunningBlockDemoCtl); + public static readonly string HoneycombPanelDemoCtl = nameof(HoneycombPanelDemoCtl); + + public static readonly string SpriteDemoCtl = nameof(SpriteDemoCtl); + public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl); public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl); diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt index 20805e83..5562e803 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt +++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt @@ -56,7 +56,9 @@ var controlList = new List "CardDemoCtl", "MagnifierDemoCtl", "ImageBlockDemoCtl", - "RunningBlockDemoCtl" + "RunningBlockDemoCtl", + "HoneycombPanelDemoCtl", + "SpriteDemoCtl" }; var styleList = new List { diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index 65f17be3..984abb9a 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -54,6 +54,9 @@ CardDemoCtl.xaml + + HoneycombPanelDemoCtl.xaml + ImageBlockDemoCtl.xaml @@ -174,6 +177,9 @@ SideMenuDemoCtl.xaml + + SpriteDemoCtl.xaml + StepBarDemoCtl.xaml @@ -322,6 +328,7 @@ + @@ -333,6 +340,9 @@ AboutWindow.xaml + + AppSprite.xaml + BlurWindow.xaml @@ -429,6 +439,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -589,6 +603,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -773,6 +791,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/Shared/HandyControlDemo_Shared/MainWindow.xaml b/src/Shared/HandyControlDemo_Shared/MainWindow.xaml index e82bc22b..9ff31060 100644 --- a/src/Shared/HandyControlDemo_Shared/MainWindow.xaml +++ b/src/Shared/HandyControlDemo_Shared/MainWindow.xaml @@ -12,9 +12,10 @@ ShowTitle="False" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterScreen" - hc:GlobalShortcut.Host="True" DataContext="{Binding Main,Source={StaticResource Locator}}" + hc:GlobalShortcut.Host="True" hc:Dialog.Token="{x:Static data:MessageToken.MainWindow}" + hc:WindowAttach.IgnoreAltF4="True" d:DesignHeight="800" d:DesignWidth="1400" Icon="/HandyControlDemo;component/Resources/Img/icon.ico"> diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs index c5abda38..43270cfc 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs @@ -69,6 +69,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 添加项 的本地化字符串。 + /// + public static string AddItem { + get { + return ResourceManager.GetString("AddItem", resourceCulture); + } + } + /// /// 查找类似 动画路径 的本地化字符串。 /// @@ -672,6 +681,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 蜂窝布局 的本地化字符串。 + /// + public static string HoneycombPanel { + get { + return ResourceManager.GetString("HoneycombPanel", resourceCulture); + } + } + /// /// 查找类似 混合布局 的本地化字符串。 /// @@ -969,6 +987,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 打开精灵 的本地化字符串。 + /// + public static string OpenSprite { + get { + return ResourceManager.GetString("OpenSprite", resourceCulture); + } + } + /// /// 查找类似 轮廓文本 的本地化字符串。 /// @@ -1185,6 +1212,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 删除项 的本地化字符串。 + /// + public static string RemoveItem { + get { + return ResourceManager.GetString("RemoveItem", resourceCulture); + } + } + /// /// 查找类似 重复按钮 的本地化字符串。 /// @@ -1338,6 +1374,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 精灵 的本地化字符串。 + /// + public static string Sprite { + get { + return ResourceManager.GetString("Sprite", resourceCulture); + } + } + /// /// 查找类似 步骤 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx index 8156f572..3efb365c 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx @@ -636,4 +636,19 @@ RunningBlock + + HoneycombPanel + + + Add an item + + + Remove an item + + + Sprite + + + Open sprite + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx index 6515453f..6b168ea6 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx @@ -636,4 +636,19 @@ 滚动块 + + 蜂窝布局 + + + 添加项 + + + 删除项 + + + 精灵 + + + 打开精灵 + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/HandyControl.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/HandyControl.png new file mode 100644 index 00000000..911df219 Binary files /dev/null and b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/HandyControl.png differ diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/PolygonHexagon_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/PolygonHexagon_16x.png new file mode 100644 index 00000000..0aae4fee Binary files /dev/null and b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/PolygonHexagon_16x.png differ diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml b/src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml index 8bcccf6a..49a0d290 100644 --- a/src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml +++ b/src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml @@ -94,4 +94,8 @@ + + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs index cd558e1d..0ea49299 100644 --- a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs +++ b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs @@ -157,9 +157,9 @@ namespace HandyControlDemo.Service }; } - internal List GetCardDataList() + internal ObservableCollection GetCardDataList() { - return new List + return new ObservableCollection { new CardModel { @@ -224,6 +224,14 @@ namespace HandyControlDemo.Service }; } + internal CardModel GetCardData() + { + return new CardModel + { + Content = $"/HandyControlDemo;component/Resources/Img/Album/{DateTime.Now.Second % 10 + 1}.jpg" + }; + } + internal List GetStepBarDemoDataList() { return new List diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GrowlDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GrowlDemoCtl.xaml.cs index cbf99957..c3474865 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GrowlDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GrowlDemoCtl.xaml.cs @@ -1,9 +1,6 @@  namespace HandyControlDemo.UserControl { - /// - /// GrowlDemoGrid.xaml 的交互逻辑 - /// public partial class GrowlDemoCtl { public GrowlDemoCtl() diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/HoneycombPanelDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/HoneycombPanelDemoCtl.xaml new file mode 100644 index 00000000..9d1f7c91 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/HoneycombPanelDemoCtl.xaml @@ -0,0 +1,34 @@ + + + + + + + + +