diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json index 35f2f44e..31373006 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json +++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json @@ -2,121 +2,124 @@ { "title": "Styles", "selectedIndex": -1, + "group": false, "demoItemList": [ - [ "Brush", "BrushDemoCtl", "Brush_16x", "" ], - [ "Button", "ButtonDemoCtl", "ButtonClick_16x", "" ], - [ "RepeatButton", "RepeatButtonDemoCtl", "RepeatButton_16x", "" ], - [ "ToggleButton", "ToggleButtonDemoCtl", "Toggle_16x", "" ], - [ "RadioButton", "RadioButtonDemoCtl", "RadioButton_16x", "" ], - [ "CheckBox", "CheckBoxDemoCtl", "CheckBox_16x", "" ], - [ "ScrollViewer", "NativeScrollViewerDemoCtl", "ScrollBox_16x", "" ], - [ "Slider", "SliderDemoCtl", "Slider_16x", "" ], - [ "TextBlock", "TextBlockDemoCtl", "TextBlock_16x", "" ], - [ "TextBox", "NativeTextBoxDemoCtl", "TextBox_16x", "" ], - [ "ComboBox", "NativeComboBoxDemoCtl", "ComboBox_16x", "" ], - [ "PasswordBox", "NativePasswordBoxDemoCtl", "PasswordBox_16x", "" ], - [ "Expander", "ExpanderDemoCtl", "Expander_16x", "" ], - [ "ProgressBar", "NativeProgressBarDemoCtl", "ProgressBar_16x", "" ], - [ "Calendar", "CalendarDemoCtl", "Calendar_16x", "" ], - [ "DatePicker", "NativeDatePickerDemoCtl", "DatePicker_16x", "" ], - [ "TabControl", "NativeTabControlDemoCtl", "TabPage_16x", "" ], - [ "DataGrid", "DataGridDemoCtl", "DataGrid_16x", "" ], - [ "TreeView", "TreeViewDemoCtl", "TreeView_16x", "" ], - [ "ListBox", "ListBoxDemoCtl", "ListBox_16x", "" ], - [ "ListView", "ListViewDemoCtl", "ListView_16x", "" ], - [ "GroupBox", "GroupBoxDemoCtl", "GroupBox_16x", "" ], - [ "Menu", "MenuDemoCtl", "ContextMenu_16x", "" ], - [ "RichTextBox", "RichTextBoxDemoCtl", "RichTextBox_16x", "" ], - [ "FlowDocument", "FlowDocumentDemoCtl", "WPFFlowDocument_16x", "" ], - [ "ToolBar", "ToolBarDemoCtl", "ToolBar_16x", "" ], - [ "Border", "BorderDemoCtl", "BorderElement_16x", "" ], - [ "Label", "LabelDemoCtl", "Label_16x", "" ], - [ "Frame", "FrameDemoCtl", "frame_16xLG", "" ], - [ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "" ], - [ "Geometry", "GeometryDemoCtl", "Path_16x", "1" ] + [ "Brush", "BrushDemoCtl", "Brush_16x", "", "" ], + [ "Button", "ButtonDemoCtl", "ButtonClick_16x", "", "" ], + [ "RepeatButton", "RepeatButtonDemoCtl", "RepeatButton_16x", "", "" ], + [ "ToggleButton", "ToggleButtonDemoCtl", "Toggle_16x", "", "" ], + [ "RadioButton", "RadioButtonDemoCtl", "RadioButton_16x", "", "" ], + [ "CheckBox", "CheckBoxDemoCtl", "CheckBox_16x", "", "" ], + [ "ScrollViewer", "NativeScrollViewerDemoCtl", "ScrollBox_16x", "", "" ], + [ "Slider", "SliderDemoCtl", "Slider_16x", "", "" ], + [ "TextBlock", "TextBlockDemoCtl", "TextBlock_16x", "", "" ], + [ "TextBox", "NativeTextBoxDemoCtl", "TextBox_16x", "", "" ], + [ "ComboBox", "NativeComboBoxDemoCtl", "ComboBox_16x", "", "" ], + [ "PasswordBox", "NativePasswordBoxDemoCtl", "PasswordBox_16x", "", "" ], + [ "Expander", "ExpanderDemoCtl", "Expander_16x", "", "" ], + [ "ProgressBar", "NativeProgressBarDemoCtl", "ProgressBar_16x", "", "" ], + [ "Calendar", "CalendarDemoCtl", "Calendar_16x", "", "" ], + [ "DatePicker", "NativeDatePickerDemoCtl", "DatePicker_16x", "", "" ], + [ "TabControl", "NativeTabControlDemoCtl", "TabPage_16x", "", "" ], + [ "DataGrid", "DataGridDemoCtl", "DataGrid_16x", "", "" ], + [ "TreeView", "TreeViewDemoCtl", "TreeView_16x", "", "" ], + [ "ListBox", "ListBoxDemoCtl", "ListBox_16x", "", "" ], + [ "ListView", "ListViewDemoCtl", "ListView_16x", "", "" ], + [ "GroupBox", "GroupBoxDemoCtl", "GroupBox_16x", "", "" ], + [ "Menu", "MenuDemoCtl", "ContextMenu_16x", "", "" ], + [ "RichTextBox", "RichTextBoxDemoCtl", "RichTextBox_16x", "", "" ], + [ "FlowDocument", "FlowDocumentDemoCtl", "WPFFlowDocument_16x", "", "" ], + [ "ToolBar", "ToolBarDemoCtl", "ToolBar_16x", "", "" ], + [ "Border", "BorderDemoCtl", "BorderElement_16x", "", "" ], + [ "Label", "LabelDemoCtl", "Label_16x", "", "" ], + [ "Frame", "FrameDemoCtl", "frame_16xLG", "", "" ], + [ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "", "" ], + [ "Geometry", "GeometryDemoCtl", "Path_16x", "1", "" ] ] }, { "title": "Controls", "selectedIndex": 0, + "group": true, "demoItemList": [ - [ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "" ], - [ "PropertyGrid", "PropertyGridDemoCtl", "PropertyGridEditorPart_16x", "1" ], - [ "ImageSelector", "ImageSelectorDemoCtl", "Image_16x", "1" ], - [ "ImageBlock", "ImageBlockDemoCtl", "ImageStack_16x", "" ], - [ "Magnifier", "MagnifierDemoCtl", "Search_16x", "" ], - [ "Gravatar", "GravatarDemoCtl", "User_16x", "" ], - [ "Badge", "BadgeDemoCtl", "DotLarge_16x", "" ], - [ "GotoTop", "GotoTopDemoCtl", "GoToTop_16x", "" ], - [ "SplitButton", "SplitButtonDemoCtl", "SplitButton_16x", "" ], - [ "ButtonGroup", "ButtonGroupDemoCtl", "ButtonGroup_16x", "" ], - [ "ProgressButton", "ProgressButtonDemoCtl", "ProgressButton_16x", "" ], - [ "ChatBubble", "ChatBubbleDemoCtl", "Bubble_16xLG", "" ], - [ "Poptip", "PoptipDemoCtl", "PopupCursor_16x", "" ], - [ "NotifyIcon", "NotifyIconDemoCtl", "NotificationHub_16x", "" ], - [ "NumericUpDown", "NumericUpDownDemoCtl", "NumericListBox_16x", "" ], - [ "TextBox", "TextBoxDemoCtl", "TextBox_16x", "" ], - [ "ComboBox", "ComboBoxDemoCtl", "ComboBox_16x", "" ], - [ "CheckComboBox", "CheckComboBoxDemoCtl", "CheckBoxList_16x", "1" ], - [ "PasswordBox", "PasswordBoxDemoCtl", "PasswordBox_16x", "" ], - [ "PinBox", "PinBoxDemoCtl", "Ellipsis_16x", "" ], - [ "DatePicker", "DatePickerDemoCtl", "DatePicker_16x", "" ], - [ "Clock", "ClockDemoCtl", "Time_color_16x", "" ], - [ "TimePicker", "TimePickerDemoCtl", "TimePicker_16x", "" ], - [ "CalendarWithClock", "CalendarWithClockDemoCtl", "Calendar_16x", "" ], - [ "DateTimePicker", "DateTimePickerDemoCtl", "DatePicker_16x", "" ], - [ "Transfer", "TransferDemoCtl", "Transfer_16x", "" ], - [ "FlipClock", "FlipClockDemoCtl", "FlipVertical_16x", "" ], - [ "Rate", "RateDemoCtl", "Star", "" ], - [ "Shield", "ShieldDemoCtl", "Shield_16x", "" ], - [ "SearchBar", "SearchBarDemoCtl", "Search_16x", "" ], - [ "Tag", "TagDemoCtl", "Tag_16x", "" ], - [ "GifImage", "GifImageDemoCtl", "Animation_16x", "" ], - [ "OutlineText", "OutlineTextDemoCtl", "TextBlock_16x", "" ], - [ "RunningBlock", "RunningBlockDemoCtl", "Dynamic_16x", "" ], - [ "Card", "CardDemoCtl", "VSO_Card_16x", "" ], - [ "Divider", "DividerDemoCtl", "DottedSplitter_16x", "" ], - [ "CirclePanel", "CirclePanelDemoCtl", "ColorWheel_16x", "" ], - [ "Grid", "GridDemoCtl", "GridPane_16x", "" ], - [ "FlexPanel", "FlexPanelDemoCtl", "layout-FlexLayout-16", "1" ], - [ "UniformSpacingPanel", "UniformSpacingPanelDemoCtl", "IncreaseHorizontalSpacing_16x", "1" ], - [ "RelativePanel", "RelativePanelDemoCtl", "TransformRelative_16x", "" ], - [ "WaterfallPanel", "WaterfallPanelDemoCtl", "Panel_16x", "" ], - [ "HoneycombPanel", "HoneycombPanelDemoCtl", "PolygonHexagon_16x", "" ], - [ "TransitioningContentControl", "TransitioningContentControlDemoCtl", "TransitioningContentControl_16x", "" ], - [ "Drawer", "DrawerDemoCtl", "View_Portrait_16x", "" ], - [ "CoverView", "CoverViewDemoCtl", "DetailDataView_16x", "" ], - [ "CoverFlow", "CoverFlowDemoCtl", "LinearCarousel_16x", "" ], - [ "ProgressBar", "ProgressBarDemoCtl", "ProgressBar_16x", "" ], - [ "StepBar", "StepBarDemoCtl", "Flow_16x", "" ], - [ "Growl", "GrowlDemoCtl", "Message_16x", "" ], - [ "Loading", "LoadingDemoCtl", "Loading_Blue_16x", "" ], - [ "ImageBrowser", "ImageBrowserDemoCtl", "ImageBrowser_16x", "" ], - [ "ColorPicker", "ColorPickerDemoCtl", "ColorPalette_16x", "" ], - [ "Carousel", "CarouselDemoCtl", "Carousel_16x", "" ], - [ "CompareSlider", "CompareSliderDemoCtl", "SplitterControl_16x", "" ], - [ "PreviewSlider", "PreviewSliderDemoCtl", "HoverMenu_16x", "" ], - [ "RangeSlider", "RangeSliderDemoCtl", "brackets_Square_16xLG", "" ], - [ "TimeBar", "TimeBarDemoCtl", "Timeline_16x", "" ], - [ "Pagination", "PaginationDemoCtl", "Paginator_16x", "" ], - [ "AnimationPath", "AnimationPathDemoCtl", "Path_16x", "" ], - [ "TabControl", "TabControlDemoCtl", "TabPage_16x", "" ], - [ "SideMenu", "SideMenuDemoCtl", "MainMenuControl_16x", "" ], - [ "ScrollViewer", "ScrollViewerDemoCtl", "ScrollBox_16x", "" ], - [ "Sprite", "SpriteDemoCtl", "HandyControl", "" ], - [ "Notification", "NotificationDemoCtl", "Procedure_16x", "" ], - [ "Dialog", "DialogDemoCtl", "Dialog_16x", "" ], - [ "Screenshot", "ScreenshotDemoCtl", "WindowScreenshot_16x", "" ], - [ "Window", "WindowDemoCtl", "WindowsForm_16x", "" ] + [ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "", "" ], + [ "PropertyGrid", "PropertyGridDemoCtl", "PropertyGridEditorPart_16x", "1", "" ], + [ "ImageSelector", "ImageSelectorDemoCtl", "Image_16x", "1", "" ], + [ "ImageBlock", "ImageBlockDemoCtl", "ImageStack_16x", "", "" ], + [ "Magnifier", "MagnifierDemoCtl", "Search_16x", "", "" ], + [ "Gravatar", "GravatarDemoCtl", "User_16x", "", "" ], + [ "Badge", "BadgeDemoCtl", "DotLarge_16x", "", "" ], + [ "GotoTop", "GotoTopDemoCtl", "GoToTop_16x", "", "" ], + [ "SplitButton", "SplitButtonDemoCtl", "SplitButton_16x", "", "" ], + [ "ButtonGroup", "ButtonGroupDemoCtl", "ButtonGroup_16x", "", "" ], + [ "ProgressButton", "ProgressButtonDemoCtl", "ProgressButton_16x", "", "" ], + [ "ChatBubble", "ChatBubbleDemoCtl", "Bubble_16xLG", "", "" ], + [ "Poptip", "PoptipDemoCtl", "PopupCursor_16x", "", "" ], + [ "NotifyIcon", "NotifyIconDemoCtl", "NotificationHub_16x", "", "" ], + [ "NumericUpDown", "NumericUpDownDemoCtl", "NumericListBox_16x", "", "" ], + [ "TextBox", "TextBoxDemoCtl", "TextBox_16x", "", "" ], + [ "ComboBox", "ComboBoxDemoCtl", "ComboBox_16x", "", "" ], + [ "CheckComboBox", "CheckComboBoxDemoCtl", "CheckBoxList_16x", "1", "" ], + [ "PasswordBox", "PasswordBoxDemoCtl", "PasswordBox_16x", "", "" ], + [ "PinBox", "PinBoxDemoCtl", "Ellipsis_16x", "", "" ], + [ "DatePicker", "DatePickerDemoCtl", "DatePicker_16x", "", "" ], + [ "Clock", "ClockDemoCtl", "Time_color_16x", "", "" ], + [ "TimePicker", "TimePickerDemoCtl", "TimePicker_16x", "", "" ], + [ "CalendarWithClock", "CalendarWithClockDemoCtl", "Calendar_16x", "", "" ], + [ "DateTimePicker", "DateTimePickerDemoCtl", "DatePicker_16x", "", "" ], + [ "Transfer", "TransferDemoCtl", "Transfer_16x", "", "" ], + [ "FlipClock", "FlipClockDemoCtl", "FlipVertical_16x", "", "" ], + [ "Rate", "RateDemoCtl", "Star", "", "" ], + [ "Shield", "ShieldDemoCtl", "Shield_16x", "", "" ], + [ "SearchBar", "SearchBarDemoCtl", "Search_16x", "", "" ], + [ "Tag", "TagDemoCtl", "Tag_16x", "", "" ], + [ "GifImage", "GifImageDemoCtl", "Animation_16x", "", "" ], + [ "OutlineText", "OutlineTextDemoCtl", "TextBlock_16x", "", "" ], + [ "RunningBlock", "RunningBlockDemoCtl", "Dynamic_16x", "", "" ], + [ "Card", "CardDemoCtl", "VSO_Card_16x", "", "" ], + [ "Divider", "DividerDemoCtl", "DottedSplitter_16x", "", "" ], + [ "CirclePanel", "CirclePanelDemoCtl", "ColorWheel_16x", "", "Layout" ], + [ "Grid", "GridDemoCtl", "GridPane_16x", "", "Layout" ], + [ "FlexPanel", "FlexPanelDemoCtl", "layout-FlexLayout-16", "1", "Layout" ], + [ "UniformSpacingPanel", "UniformSpacingPanelDemoCtl", "IncreaseHorizontalSpacing_16x", "1", "Layout" ], + [ "RelativePanel", "RelativePanelDemoCtl", "TransformRelative_16x", "", "Layout" ], + [ "WaterfallPanel", "WaterfallPanelDemoCtl", "Panel_16x", "", "Layout" ], + [ "HoneycombPanel", "HoneycombPanelDemoCtl", "PolygonHexagon_16x", "", "Layout" ], + [ "TransitioningContentControl", "TransitioningContentControlDemoCtl", "TransitioningContentControl_16x", "", "" ], + [ "Drawer", "DrawerDemoCtl", "View_Portrait_16x", "", "" ], + [ "CoverView", "CoverViewDemoCtl", "DetailDataView_16x", "", "" ], + [ "CoverFlow", "CoverFlowDemoCtl", "LinearCarousel_16x", "", "" ], + [ "ProgressBar", "ProgressBarDemoCtl", "ProgressBar_16x", "", "Feedback" ], + [ "StepBar", "StepBarDemoCtl", "Flow_16x", "", "Navigation" ], + [ "Growl", "GrowlDemoCtl", "Message_16x", "", "Feedback" ], + [ "Loading", "LoadingDemoCtl", "Loading_Blue_16x", "", "" ], + [ "ImageBrowser", "ImageBrowserDemoCtl", "ImageBrowser_16x", "", "" ], + [ "ColorPicker", "ColorPickerDemoCtl", "ColorPalette_16x", "", "" ], + [ "Carousel", "CarouselDemoCtl", "Carousel_16x", "", "" ], + [ "CompareSlider", "CompareSliderDemoCtl", "SplitterControl_16x", "", "" ], + [ "PreviewSlider", "PreviewSliderDemoCtl", "HoverMenu_16x", "", "" ], + [ "RangeSlider", "RangeSliderDemoCtl", "brackets_Square_16xLG", "", "" ], + [ "TimeBar", "TimeBarDemoCtl", "Timeline_16x", "", "" ], + [ "Pagination", "PaginationDemoCtl", "Paginator_16x", "", "" ], + [ "AnimationPath", "AnimationPathDemoCtl", "Path_16x", "", "" ], + [ "TabControl", "TabControlDemoCtl", "TabPage_16x", "", "" ], + [ "SideMenu", "SideMenuDemoCtl", "MainMenuControl_16x", "", "" ], + [ "ScrollViewer", "ScrollViewerDemoCtl", "ScrollBox_16x", "", "" ], + [ "Sprite", "SpriteDemoCtl", "HandyControl", "", "" ], + [ "Notification", "NotificationDemoCtl", "Procedure_16x", "", "" ], + [ "Dialog", "DialogDemoCtl", "Dialog_16x", "", "" ], + [ "Screenshot", "ScreenshotDemoCtl", "WindowScreenshot_16x", "", "" ], + [ "Window", "WindowDemoCtl", "WindowsForm_16x", "", "" ] ] }, { "title": "Tools", "selectedIndex": 0, + "group": false, "demoItemList": [ - [ "HatchBrushGenerator", "HatchBrushGeneratorDemoCtl", "DataGenerator_16x", "" ], - [ "Morphing_Animation", "GeometryAnimationDemoCtl", "Animation_16x", "" ], - [ "Effects", "EffectsDemoCtl", "Effects_16x", "" ] + [ "HatchBrushGenerator", "HatchBrushGeneratorDemoCtl", "DataGenerator_16x", "", "" ], + [ "Morphing_Animation", "GeometryAnimationDemoCtl", "Animation_16x", "", "" ], + [ "Effects", "EffectsDemoCtl", "Effects_16x", "", "" ] ] } ] diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs index 45704931..ad5dc2fd 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs @@ -31,6 +31,8 @@ namespace HandyControlDemo.Data #endif } + public bool IsGroupEnabled { get; set; } + public IList DemoItemList { get; set; } } } diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoItemModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoItemModel.cs index 7b59ed59..b0811427 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoItemModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoItemModel.cs @@ -6,6 +6,8 @@ namespace HandyControlDemo.Data { public string Name { get; set; } + public string GroupName { get; set; } + public string TargetCtlName { get; set; } public string ImageName { get; set; } diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs index 3b4f736f..41a251d0 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs @@ -1210,6 +1210,17 @@ namespace HandyControlDemo.Properties.Langs } } + /// + /// 查找类似 杂项 的本地化字符串。 + /// + public static string Misc + { + get + { + return ResourceManager.GetString("Misc", resourceCulture); + } + } + /// /// 查找类似 变形动画 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ca-ES.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ca-ES.resx index 2be7cd79..e5a48569 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ca-ES.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ca-ES.resx @@ -771,4 +771,7 @@ UniformSpacingPanel + + Misc + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx index 4f3db65f..f99decbe 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx @@ -771,4 +771,7 @@ UniformSpacingPanel + + Misc + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx index 4a00911a..8dfbec2e 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx @@ -771,4 +771,7 @@ UniformSpacingPanel + + Misc + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx index f1f0207d..015fa22f 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx @@ -771,4 +771,7 @@ UniformSpacingPanel + + Misc + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx index f0a1389a..1f042458 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx @@ -771,4 +771,7 @@ UniformSpacingPanel + + Misc + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.pt-BR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.pt-BR.resx index d401cfd8..8b813b9b 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.pt-BR.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.pt-BR.resx @@ -771,4 +771,7 @@ UniformSpacingPanel + + Misc + \ 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 0fbd6032..8d2288f4 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx @@ -771,4 +771,7 @@ 等间距布局 + + 杂项 + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx index 4f3db65f..f99decbe 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx @@ -771,4 +771,7 @@ UniformSpacingPanel + + Misc + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx index ea6b04b6..6df43887 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx @@ -771,4 +771,7 @@ UniformSpacingPanel + + Misc + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml b/src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml index c526ea38..8791b103 100644 --- a/src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml +++ b/src/Shared/HandyControlDemo_Shared/Resources/Themes/Styles/Style.xaml @@ -203,4 +203,17 @@ - \ 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 31c0a333..1bbd4440 100644 --- a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs +++ b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs @@ -383,14 +383,18 @@ namespace HandyControlDemo.Service { var titleKey = (string) item.title; var title = titleKey; - var list = Convert2DemoItemList(item.demoItemList); - infoList.Add(new DemoInfoModel + List list = Convert2DemoItemList(item.demoItemList); + + var demoInfoModel = new DemoInfoModel { Key = titleKey, Title = title, DemoItemList = list, - SelectedIndex = (int) item.selectedIndex - }); + SelectedIndex = (int) item.selectedIndex, + IsGroupEnabled = (bool) item.group + }; + + infoList.Add(demoInfoModel); } return infoList; @@ -406,13 +410,19 @@ namespace HandyControlDemo.Service string targetCtlName = item[1]; string imageName = item[2]; var isNew = !string.IsNullOrEmpty((string) item[3]); + var groupName = (string) item[4]; + if (string.IsNullOrEmpty(groupName)) + { + groupName = "Misc"; + } resultList.Add(new DemoItemModel { Name = name, TargetCtlName = targetCtlName, ImageName = $"../../Resources/Img/LeftMainContent/{imageName}.png", - IsNew = isNew + IsNew = isNew, + GroupName = groupName }); } diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml index cf4160b3..aecee549 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml @@ -46,7 +46,7 @@ - + @@ -56,6 +56,9 @@ + + + @@ -67,4 +70,4 @@ - \ No newline at end of file + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs index e62af88d..adec3756 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs @@ -1,8 +1,12 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Threading; using HandyControl.Data; +using HandyControl.Tools; using HandyControlDemo.Data; using HandyControlDemo.ViewModel; @@ -30,7 +34,9 @@ namespace HandyControlDemo.UserControl var selectedIndex = demoInfo.SelectedIndex; demoInfo.SelectedIndex = -1; demoInfo.SelectedIndex = selectedIndex; + FilterItems(); + GroupItems(sender as TabControl, demoInfo); } } @@ -92,5 +98,20 @@ namespace HandyControlDemo.UserControl } } } + + private void GroupItems(TabControl tabControl, DemoInfoModel demoInfo) + { + var listBox = VisualHelper.GetChild(tabControl); + if (listBox == null) return; + listBox.Items.GroupDescriptions?.Clear(); + + if (demoInfo.IsGroupEnabled) + { + Dispatcher.BeginInvoke(new Action(() => + { + listBox.Items.GroupDescriptions?.Add(new PropertyGroupDescription("GroupName")); + }), DispatcherPriority.Background); + } + } } } diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs index 4b7d3873..fa400faf 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs @@ -30,64 +30,16 @@ namespace HandyControlDemo.ViewModel /// private object _subContent; - private DataService _dataService; + private readonly DataService _dataService; #endregion public MainViewModel(DataService dataService) { _dataService = dataService; - Messenger.Default.Register(this, MessageToken.LoadShowContent, obj => - { - if (SubContent is IDisposable disposable) - { - disposable.Dispose(); - } - SubContent = obj; - }, true); - Messenger.Default.Register(this, MessageToken.ClearLeftSelected, obj => - { - DemoItemCurrent = null; - foreach (var item in DemoInfoCollection) - { - item.SelectedIndex = -1; - } - }); - - Messenger.Default.Register(this, MessageToken.LangUpdated, obj => - { - if (DemoItemCurrent == null) return; - ContentTitle = LangProvider.GetLang(DemoItemCurrent.Name); - }); - - DemoInfoCollection = new ObservableCollection(); - -#if NET40 - Task.Factory.StartNew(() => - { - DataList = dataService.GetDemoDataList(); - foreach (var item in dataService.GetDemoInfo()) - { - Application.Current.Dispatcher.BeginInvoke(new Action(() => - { - DemoInfoCollection.Add(item); - }), DispatcherPriority.ApplicationIdle); - } - }); -#else - Task.Run(() => - { - DataList = dataService.GetDemoDataList(); - foreach (var item in dataService.GetDemoInfo()) - { - Application.Current.Dispatcher.BeginInvoke(new Action(() => - { - DemoInfoCollection.Add(item); - }), DispatcherPriority.ApplicationIdle); - } - }); -#endif + UpdateMainContent(); + UpdateLeftContent(); } #region 属性 @@ -160,6 +112,56 @@ namespace HandyControlDemo.ViewModel #region 方法 + private void UpdateMainContent() + { + Messenger.Default.Register(this, MessageToken.LoadShowContent, obj => + { + if (SubContent is IDisposable disposable) + { + disposable.Dispose(); + } + SubContent = obj; + }, true); + } + + private void UpdateLeftContent() + { + //clear status + Messenger.Default.Register(this, MessageToken.ClearLeftSelected, obj => + { + DemoItemCurrent = null; + foreach (var item in DemoInfoCollection) + { + item.SelectedIndex = -1; + } + }); + + Messenger.Default.Register(this, MessageToken.LangUpdated, obj => + { + if (DemoItemCurrent == null) return; + ContentTitle = LangProvider.GetLang(DemoItemCurrent.Name); + }); + + //load items + DemoInfoCollection = new ObservableCollection(); +#if NET40 + Task.Factory.StartNew(() => +#else + Task.Run(() => +#endif + { + DataList = _dataService.GetDemoDataList(); + + foreach (var item in _dataService.GetDemoInfo()) + { + Application.Current.Dispatcher.BeginInvoke(new Action(() => + { + DemoInfoCollection.Add(item); + }), DispatcherPriority.ApplicationIdle); + } + }); + } + /// /// 切换例子 ///