diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj index 7705c249..131d6014 100644 --- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj +++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj @@ -21,6 +21,7 @@ TRACE;Core + @@ -46,6 +47,7 @@ + diff --git a/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml b/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml index 15e08920..c48c486c 100644 --- a/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml +++ b/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml @@ -117,7 +117,7 @@ - + diff --git a/src/HandyControl.sln b/src/HandyControl.sln index d4e18bab..78a3e474 100644 --- a/src/HandyControl.sln +++ b/src/HandyControl.sln @@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControl_Net_40", "Net_ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControlDemo_Net_40", "Net_40\HandyControlDemo_Net_40\HandyControlDemo_Net_40.csproj", "{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControlDemo_Code", "Shared\HandyControlDemo_Code\HandyControlDemo_Code.csproj", "{D8A4748C-0500-4F63-BC47-3506658C68F7}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Shared\HandyControl_Shared\HandyControl_Shared.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 4 @@ -102,13 +104,9 @@ Global {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Core30|Any CPU.Build.0 = Release|Any CPU {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU - {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net45|Any CPU.Build.0 = Release|Any CPU {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net462|Any CPU.ActiveCfg = Release|Any CPU - {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net462|Any CPU.Build.0 = Release|Any CPU {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net47|Any CPU.ActiveCfg = Release|Any CPU - {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net47|Any CPU.Build.0 = Release|Any CPU {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net48|Any CPU.ActiveCfg = Release|Any CPU - {BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net48|Any CPU.Build.0 = Release|Any CPU {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Core30|Any CPU.ActiveCfg = Debug|Any CPU {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Core30|Any CPU.Build.0 = Debug|Any CPU {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU @@ -120,13 +118,9 @@ Global {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Core30|Any CPU.Build.0 = Release|Any CPU {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU - {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net45|Any CPU.Build.0 = Release|Any CPU {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net462|Any CPU.ActiveCfg = Release|Any CPU - {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net462|Any CPU.Build.0 = Release|Any CPU {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net47|Any CPU.ActiveCfg = Release|Any CPU - {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net47|Any CPU.Build.0 = Release|Any CPU {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net48|Any CPU.ActiveCfg = Release|Any CPU - {D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net48|Any CPU.Build.0 = Release|Any CPU {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Core30|Any CPU.ActiveCfg = Debug|Any CPU {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Net40|Any CPU.Build.0 = Debug|Any CPU @@ -138,13 +132,9 @@ Global {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net40|Any CPU.Build.0 = Release|Any CPU {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU - {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net45|Any CPU.Build.0 = Release|Any CPU {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net462|Any CPU.ActiveCfg = Release|Any CPU - {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net462|Any CPU.Build.0 = Release|Any CPU {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net47|Any CPU.ActiveCfg = Release|Any CPU - {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net47|Any CPU.Build.0 = Release|Any CPU {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net48|Any CPU.ActiveCfg = Release|Any CPU - {32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net48|Any CPU.Build.0 = Release|Any CPU {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Core30|Any CPU.ActiveCfg = Debug|Any CPU {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Net40|Any CPU.Build.0 = Debug|Any CPU @@ -156,13 +146,33 @@ Global {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net40|Any CPU.Build.0 = Release|Any CPU {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU - {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net45|Any CPU.Build.0 = Release|Any CPU {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net462|Any CPU.ActiveCfg = Release|Any CPU - {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net462|Any CPU.Build.0 = Release|Any CPU {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net47|Any CPU.ActiveCfg = Release|Any CPU - {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net47|Any CPU.Build.0 = Release|Any CPU {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net48|Any CPU.ActiveCfg = Release|Any CPU - {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net48|Any CPU.Build.0 = Release|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Core30|Any CPU.ActiveCfg = Debug-Net48|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Core30|Any CPU.Build.0 = Debug-Net48|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net40|Any CPU.ActiveCfg = Debug-Net40|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net40|Any CPU.Build.0 = Debug-Net40|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net462|Any CPU.ActiveCfg = Debug-Net462|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net462|Any CPU.Build.0 = Debug-Net462|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net47|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net47|Any CPU.Build.0 = Debug-Net47|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net48|Any CPU.ActiveCfg = Debug-Net48|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Debug-Net48|Any CPU.Build.0 = Debug-Net48|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Core30|Any CPU.ActiveCfg = Release-Net48|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Core30|Any CPU.Build.0 = Release-Net48|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net40|Any CPU.ActiveCfg = Release-Net40|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net40|Any CPU.Build.0 = Release-Net40|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net462|Any CPU.ActiveCfg = Release-Net462|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net462|Any CPU.Build.0 = Release-Net462|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net47|Any CPU.ActiveCfg = Release-Net47|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net48|Any CPU.ActiveCfg = Release-Net48|Any CPU + {D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net48|Any CPU.Build.0 = Release-Net48|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -176,6 +186,7 @@ Global {D7107690-8592-4F9F-9379-9B82C1C15D2A} = {B838C973-06F0-48A1-B259-A357AAF2D8D4} {32204503-2EF0-4681-AE13-AA1FEB6C658A} = {35E3F9C0-8924-4536-BE09-F3761FDBF066} {D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231} = {35E3F9C0-8924-4536-BE09-F3761FDBF066} + {D8A4748C-0500-4F63-BC47-3506658C68F7} = {0938270D-E9F0-489B-AF9E-5C5AD7C69897} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D4636382-1A18-4079-A3E7-054DD970F179} 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 3da0dae4..52e82269 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -57,6 +57,9 @@ + + 6.0.1 + 5.4.1.1 @@ -395,6 +398,10 @@ + + {d8a4748c-0500-4f63-bc47-3506658c68f7} + HandyControlDemo_Code + {32204503-2ef0-4681-ae13-aa1feb6c658a} HandyControl_Net_40 diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/Window.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/Window.xaml index b0203625..a9e520ac 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Styles/Window.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/Window.xaml @@ -118,7 +118,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 6b365cd1..0d81c9b3 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -127,12 +127,19 @@ + + {d8a4748c-0500-4f63-bc47-3506658c68f7} + HandyControlDemo_Code + {dc966e3d-bcff-4652-98cf-070e5494749a} HandyControl_Net_GE45 + + 6.0.1 + 5.4.1.1 diff --git a/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/Window.xaml b/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/Window.xaml index 84b09e51..82e8e68b 100644 --- a/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/Window.xaml +++ b/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/Window.xaml @@ -117,7 +117,7 @@ - + diff --git a/src/Shared/HandyControlDemo_Code/DemoHelper.cs b/src/Shared/HandyControlDemo_Code/DemoHelper.cs new file mode 100644 index 00000000..b45e370e --- /dev/null +++ b/src/Shared/HandyControlDemo_Code/DemoHelper.cs @@ -0,0 +1,25 @@ +using System; +using System.IO; +using System.Windows; + +public class DemoHelper +{ + public static void Main() + { + + } + + public static string GetCode(string demoName) + { + var uri = new Uri($"/HandyControlDemoCode;component/{demoName}", UriKind.Relative); + var resourceStream = Application.GetResourceStream(uri); + if (resourceStream != null) + { + using var reader = new StreamReader(resourceStream.Stream); + var code = reader.ReadToEnd(); + return code; + } + + return ""; + } +} \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj b/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj new file mode 100644 index 00000000..db149ee9 --- /dev/null +++ b/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj @@ -0,0 +1,990 @@ + + + + + Debug + AnyCPU + {D8A4748C-0500-4F63-BC47-3506658C68F7} + Library + HandyControlDemoCode + HandyControlDemoCode + v4.0 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE;netle45;netle40 + prompt + 4 + v4.0 + 8.0 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + v4.5 + 8.0 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + v4.6.2 + 8.0 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + v4.7 + 8.0 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + v4.8 + 8.0 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE;netle45;netle40 + prompt + 4 + v4.0 + 8.0 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + v4.5 + 8.0 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + v4.6.2 + 8.0 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + v4.7 + 8.0 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + v4.8 + 8.0 + + + + + + + + + + Window\AboutWindow.xaml + + + Window\BlurWindow.xaml + + + Window\CommonWindow.xaml + + + Window\CustomNonClientAreaWindow.xaml + + + Window\DialogDemoWindow.xaml + + + Window\GlowWindow.xaml + + + Window\GrowlDemoWindow.xaml + + + Window\NativeCommonWindow.xaml + + + Window\NavigationWindow.xaml + + + Window\NoNonClientAreaDragableWindow.xaml + + + UserControl\Basic\Avatar.xaml + + + UserControl\Basic\ChatBox.xaml + + + UserControl\Basic\InteractiveDialog.xaml + + + UserControl\Basic\TextDialog.xaml + + + UserControl\Basic\TextDialogWithTimer.xaml + + + UserControl\Controls\AnimationPathDemoCtl.xaml + + + UserControl\Controls\BadgeDemoCtl.xaml + + + UserControl\Controls\ButtonGroupDemoCtl.xaml + + + UserControl\Controls\CalendarWithClockDemoCtl.xaml + + + UserControl\Controls\CardDemoCtl.xaml + + + UserControl\Controls\CarouselDemoCtl.xaml + + + UserControl\Controls\ChatBubbleDemoCtl.xaml + + + UserControl\Controls\CirclePanelDemoCtl.xaml + + + UserControl\Controls\ClockDemoCtl.xaml + + + UserControl\Controls\ColorPickerDemoCtl.xaml + + + UserControl\Controls\ComboBoxDemoCtl.xaml + + + UserControl\Controls\CompareSliderDemoCtl.xaml + + + UserControl\Controls\CoverFlowDemoCtl.xaml + + + UserControl\Controls\CoverViewDemoCtl.xaml + + + UserControl\Controls\DatePickerDemoCtl.xaml + + + UserControl\Controls\DateTimePickerDemoCtl.xaml + + + UserControl\Controls\DialogDemoCtl.xaml + + + UserControl\Controls\DividerDemoCtl.xaml + + + UserControl\Controls\DrawerDemoCtl.xaml + + + UserControl\Controls\FlipClockDemoCtl.xaml + + + UserControl\Controls\FloatingBlockDemoCtl.xaml + + + UserControl\Controls\GifImageDemoCtl.xaml + + + UserControl\Controls\GotoTopDemoCtl.xaml + + + UserControl\Controls\GravatarDemoCtl.xaml + + + UserControl\Controls\GridDemoCtl.xaml + + + UserControl\Controls\GrowlDemoCtl.xaml + + + UserControl\Controls\HoneycombPanelDemoCtl.xaml + + + UserControl\Controls\ImageBlockDemoCtl.xaml + + + UserControl\Controls\ImageBrowserDemoCtl.xaml + + + UserControl\Controls\LoadingDemoCtl.xaml + + + UserControl\Controls\MagnifierDemoCtl.xaml + + + UserControl\Controls\NotificationDemoCtl.xaml + + + UserControl\Controls\NotifyIconDemoCtl.xaml + + + UserControl\Controls\NumericUpDownDemoCtl.xaml + + + UserControl\Controls\OutlineTextDemoCtl.xaml + + + UserControl\Controls\PaginationDemoCtl.xaml + + + UserControl\Controls\PasswordBoxDemoCtl.xaml + + + UserControl\Controls\PinBoxDemoCtl.xaml + + + UserControl\Controls\PoptipDemoCtl.xaml + + + UserControl\Controls\PreviewSliderDemoCtl.xaml + + + UserControl\Controls\ProgressBarDemoCtl.xaml + + + UserControl\Controls\ProgressButtonDemoCtl.xaml + + + UserControl\Controls\RangeSliderDemoCtl.xaml + + + UserControl\Controls\RateDemoCtl.xaml + + + UserControl\Controls\RelativePanelDemoCtl.xaml + + + UserControl\Controls\RunningBlockDemoCtl.xaml + + + UserControl\Controls\ScrollViewerDemoCtl.xaml + + + UserControl\Controls\SearchBarDemoCtl.xaml + + + UserControl\Controls\ShieldDemoCtl.xaml + + + UserControl\Controls\SideMenuDemoCtl.xaml + + + UserControl\Controls\SplitButtonDemoCtl.xaml + + + UserControl\Controls\SpriteDemoCtl.xaml + + + UserControl\Controls\StepBarDemoCtl.xaml + + + UserControl\Controls\TabControlDemoCtl.xaml + + + UserControl\Controls\TagDemoCtl.xaml + + + UserControl\Controls\TextBoxDemoCtl.xaml + + + UserControl\Controls\TimeBarDemoCtl.xaml + + + UserControl\Controls\TimePickerDemoCtl.xaml + + + UserControl\Controls\TransferDemoCtl.xaml + + + UserControl\Controls\TransitioningContentControlDemoCtl.xaml + + + UserControl\Controls\WaterfallPanelDemoCtl.xaml + + + UserControl\Controls\WindowDemoCtl.xaml + + + UserControl\Styles\BorderDemoCtl.xaml + + + UserControl\Styles\BrushDemoCtl.xaml + + + UserControl\Styles\ButtonDemoCtl.xaml + + + UserControl\Styles\CalendarDemoCtl.xaml + + + UserControl\Styles\CheckBoxDemoCtl.xaml + + + UserControl\Styles\DataGridDemoCtl.xaml + + + UserControl\Styles\ExpanderDemoCtl.xaml + + + UserControl\Styles\FlowDocumentDemoCtl.xaml + + + UserControl\Styles\FrameDemoCtl.xaml + + + UserControl\Styles\GroupBoxDemoCtl.xaml + + + UserControl\Styles\LabelDemoCtl.xaml + + + UserControl\Styles\ListBoxDemoCtl.xaml + + + UserControl\Styles\ListViewDemoCtl.xaml + + + UserControl\Styles\MenuDemoCtl.xaml + + + UserControl\Styles\NativeComboBoxDemoCtl.xaml + + + UserControl\Styles\NativeDatePickerDemoCtl.xaml + + + UserControl\Styles\NativePasswordBoxDemoCtl.xaml + + + UserControl\Styles\NativeProgressBarDemoCtl.xaml + + + UserControl\Styles\NativeScrollViewerDemoCtl.xaml + + + UserControl\Styles\NativeTabControlDemoCtl.xaml + + + UserControl\Styles\NativeTextBoxDemoCtl.xaml + + + UserControl\Styles\NativeWindowDemoCtl.xaml + + + UserControl\Styles\RadioButtonDemoCtl.xaml + + + UserControl\Styles\RepeatButtonDemoCtl.xaml + + + UserControl\Styles\RichTextBoxDemoCtl.xaml + + + UserControl\Styles\SliderDemoCtl.xaml + + + UserControl\Styles\TextBlockDemoCtl.xaml + + + UserControl\Styles\ToggleButtonDemoCtl.xaml + + + UserControl\Styles\ToolBarDemoCtl.xaml + + + UserControl\Styles\TreeViewDemoCtl.xaml + + + UserControl\Tools\EffectsDemoCtl.xaml + + + UserControl\Tools\GeometryAnimationDemoCtl.xaml + + + UserControl\Tools\HatchBrushGeneratorDemoCtl.xaml + + + + + Window\AboutWindow.xaml.cs + AboutWindow.xaml + + + Window\BlurWindow.xaml.cs + BlurWindow.xaml + + + Window\CommonWindow.xaml.cs + CommonWindow.xaml + + + Window\CustomNonClientAreaWindow.xaml.cs + CustomNonClientAreaWindow.xaml + + + Window\DialogDemoWindow.xaml.cs + DialogDemoWindow.xaml + + + Window\GlowWindow.xaml.cs + GlowWindow.xaml + + + Window\GrowlDemoWindow.xaml.cs + GrowlDemoWindow.xaml + + + Window\NativeCommonWindow.xaml.cs + NativeCommonWindow.xaml + + + Window\NavigationWindow.xaml.cs + NavigationWindow.xaml + + + Window\NoNonClientAreaDragableWindow.xaml.cs + NoNonClientAreaDragableWindow.xaml + + + UserControl\Basic\Avatar.xaml.cs + Avatar.xaml + + + UserControl\Basic\ChatBox.xaml.cs + ChatBox.xaml + + + UserControl\Basic\IFull.cs + + + UserControl\Basic\InteractiveDialog.xaml.cs + InteractiveDialog.xaml + + + UserControl\Basic\TextDialog.xaml.cs + TextDialog.xaml + + + UserControl\Basic\TextDialogWithTimer.xaml.cs + TextDialogWithTimer.xaml + + + UserControl\Controls\AnimationPathDemoCtl.xaml.cs + AnimationPathDemoCtl.xaml + + + UserControl\Controls\BadgeDemoCtl.xaml.cs + BadgeDemoCtl.xaml + + + UserControl\Controls\ButtonGroupDemoCtl.xaml.cs + ButtonGroupDemoCtl.xaml + + + UserControl\Controls\CalendarWithClockDemoCtl.xaml.cs + CalendarWithClockDemoCtl.xaml + + + UserControl\Controls\CardDemoCtl.xaml.cs + CardDemoCtl.xaml + + + UserControl\Controls\CarouselDemoCtl.xaml.cs + CarouselDemoCtl.xaml + + + UserControl\Controls\ChatBubbleDemoCtl.xaml.cs + ChatBubbleDemoCtl.xaml + + + UserControl\Controls\CirclePanelDemoCtl.xaml.cs + CirclePanelDemoCtl.xaml + + + UserControl\Controls\ClockDemoCtl.xaml.cs + ClockDemoCtl.xaml + + + UserControl\Controls\ColorPickerDemoCtl.xaml.cs + ColorPickerDemoCtl.xaml + + + UserControl\Controls\ComboBoxDemoCtl.xaml.cs + ComboBoxDemoCtl.xaml + + + UserControl\Controls\CompareSliderDemoCtl.xaml.cs + CompareSliderDemoCtl.xaml + + + UserControl\Controls\CoverFlowDemoCtl.xaml.cs + CoverFlowDemoCtl.xaml + + + UserControl\Controls\CoverViewDemoCtl.xaml.cs + CoverViewDemoCtl.xaml + + + UserControl\Controls\DatePickerDemoCtl.xaml.cs + DatePickerDemoCtl.xaml + + + UserControl\Controls\DateTimePickerDemoCtl.xaml.cs + DateTimePickerDemoCtl.xaml + + + UserControl\Controls\DialogDemoCtl.xaml.cs + DialogDemoCtl.xaml + + + UserControl\Controls\DividerDemoCtl.xaml.cs + DividerDemoCtl.xaml + + + UserControl\Controls\DrawerDemoCtl.xaml.cs + DrawerDemoCtl.xaml + + + UserControl\Controls\FlipClockDemoCtl.xaml.cs + FlipClockDemoCtl.xaml + + + UserControl\Controls\FloatingBlockDemoCtl.xaml.cs + FloatingBlockDemoCtl.xaml + + + UserControl\Controls\GifImageDemoCtl.xaml.cs + GifImageDemoCtl.xaml + + + UserControl\Controls\GotoTopDemoCtl.xaml.cs + GotoTopDemoCtl.xaml + + + UserControl\Controls\GravatarDemoCtl.xaml.cs + GravatarDemoCtl.xaml + + + UserControl\Controls\GridDemoCtl.xaml.cs + GridDemoCtl.xaml + + + UserControl\Controls\GrowlDemoCtl.xaml.cs + GrowlDemoCtl.xaml + + + UserControl\Controls\HoneycombPanelDemoCtl.xaml.cs + HoneycombPanelDemoCtl.xaml + + + UserControl\Controls\ImageBlockDemoCtl.xaml.cs + ImageBlockDemoCtl.xaml + + + UserControl\Controls\ImageBrowserDemoCtl.xaml.cs + ImageBrowserDemoCtl.xaml + + + UserControl\Controls\LoadingDemoCtl.xaml.cs + LoadingDemoCtl.xaml + + + UserControl\Controls\MagnifierDemoCtl.xaml.cs + MagnifierDemoCtl.xaml + + + UserControl\Controls\NotificationDemoCtl.xaml.cs + NotificationDemoCtl.xaml + + + UserControl\Controls\NotifyIconDemoCtl.xaml.cs + NotifyIconDemoCtl.xaml + + + UserControl\Controls\NumericUpDownDemoCtl.xaml.cs + NumericUpDownDemoCtl.xaml + + + UserControl\Controls\OutlineTextDemoCtl.xaml.cs + OutlineTextDemoCtl.xaml + + + UserControl\Controls\PaginationDemoCtl.xaml.cs + PaginationDemoCtl.xaml + + + UserControl\Controls\PasswordBoxDemoCtl.xaml.cs + PasswordBoxDemoCtl.xaml + + + UserControl\Controls\PinBoxDemoCtl.xaml.cs + PinBoxDemoCtl.xaml + + + UserControl\Controls\PoptipDemoCtl.xaml.cs + PoptipDemoCtl.xaml + + + UserControl\Controls\PreviewSliderDemoCtl.xaml.cs + PreviewSliderDemoCtl.xaml + + + UserControl\Controls\ProgressBarDemoCtl.xaml.cs + ProgressBarDemoCtl.xaml + + + UserControl\Controls\ProgressButtonDemoCtl.xaml.cs + ProgressButtonDemoCtl.xaml + + + UserControl\Controls\RangeSliderDemoCtl.xaml.cs + RangeSliderDemoCtl.xaml + + + UserControl\Controls\RateDemoCtl.xaml.cs + RateDemoCtl.xaml + + + UserControl\Controls\RelativePanelDemoCtl.xaml.cs + RelativePanelDemoCtl.xaml + + + UserControl\Controls\RunningBlockDemoCtl.xaml.cs + RunningBlockDemoCtl.xaml + + + UserControl\Controls\ScrollViewerDemoCtl.xaml.cs + ScrollViewerDemoCtl.xaml + + + UserControl\Controls\SearchBarDemoCtl.xaml.cs + SearchBarDemoCtl.xaml + + + UserControl\Controls\ShieldDemoCtl.xaml.cs + ShieldDemoCtl.xaml + + + UserControl\Controls\SideMenuDemoCtl.xaml.cs + SideMenuDemoCtl.xaml + + + UserControl\Controls\SplitButtonDemoCtl.xaml.cs + SplitButtonDemoCtl.xaml + + + UserControl\Controls\SpriteDemoCtl.xaml.cs + SpriteDemoCtl.xaml + + + UserControl\Controls\StepBarDemoCtl.xaml.cs + StepBarDemoCtl.xaml + + + UserControl\Controls\TabControlDemoCtl.xaml.cs + TabControlDemoCtl.xaml + + + UserControl\Controls\TagDemoCtl.xaml.cs + TagDemoCtl.xaml + + + UserControl\Controls\TextBoxDemoCtl.xaml.cs + TextBoxDemoCtl.xaml + + + UserControl\Controls\TimeBarDemoCtl.xaml.cs + TimeBarDemoCtl.xaml + + + UserControl\Controls\TimePickerDemoCtl.xaml.cs + TimePickerDemoCtl.xaml + + + UserControl\Controls\TransferDemoCtl.xaml.cs + TransferDemoCtl.xaml + + + UserControl\Controls\TransitioningContentControlDemoCtl.xaml.cs + TransitioningContentControlDemoCtl.xaml + + + UserControl\Controls\WaterfallPanelDemoCtl.xaml.cs + WaterfallPanelDemoCtl.xaml + + + UserControl\Controls\WindowDemoCtl.xaml.cs + WindowDemoCtl.xaml + + + UserControl\Styles\BorderDemoCtl.xaml.cs + BorderDemoCtl.xaml + + + UserControl\Styles\BrushDemoCtl.xaml.cs + BrushDemoCtl.xaml + + + UserControl\Styles\ButtonDemoCtl.xaml.cs + ButtonDemoCtl.xaml + + + UserControl\Styles\CalendarDemoCtl.xaml.cs + CalendarDemoCtl.xaml + + + UserControl\Styles\CheckBoxDemoCtl.xaml.cs + CheckBoxDemoCtl.xaml + + + UserControl\Styles\DataGridDemoCtl.xaml.cs + DataGridDemoCtl.xaml + + + UserControl\Styles\ExpanderDemoCtl.xaml.cs + ExpanderDemoCtl.xaml + + + UserControl\Styles\FlowDocumentDemoCtl.xaml.cs + FlowDocumentDemoCtl.xaml + + + UserControl\Styles\FrameDemoCtl.xaml.cs + FrameDemoCtl.xaml + + + UserControl\Styles\GroupBoxDemoCtl.xaml.cs + GroupBoxDemoCtl.xaml + + + UserControl\Styles\LabelDemoCtl.xaml.cs + LabelDemoCtl.xaml + + + UserControl\Styles\ListBoxDemoCtl.xaml.cs + ListBoxDemoCtl.xaml + + + UserControl\Styles\ListViewDemoCtl.xaml.cs + ListViewDemoCtl.xaml + + + UserControl\Styles\MenuDemoCtl.xaml.cs + MenuDemoCtl.xaml + + + UserControl\Styles\NativeComboBoxDemoCtl.xaml.cs + NativeComboBoxDemoCtl.xaml + + + UserControl\Styles\NativeDatePickerDemoCtl.xaml.cs + NativeDatePickerDemoCtl.xaml + + + UserControl\Styles\NativePasswordBoxDemoCtl.xaml.cs + NativePasswordBoxDemoCtl.xaml + + + UserControl\Styles\NativeProgressBarDemoCtl.xaml.cs + NativeProgressBarDemoCtl.xaml + + + UserControl\Styles\NativeScrollViewerDemoCtl.xaml.cs + NativeScrollViewerDemoCtl.xaml + + + UserControl\Styles\NativeTabControlDemoCtl.xaml.cs + NativeTabControlDemoCtl.xaml + + + UserControl\Styles\NativeTextBoxDemoCtl.xaml.cs + NativeTextBoxDemoCtl.xaml + + + UserControl\Styles\NativeWindowDemoCtl.xaml.cs + NativeWindowDemoCtl.xaml + + + UserControl\Styles\RadioButtonDemoCtl.xaml.cs + RadioButtonDemoCtl.xaml + + + UserControl\Styles\RepeatButtonDemoCtl.xaml.cs + RepeatButtonDemoCtl.xaml + + + UserControl\Styles\RichTextBoxDemoCtl.xaml.cs + RichTextBoxDemoCtl.xaml + + + UserControl\Styles\SliderDemoCtl.xaml.cs + SliderDemoCtl.xaml + + + UserControl\Styles\TextBlockDemoCtl.xaml.cs + TextBlockDemoCtl.xaml + + + UserControl\Styles\ToggleButtonDemoCtl.xaml.cs + ToggleButtonDemoCtl.xaml + + + UserControl\Styles\ToolBarDemoCtl.xaml.cs + ToolBarDemoCtl.xaml + + + UserControl\Styles\TreeViewDemoCtl.xaml.cs + TreeViewDemoCtl.xaml + + + UserControl\Tools\EffectsDemoCtl.xaml.cs + EffectsDemoCtl.xaml + + + UserControl\Tools\GeometryAnimationDemoCtl.xaml.cs + GeometryAnimationDemoCtl.xaml + + + UserControl\Tools\HatchBrushGeneratorDemoCtl.xaml.cs + HatchBrushGeneratorDemoCtl.xaml + + + + + ViewModel\ChatBoxViewModel.cs + + + ViewModel\InteractiveDialogViewModel.cs + + + ViewModel\ComboBoxDemoViewModel.cs + + + ViewModel\BadgeDemoViewModel.cs + + + ViewModel\CardDemoViewModel.cs + + + ViewModel\CoverViewModel.cs + + + ViewModel\DialogDemoViewModel.cs + + + ViewModel\GrowlDemoViewModel.cs + + + ViewModel\ImageBrowserDemoViewModel.cs + + + ViewModel\NotificationDemoViewModel.cs + + + ViewModel\NotifyIconDemoViewModel.cs + + + ViewModel\PaginationDemoViewModel.cs + + + ViewModel\SearchBarDemoViewModel.cs + + + ViewModel\SideMenuDemoViewModel.cs + + + ViewModel\SplitButtonDemoViewModel.cs + + + ViewModel\SpriteDemoViewModel.cs + + + ViewModel\StepBarDemoViewModel.cs + + + ViewModel\TabControlDemoViewModel.cs + + + ViewModel\WindowDemoViewModel.cs + + + ViewModel\DemoViewModelBase!1.cs + + + ViewModel\ItemsDisplayViewModel.cs + + + ViewModel\MainViewModel.cs + + + ViewModel\NoUserViewModel.cs + + + + + + + + + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs index 30149de4..be5cc846 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs @@ -5,6 +5,8 @@ namespace HandyControlDemo.Data { public class DemoInfoModel : ViewModelBase { + public string Key { get; set; } + private string _title; public string Title diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index ff7903f6..bc7d84b7 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -35,7 +35,6 @@ - Avatar.xaml diff --git a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs index c4389402..c3517b70 100644 --- a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs +++ b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs @@ -373,10 +373,12 @@ namespace HandyControlDemo.Service var jsonObj = JsonConvert.DeserializeObject(jsonStr); foreach (var item in jsonObj) { - var title = Properties.Langs.Lang.ResourceManager.GetString((string)item.title); + var titleKey = (string) item.title; + var title = Properties.Langs.Lang.ResourceManager.GetString(titleKey); var list = Convert2DemoItemList(item.demoItemList); infoList.Add(new DemoInfoModel { + Key = titleKey, Title = title, DemoItemList = list }); diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Helper/ExternDllHelper.cs b/src/Shared/HandyControlDemo_Shared/Tools/Helper/ExternDllHelper.cs deleted file mode 100644 index a5d0e53d..00000000 --- a/src/Shared/HandyControlDemo_Shared/Tools/Helper/ExternDllHelper.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.InteropServices; - -namespace HandyControlDemo.Tools -{ - internal class ExternDllHelper - { - private const string Winmm = "winmm.dll"; - - [DllImport(Winmm, EntryPoint = "mciSendString", CharSet = CharSet.Auto)] - public static extern int MciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback); - } -} \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Helper/Win32Helper.cs b/src/Shared/HandyControlDemo_Shared/Tools/Helper/Win32Helper.cs index 0f8aeb4b..c8929ae9 100644 --- a/src/Shared/HandyControlDemo_Shared/Tools/Helper/Win32Helper.cs +++ b/src/Shared/HandyControlDemo_Shared/Tools/Helper/Win32Helper.cs @@ -7,5 +7,8 @@ namespace HandyControlDemo.Tools { [DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)] public static extern bool SetForegroundWindow(IntPtr hWnd); + + [DllImport("winmm.dll", EntryPoint = "mciSendString", CharSet = CharSet.Auto)] + public static extern int MciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback); } } diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs index 7826a952..804ed03d 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs @@ -5,6 +5,7 @@ using System.Windows.Controls.Primitives; using HandyControl.Data; using HandyControl.Tools.Extension; using HandyControlDemo.Data; +using HandyControlDemo.ViewModel; namespace HandyControlDemo.UserControl @@ -24,6 +25,7 @@ namespace HandyControlDemo.UserControl if (e.AddedItems.Count == 0) return; if (e.AddedItems[0] is DemoInfoModel demoInfo) { + ViewModelLocator.Instance.Main.DemoInfoCurrent = demoInfo; var selectedIndex = demoInfo.SelectedIndex; demoInfo.SelectedIndex = -1; demoInfo.SelectedIndex = selectedIndex; diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml index efe7f50e..f7b4df9d 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml @@ -1,5 +1,7 @@  @@ -10,7 +12,25 @@ - + + + + + + + + + + + + + + + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml.cs index 253c684e..47361439 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml.cs @@ -2,6 +2,7 @@ using GalaSoft.MvvmLight.Messaging; using HandyControl.Tools.Extension; using HandyControlDemo.Data; +using HandyControlDemo.ViewModel; namespace HandyControlDemo.UserControl @@ -13,6 +14,8 @@ namespace HandyControlDemo.UserControl { private bool _isFull; + private string _currentDemoKey; + public MainContent() { InitializeComponent(); @@ -43,5 +46,25 @@ namespace HandyControlDemo.UserControl PresenterMain.Margin = new Thickness(0, 0, 0, 10); } } + + private void DrawerCode_OnOpened(object sender, RoutedEventArgs e) + { + var typeKey = ViewModelLocator.Instance.Main.DemoInfoCurrent.Key; + var demoKey = ViewModelLocator.Instance.Main.DemoItemCurrent.TargetCtlName; + if (Equals(_currentDemoKey, demoKey)) return; + _currentDemoKey = demoKey; + + if (ViewModelLocator.Instance.Main.SubContent is FrameworkElement demoCtl) + { + var xamlPath = $"UserControl/{typeKey}/{demoCtl.GetType().Name}.xaml"; + var dc = demoCtl.DataContext; + var dcTypeName = dc.GetType().Name; + var vmPath = $"ViewModel/{dcTypeName}"; + + EditorXaml.Text = DemoHelper.GetCode(xamlPath); + EditorCs.Text = DemoHelper.GetCode($"{xamlPath}.cs"); + EditorVm.Text = DemoHelper.GetCode($"{vmPath}.cs"); + } + } } } \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/ChatBoxViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/ChatBoxViewModel.cs index 7fc48de2..e19fd556 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/ChatBoxViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/ChatBoxViewModel.cs @@ -104,12 +104,12 @@ namespace HandyControlDemo.ViewModel private void StartRecord() { - ExternDllHelper.MciSendString("set wave bitpersample 8", "", 0, 0); - ExternDllHelper.MciSendString("set wave samplespersec 20000", "", 0, 0); - ExternDllHelper.MciSendString("set wave channels 2", "", 0, 0); - ExternDllHelper.MciSendString("set wave format tag pcm", "", 0, 0); - ExternDllHelper.MciSendString("open new type WAVEAudio alias movie", "", 0, 0); - ExternDllHelper.MciSendString("record movie", "", 0, 0); + Win32Helper.MciSendString("set wave bitpersample 8", "", 0, 0); + Win32Helper.MciSendString("set wave samplespersec 20000", "", 0, 0); + Win32Helper.MciSendString("set wave channels 2", "", 0, 0); + Win32Helper.MciSendString("set wave format tag pcm", "", 0, 0); + Win32Helper.MciSendString("open new type WAVEAudio alias movie", "", 0, 0); + Win32Helper.MciSendString("record movie", "", 0, 0); _stopwatch.Reset(); _stopwatch.Start(); @@ -135,9 +135,9 @@ namespace HandyControlDemo.ViewModel var cachePath = $"{AudioCachePath}\\{Guid.NewGuid().ToString()}"; var cachePathWithQuotes = $"\"{cachePath}\""; - ExternDllHelper.MciSendString("stop movie", "", 0, 0); - ExternDllHelper.MciSendString($"save movie {cachePathWithQuotes}", "", 0, 0); - ExternDllHelper.MciSendString("close movie", "", 0, 0); + Win32Helper.MciSendString("stop movie", "", 0, 0); + Win32Helper.MciSendString($"save movie {cachePathWithQuotes}", "", 0, 0); + Win32Helper.MciSendString("close movie", "", 0, 0); _stopwatch.Stop(); diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs index 755d2e9e..711ec606 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs @@ -34,11 +34,6 @@ namespace HandyControlDemo.ViewModel /// private List _demoInfoList; - /// - /// 当前选中的demo项 - /// - private DemoItemModel _demoItemCurrent; - #endregion public MainViewModel(DataService dataService) @@ -54,7 +49,7 @@ namespace HandyControlDemo.ViewModel Messenger.Default.Register(this, MessageToken.ClearLeftSelected, obj => { - _demoItemCurrent = null; + DemoItemCurrent = null; foreach (var item in DemoInfoList) { item.SelectedIndex = -1; @@ -67,6 +62,13 @@ namespace HandyControlDemo.ViewModel #region 属性 + /// + /// 当前选中的demo项 + /// + public DemoItemModel DemoItemCurrent { get; private set; } + + public DemoInfoModel DemoInfoCurrent { get; set; } + /// /// 子内容 /// @@ -141,9 +143,9 @@ namespace HandyControlDemo.ViewModel if (e.AddedItems.Count == 0) return; if (e.AddedItems[0] is DemoItemModel item) { - if (Equals(_demoItemCurrent, item)) return; + if (Equals(DemoItemCurrent, item)) return; - _demoItemCurrent = item; + DemoItemCurrent = item; ContentTitle = item.Name; var obj = AssemblyHelper.ResolveByKey(item.TargetCtlName); var ctl = obj ?? AssemblyHelper.CreateInternalInstance($"UserControl.{item.TargetCtlName}"); diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Drawer.cs b/src/Shared/HandyControl_Shared/Controls/Other/Drawer.cs index c99d5e16..244e7ca6 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Drawer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Drawer.cs @@ -68,6 +68,26 @@ namespace HandyControl.Controls } } + public static readonly RoutedEvent OpenedEvent = + EventManager.RegisterRoutedEvent("Opened", RoutingStrategy.Bubble, + typeof(RoutedEventHandler), typeof(Drawer)); + + public event RoutedEventHandler Opened + { + add => AddHandler(OpenedEvent, value); + remove => RemoveHandler(OpenedEvent, value); + } + + public static readonly RoutedEvent ClosedEvent = + EventManager.RegisterRoutedEvent("Closed", RoutingStrategy.Bubble, + typeof(RoutedEventHandler), typeof(Drawer)); + + public event RoutedEventHandler Closed + { + add => AddHandler(ClosedEvent, value); + remove => RemoveHandler(ClosedEvent, value); + } + public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( "IsOpen", typeof(bool), typeof(Drawer), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsOpenChanged)); @@ -217,6 +237,11 @@ namespace HandyControl.Controls { _windowContentElement.SetCurrentValue(RenderTransformOriginProperty, _contentRenderTransformOrigin); _layer.Remove(_container); + RaiseEvent(new RoutedEventArgs(ClosedEvent, this)); + } + else + { + RaiseEvent(new RoutedEventArgs(OpenedEvent, this)); } } @@ -284,7 +309,6 @@ namespace HandyControl.Controls Storyboard.SetTargetProperty(drawerAnimation, new PropertyPath(_animationPropertyName)); _storyboard.Children.Add(drawerAnimation); } - _storyboard.Begin(); }