Merge pull request #239 from HandyOrg/add-Drawer

Add drawer
This commit is contained in:
NaBian authored and GitHub committed 2019-11-26 00:48:47 +08:00
commit 390899d730
31 files changed
+984 -72

No files matched your search

+8 -4
View File
@@ -42,8 +42,8 @@
<a href="https://github.com/IUpdatable" target="_blank"><img width="64px" src="https://avatars2.githubusercontent.com/u/51181716?s=400&v=4"></a>
<a href="https://github.com/maplewei" target="_blank"><img width="64px" src="https://avatars1.githubusercontent.com/u/13778095?s=400&v=4"></a>
<a href="https://github.com/sunshang-hl" target="_blank"><img width="64px" src="https://avatars1.githubusercontent.com/u/34593206?s=400&v=4"></a>
<a href="https://github.com/yangkang326" target="_blank"><img width="64px" src="https://avatars1.githubusercontent.com/u/51224259?s=400&v=4"></a>
<a href="https://github.com/zmrbak" target="_blank"><img width="64px" src="https://avatars3.githubusercontent.com/u/7257543?s=400&v=4"></a>
<a href="https://github.com/yangkang326" target="_blank"><img width="64px" src="https://avatars1.githubusercontent.com/u/51224259?s=400&v=4"></a>
<a href="https://github.com/zmrbak" target="_blank"><img width="64px" src="https://avatars3.githubusercontent.com/u/7257543?s=400&v=4"></a>
<a href="https://github.com/AFei19911012" target="_blank"><img width="64px" src="https://avatars0.githubusercontent.com/u/31465314?s=400&v=4"></a>
## Special thanks to
@@ -86,6 +86,10 @@ Step 4:enjoy coding
## Latest examples
### Drawer
![Drawer](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Drawer.gif)
### Poptip
![Poptip](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Poptip.gif)
@@ -102,12 +106,12 @@ Step 4:enjoy coding
![SplitButton](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/SplitButton.png)
## History publication
### FloatingBlock
![FloatingBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/FloatingBlock.gif)
## History publication
### HoneycombPanel
![HoneycombPanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/HoneycombPanel.png)
@@ -169,10 +169,10 @@
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Flag\en.png">
<Link>Resources\Img\Flag\en.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Flag\fa.png">
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Flag\fa.png">
<Link>Resources\Img\Flag\fa.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Flag\fr.png">
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Flag\fr.png">
<Link>Resources\Img\Flag\fr.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon-white.ico">
@@ -453,10 +453,10 @@
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
<Link>Properties\Langs\Lang.en.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.fa.resx">
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.fa.resx">
<Link>Properties\Langs\Lang.fa.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.fr.resx">
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.fr.resx">
<Link>Properties\Langs\Lang.fr.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.resx">
@@ -478,4 +478,4 @@
</None>
</ItemGroup>
<Import Project="..\..\Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems" Label="Shared" />
</Project>
</Project>
@@ -34,7 +34,7 @@
{
"title": "Controls",
"demoItemList": [
[ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "1" ],
[ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "" ],
[ "ImageBlock", "ImageBlockDemoCtl", "ImageStack_16x", "" ],
[ "Magnifier", "MagnifierDemoCtl", "Search_16x", "" ],
[ "Gravatar", "GravatarDemoCtl", "User_16x", "" ],
@@ -69,8 +69,9 @@
[ "CirclePanel", "CirclePanelDemoCtl", "ColorWheel_16x", "" ],
[ "Grid", "GridDemoCtl", "GridPane_16x", "" ],
[ "WaterfallPanel", "WaterfallPanelDemoCtl", "Panel_16x", "" ],
[ "HoneycombPanel", "HoneycombPanelDemoCtl", "PolygonHexagon_16x", "1" ],
[ "HoneycombPanel", "HoneycombPanelDemoCtl", "PolygonHexagon_16x", "" ],
[ "TransitioningContentControl", "TransitioningContentControlDemoCtl", "TransitioningContentControl_16x", "" ],
[ "Drawer", "DrawerDemoCtl", "View_Portrait_16x", "1" ],
[ "CoverView", "CoverViewDemoCtl", "DetailDataView_16x", "" ],
[ "CoverFlow", "CoverFlowDemoCtl", "LinearCarousel_16x", "" ],
[ "ProgressBar", "ProgressBarDemoCtl", "ProgressBar_16x", "" ],
@@ -99,7 +100,7 @@
"title": "Tools",
"demoItemList": [
[ "HatchBrushGenerator", "HatchBrushGeneratorDemoCtl", "DataGenerator_16x", "" ],
[ "Morphing Animation", "GeometryAnimationDemoCtl", "Animation_16x", "" ]
[ "Morphing Animation", "GeometryAnimationDemoCtl", "Animation_16x", "1" ]
]
}
]
@@ -2,7 +2,195 @@
{
public class MessageToken
{
/*-------------------- Windows --------------------*/
/*-------------------- Controls --------------------*/
public static readonly string GrowlDemoCtl = nameof(GrowlDemoCtl);
public static readonly string LoadingDemoCtl = nameof(LoadingDemoCtl);
public static readonly string ImageBrowserDemoCtl = nameof(ImageBrowserDemoCtl);
public static readonly string ColorPickerDemoCtl = nameof(ColorPickerDemoCtl);
public static readonly string CarouselDemoCtl = nameof(CarouselDemoCtl);
public static readonly string CompareSliderDemoCtl = nameof(CompareSliderDemoCtl);
public static readonly string TimeBarDemoCtl = nameof(TimeBarDemoCtl);
public static readonly string PaginationDemoCtl = nameof(PaginationDemoCtl);
public static readonly string AnimationPathDemoCtl = nameof(AnimationPathDemoCtl);
public static readonly string StepBarDemoCtl = nameof(StepBarDemoCtl);
public static readonly string ClockDemoCtl = nameof(ClockDemoCtl);
public static readonly string TimePickerDemoCtl = nameof(TimePickerDemoCtl);
public static readonly string CirclePanelDemoCtl = nameof(CirclePanelDemoCtl);
public static readonly string NumericUpDownDemoCtl = nameof(NumericUpDownDemoCtl);
public static readonly string WindowDemoCtl = nameof(WindowDemoCtl);
public static readonly string ScrollViewerDemoCtl = nameof(ScrollViewerDemoCtl);
public static readonly string PreviewSliderDemoCtl = nameof(PreviewSliderDemoCtl);
public static readonly string ProgressBarDemoCtl = nameof(ProgressBarDemoCtl);
public static readonly string TextBoxDemoCtl = nameof(TextBoxDemoCtl);
public static readonly string ComboBoxDemoCtl = nameof(ComboBoxDemoCtl);
public static readonly string PasswordBoxDemoCtl = nameof(PasswordBoxDemoCtl);
public static readonly string DatePickerDemoCtl = nameof(DatePickerDemoCtl);
public static readonly string DateTimePickerDemoCtl = nameof(DateTimePickerDemoCtl);
public static readonly string CalendarWithClockDemoCtl = nameof(CalendarWithClockDemoCtl);
public static readonly string SearchBarDemoCtl = nameof(SearchBarDemoCtl);
public static readonly string TagDemoCtl = nameof(TagDemoCtl);
public static readonly string GifImageDemoCtl = nameof(GifImageDemoCtl);
public static readonly string OutlineTextDemoCtl = nameof(OutlineTextDemoCtl);
public static readonly string FlipClockDemoCtl = nameof(FlipClockDemoCtl);
public static readonly string QQGroupView = nameof(QQGroupView);
public static readonly string BlurWindow = nameof(BlurWindow);
public static readonly string NoNonClientAreaDragableWindow = nameof(NoNonClientAreaDragableWindow);
public static readonly string RateDemoCtl = nameof(RateDemoCtl);
public static readonly string ShieldDemoCtl = nameof(ShieldDemoCtl);
public static readonly string WaterfallPanelDemoCtl = nameof(WaterfallPanelDemoCtl);
public static readonly string CoverViewDemoCtl = nameof(CoverViewDemoCtl);
public static readonly string CoverFlowDemoCtl = nameof(CoverFlowDemoCtl);
public static readonly string ProgressButtonDemoCtl = nameof(ProgressButtonDemoCtl);
public static readonly string TransferDemoCtl = nameof(TransferDemoCtl);
public static readonly string ChatBubbleDemoCtl = nameof(ChatBubbleDemoCtl);
public static readonly string GotoTopDemoCtl = nameof(GotoTopDemoCtl);
public static readonly string NotifyIconDemoCtl = nameof(NotifyIconDemoCtl);
public static readonly string BadgeDemoCtl = nameof(BadgeDemoCtl);
public static readonly string GravatarDemoCtl = nameof(GravatarDemoCtl);
public static readonly string DialogDemoCtl = nameof(DialogDemoCtl);
public static readonly string SideMenuDemoCtl = nameof(SideMenuDemoCtl);
public static readonly string GridDemoCtl = nameof(GridDemoCtl);
public static readonly string PoptipDemoCtl = nameof(PoptipDemoCtl);
public static readonly string RangeSliderDemoCtl = nameof(RangeSliderDemoCtl);
public static readonly string ButtonGroupDemoCtl = nameof(ButtonGroupDemoCtl);
public static readonly string CardDemoCtl = nameof(CardDemoCtl);
public static readonly string MagnifierDemoCtl = nameof(MagnifierDemoCtl);
public static readonly string ImageBlockDemoCtl = nameof(ImageBlockDemoCtl);
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 NotificationDemoCtl = nameof(NotificationDemoCtl);
public static readonly string FloatingBlockDemoCtl = nameof(FloatingBlockDemoCtl);
public static readonly string SplitButtonDemoCtl = nameof(SplitButtonDemoCtl);
public static readonly string DividerDemoCtl = nameof(DividerDemoCtl);
public static readonly string TransitioningContentControlDemoCtl = nameof(TransitioningContentControlDemoCtl);
/*-------------------- Tools --------------------*/
public static readonly string HatchBrushGeneratorDemoCtl = nameof(HatchBrushGeneratorDemoCtl);
public static readonly string GeometryAnimationDemoCtl = nameof(GeometryAnimationDemoCtl);
/*-------------------- Styles --------------------*/
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
public static readonly string ExpanderDemoCtl = nameof(ExpanderDemoCtl);
public static readonly string NativeProgressBarDemoCtl = nameof(NativeProgressBarDemoCtl);
public static readonly string TabControlDemoCtl = nameof(TabControlDemoCtl);
public static readonly string CalendarDemoCtl = nameof(CalendarDemoCtl);
public static readonly string NativeDatePickerDemoCtl = nameof(NativeDatePickerDemoCtl);
public static readonly string NativeTextBoxDemoCtl = nameof(NativeTextBoxDemoCtl);
public static readonly string TextBlockDemoCtl = nameof(TextBlockDemoCtl);
public static readonly string NativeComboBoxDemoCtl = nameof(NativeComboBoxDemoCtl);
public static readonly string NativePasswordBoxDemoCtl = nameof(NativePasswordBoxDemoCtl);
public static readonly string NativeTabControlDemoCtl = nameof(NativeTabControlDemoCtl);
public static readonly string DataGridDemoCtl = nameof(DataGridDemoCtl);
public static readonly string CheckBoxDemoCtl = nameof(CheckBoxDemoCtl);
public static readonly string ListBoxDemoCtl = nameof(ListBoxDemoCtl);
public static readonly string MenuDemoCtl = nameof(MenuDemoCtl);
public static readonly string TreeViewDemoCtl = nameof(TreeViewDemoCtl);
public static readonly string BorderDemoCtl = nameof(BorderDemoCtl);
public static readonly string RadioButtonDemoCtl = nameof(RadioButtonDemoCtl);
public static readonly string NativeScrollViewerDemoCtl = nameof(NativeScrollViewerDemoCtl);
public static readonly string BrushDemoCtl = nameof(BrushDemoCtl);
public static readonly string SliderDemoCtl = nameof(SliderDemoCtl);
public static readonly string GroupBoxDemoCtl = nameof(GroupBoxDemoCtl);
public static readonly string ListViewDemoCtl = nameof(ListViewDemoCtl);
public static readonly string RichTextBoxDemoCtl = nameof(RichTextBoxDemoCtl);
public static readonly string ToolBarDemoCtl = nameof(ToolBarDemoCtl);
public static readonly string LabelDemoCtl = nameof(LabelDemoCtl);
/*-------------------- Windows --------------------*/
public static readonly string CommonWindow = nameof(CommonWindow);
@@ -36,11 +224,5 @@
public static readonly string NotifyIconContextDemo = nameof(NotifyIconContextDemo);
public static readonly string QQGroupView = nameof(QQGroupView);
public static readonly string BlurWindow = nameof(BlurWindow);
public static readonly string NoNonClientAreaDragableWindow = nameof(NoNonClientAreaDragableWindow);
}
}
@@ -2,6 +2,106 @@
<#@ import namespace="System.Collections.Generic"#>
<#@ output extension=".cs" #>
<#
var controlList = new List<string>
{
"GrowlDemoCtl",
"LoadingDemoCtl",
"ImageBrowserDemoCtl",
"ColorPickerDemoCtl",
"CarouselDemoCtl",
"CompareSliderDemoCtl",
"TimeBarDemoCtl",
"PaginationDemoCtl",
"AnimationPathDemoCtl",
"StepBarDemoCtl",
"ClockDemoCtl",
"TimePickerDemoCtl",
"CirclePanelDemoCtl",
"NumericUpDownDemoCtl",
"WindowDemoCtl",
"ScrollViewerDemoCtl",
"PreviewSliderDemoCtl",
"ProgressBarDemoCtl",
"TextBoxDemoCtl",
"ComboBoxDemoCtl",
"PasswordBoxDemoCtl",
"DatePickerDemoCtl",
"DateTimePickerDemoCtl",
"CalendarWithClockDemoCtl",
"SearchBarDemoCtl",
"TagDemoCtl",
"GifImageDemoCtl",
"OutlineTextDemoCtl",
"FlipClockDemoCtl",
"QQGroupView",
"BlurWindow",
"NoNonClientAreaDragableWindow",
"RateDemoCtl",
"ShieldDemoCtl",
"WaterfallPanelDemoCtl",
"CoverViewDemoCtl",
"CoverFlowDemoCtl",
"ProgressButtonDemoCtl",
"TransferDemoCtl",
"ChatBubbleDemoCtl",
"GotoTopDemoCtl",
"NotifyIconDemoCtl",
"BadgeDemoCtl",
"GravatarDemoCtl",
"DialogDemoCtl",
"SideMenuDemoCtl",
"GridDemoCtl",
"PoptipDemoCtl",
"RangeSliderDemoCtl",
"ButtonGroupDemoCtl",
"CardDemoCtl",
"MagnifierDemoCtl",
"ImageBlockDemoCtl",
"RunningBlockDemoCtl",
"HoneycombPanelDemoCtl",
"SpriteDemoCtl",
"NotificationDemoCtl",
"FloatingBlockDemoCtl",
"SplitButtonDemoCtl",
"DividerDemoCtl",
"TransitioningContentControlDemoCtl"
};
var styleList = new List<string>
{
"ButtonDemoCtl",
"RepeatButtonDemoCtl",
"ToggleButtonDemoCtl",
"ExpanderDemoCtl",
"NativeProgressBarDemoCtl",
"TabControlDemoCtl",
"CalendarDemoCtl",
"NativeDatePickerDemoCtl",
"NativeTextBoxDemoCtl",
"TextBlockDemoCtl",
"NativeComboBoxDemoCtl",
"NativePasswordBoxDemoCtl",
"NativeTabControlDemoCtl",
"DataGridDemoCtl",
"CheckBoxDemoCtl",
"ListBoxDemoCtl",
"MenuDemoCtl",
"TreeViewDemoCtl",
"BorderDemoCtl",
"RadioButtonDemoCtl",
"NativeScrollViewerDemoCtl",
"BrushDemoCtl",
"SliderDemoCtl",
"GroupBoxDemoCtl",
"ListViewDemoCtl",
"RichTextBoxDemoCtl",
"ToolBarDemoCtl",
"LabelDemoCtl"
};
var toolList = new List<string>
{
"HatchBrushGeneratorDemoCtl",
"GeometryAnimationDemoCtl"
};
var windowList = new List<string>
{
"CommonWindow",
@@ -21,17 +121,32 @@ var messageList = new List<string>
"ProjectsView",
"BlogsView",
"NotifyIconDemo",
"NotifyIconContextDemo",
"QQGroupView",
"BlurWindow",
"NoNonClientAreaDragableWindow"
"NotifyIconContextDemo"
};
#>
namespace HandyControlDemo.Data
{
public class MessageToken
{
/*-------------------- Windows --------------------*/
/*-------------------- Controls --------------------*/
<#foreach(var item in controlList){#>
public static readonly string <#=item#> = nameof(<#=item#>);
<#}#>
/*-------------------- Tools --------------------*/
<#foreach(var item in toolList){#>
public static readonly string <#=item#> = nameof(<#=item#>);
<#}#>
/*-------------------- Styles --------------------*/
<#foreach(var item in styleList){#>
public static readonly string <#=item#> = nameof(<#=item#>);
<#}#>
/*-------------------- Windows --------------------*/
<#foreach(var item in windowList){#>
public static readonly string <#=item#> = nameof(<#=item#>);
@@ -1,13 +1,34 @@
using System.Collections.Generic;
using GalaSoft.MvvmLight;
namespace HandyControlDemo.Data
{
public class DemoInfoModel
public class DemoInfoModel : ViewModelBase
{
public string Title { get; set; }
private string _title;
public int SelectedIndex { get; set; }
public string Title
{
get => _title;
#if netle40
set => Set(nameof(Title), ref _title, value);
#else
set => Set(ref _title, value);
#endif
}
private int _selectedIndex = -1;
public int SelectedIndex
{
get => _selectedIndex;
#if netle40
set => Set(nameof(SelectedIndex), ref _selectedIndex, value);
#else
set => Set(ref _selectedIndex, value);
#endif
}
public IList<DemoItemModel> DemoItemList { get; set; }
}
}
}
@@ -9,7 +9,5 @@
public string ImageName { get; set; }
public bool IsNew { get; set; }
public bool IsSelected { get; set; }
}
}
@@ -0,0 +1,120 @@
[
{
"Header": "Overview",
"IconKey": "/HandyControlDemo;component/Resources/Img/DevOps/DevOps-Overview.png",
"Items": [
{
"Header": "Summary",
"IconKey": "&#xf2cb;"
},
{
"Header": "Dashboards",
"IconKey": "&#xf246;"
},
{
"Header": "Wiki",
"IconKey": "&#xe82d;"
}
]
},
{
"Header": "Boards",
"IconKey": "/HandyControlDemo;component/Resources/Img/DevOps/DevOps-Boards.png",
"Items": [
{
"Header": "Work Items",
"IconKey": "&#xf314;"
},
{
"Header": "Boards",
"IconKey": "&#xf444;"
},
{
"Header": "Backlogs",
"IconKey": "&#xf6bf;"
},
{
"Header": "Sprints",
"IconKey": "&#xf3b0;"
},
{
"Header": "Queries",
"IconKey": "&#xf2b8;"
}
]
},
{
"Header": "Repos",
"IconKey": "/HandyControlDemo;component/Resources/Img/DevOps/DevOps-Repos.png",
"Items": [
{
"Header": "Files",
"IconKey": "&#xf30e;"
},
{
"Header": "Commits",
"IconKey": "&#xf293;"
},
{
"Header": "Pushes",
"IconKey": "&#xf298;"
},
{
"Header": "Branches",
"IconKey": "&#xebc2;"
},
{
"Header": "Tags",
"IconKey": "&#xe8ec;"
},
{
"Header": "Pull requests",
"IconKey": "&#xf296;"
}
]
},
{
"Header": "Pipelines",
"IconKey": "/HandyControlDemo;component/Resources/Img/DevOps/DevOps-Pipelines.png",
"Items": [
{
"Header": "Builds",
"IconKey": "&#xf28f;"
},
{
"Header": "Releases",
"IconKey": "&#xf3b3;"
},
{
"Header": "Library",
"IconKey": "&#xe8f1;"
},
{
"Header": "Task groups",
"IconKey": "&#xf2ae;"
},
{
"Header": "Deployment groups",
"IconKey": "&#xf29d;"
}
]
},
{
"Header": "Test Plans",
"IconKey": "/HandyControlDemo;component/Resources/Img/DevOps/DevOps-TestPlans.png",
"Items": [
{
"Header": "Test Plans",
"IconKey": "&#xf3ab;"
},
{
"Header": "Runs",
"IconKey": "&#xf3ac;"
},
{
"Header": "Load test",
"IconKey": "&#xe8a9;"
}
]
}
]
@@ -18,7 +18,6 @@ namespace HandyControlDemo
{
base.OnInitialized(e);
Messenger.Default.Send<object>(null, MessageToken.ClearLeftSelected);
Messenger.Default.Send(true, MessageToken.FullSwitch);
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.OverView}"), MessageToken.LoadShowContent);
}
@@ -510,6 +510,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 抽屉 的本地化字符串。
/// </summary>
public static string Drawer {
get {
return ResourceManager.GetString("Drawer", resourceCulture);
}
}
/// <summary>
/// 查找类似 邮箱 的本地化字符串。
/// </summary>
@@ -687,4 +687,7 @@
<data name="TransitioningContentControl" xml:space="preserve">
<value>TransitioningContentControl</value>
</data>
<data name="Drawer" xml:space="preserve">
<value>Drawer</value>
</data>
</root>
@@ -687,4 +687,7 @@
<data name="TransitioningContentControl" xml:space="preserve">
<value>TransitioningContentControl</value>
</data>
<data name="Drawer" xml:space="preserve">
<value>Drawer</value>
</data>
</root>
@@ -687,4 +687,7 @@
<data name="TransitioningContentControl" xml:space="preserve">
<value>TransitioningContentControl</value>
</data>
<data name="Drawer" xml:space="preserve">
<value>Drawer</value>
</data>
</root>
@@ -687,4 +687,7 @@
<data name="TransitioningContentControl" xml:space="preserve">
<value>内容过渡控件</value>
</data>
<data name="Drawer" xml:space="preserve">
<value>抽屉</value>
</data>
</root>
@@ -350,7 +350,7 @@ namespace HandyControlDemo.Service
var stream = Application.GetResourceStream(new Uri("Data/DemoInfo.json", UriKind.Relative))?.Stream;
if (stream == null) return infoList;
string jsonStr;
using (var reader = new StreamReader(stream))
{
@@ -378,16 +378,16 @@ namespace HandyControlDemo.Service
foreach (var item in list)
{
var name = Properties.Langs.Lang.ResourceManager.GetString((string) item[0]);
var name = Properties.Langs.Lang.ResourceManager.GetString((string)item[0]);
string targetCtlName = item[1];
string imageName = item[2];
var isNew = !string.IsNullOrEmpty((string) item[3]);
var isNew = !string.IsNullOrEmpty((string)item[3]);
resultList.Add(new DemoItemModel
{
Name = name,
TargetCtlName = targetCtlName,
ImageName = $"../../Resources/Img/LeftMainContent/{imageName}.png",
Name = name,
TargetCtlName = targetCtlName,
ImageName = $"../../Resources/Img/LeftMainContent/{imageName}.png",
IsNew = isNew
});
}
@@ -1,8 +1,74 @@
<UserControl x:Class="HandyControlDemo.UserControl.DrawerDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource RegionBrush}">
<Grid>
</Grid>
</UserControl>
<hc:TransitioningContentControl>
<hc:SimplePanel Margin="22">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ToggleButton Margin="10" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" Content="Left" IsChecked="{Binding IsOpen,ElementName=DrawerLeft}"/>
<ToggleButton Margin="10" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="1" Content="Top" IsChecked="{Binding IsOpen,ElementName=DrawerTop}"/>
<ToggleButton Margin="10" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="2" Content="Right" IsChecked="{Binding IsOpen,ElementName=DrawerRight}"/>
<ToggleButton Margin="10" HorizontalAlignment="Stretch" Grid.Row="2" Grid.Column="1" Content="Bottom" IsChecked="{Binding IsOpen,ElementName=DrawerBottom}"/>
</Grid>
<hc:Drawer Name="DrawerLeft" Dock="Left" ShowMode="Push">
<Border Background="{DynamicResource RegionBrush}" Width="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
<Button CommandTarget="{Binding}" Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
</Grid>
</Border>
</hc:Drawer>
<hc:Drawer Name="DrawerTop" Dock="Top" ShowMode="Press">
<Border Background="{DynamicResource RegionBrush}" Height="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
<Button CommandTarget="{Binding}" Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
</Grid>
</Border>
</hc:Drawer>
<hc:Drawer Name="DrawerRight" MaskCanClose="False">
<Border Background="{DynamicResource RegionBrush}" Width="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
<Button CommandTarget="{Binding}" Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
</Grid>
</Border>
</hc:Drawer>
<hc:Drawer Name="DrawerBottom" Dock="Bottom" ShowMask="False">
<Border Background="{DynamicResource RegionBrush}" Height="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
<Button CommandTarget="{Binding}" Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
</Grid>
</Border>
</hc:Drawer>
</hc:SimplePanel>
</hc:TransitioningContentControl>
</UserControl>
@@ -2,9 +2,7 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using GalaSoft.MvvmLight.Messaging;
using HandyControl.Data;
using HandyControl.Tools;
using HandyControl.Tools.Extension;
using HandyControlDemo.Data;
@@ -19,13 +17,6 @@ namespace HandyControlDemo.UserControl
public LeftMainContent()
{
InitializeComponent();
//Messenger.Default.Register<object>(this, MessageToken.ClearLeftSelected, obj =>
//{
// ListBoxStyle.SelectedItem = null;
// ListBoxControl.SelectedItem = null;
// ListBoxTool.SelectedItem = null;
//});
}
private void TabControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -37,19 +28,6 @@ namespace HandyControlDemo.UserControl
demoInfo.SelectedIndex = -1;
demoInfo.SelectedIndex = selectedIndex;
}
//if (e.OriginalSource is ItemsControl itemsControl)
//{
// if (!(itemsControl.ItemContainerGenerator.ContainerFromItem(e.AddedItems[0]) is ContentControl container)) return;
// var selector = VisualHelper.GetChild<Selector>(container as DependencyObject);
// if (selector.SelectedItem != null)
// {
// var item = selector.SelectedItem;
// selector.SelectedIndex = -1;
// selector.SelectedItem = item;
// }
//}
}
private void ButtonAscending_OnClick(object sender, RoutedEventArgs e)
@@ -79,4 +57,4 @@ namespace HandyControlDemo.UserControl
}
}
}
}
}
@@ -55,6 +55,10 @@ namespace HandyControlDemo.ViewModel
Messenger.Default.Register<object>(this, MessageToken.ClearLeftSelected, obj =>
{
_demoItemCurrent = null;
foreach (var item in DemoInfoList)
{
item.SelectedIndex = -1;
}
});
DataList = dataService.GetDemoDataList();
@@ -43,7 +43,7 @@ namespace HandyControl.Controls
}));
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) =>
{
SetCurrentValue(ValueProperty, 0d);
SetCurrentValue(ValueProperty, ValueBoxes.Double0Box);
_textBox.Text = string.Empty;
}));
@@ -0,0 +1,361 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using HandyControl.Data;
using HandyControl.Interactivity;
using HandyControl.Tools;
namespace HandyControl.Controls
{
[ContentProperty("Content")]
public class Drawer : FrameworkElement
{
private Storyboard _storyboard;
private AdornerContainer _container;
private ContentControl _animationControl;
private TranslateTransform _translateTransform;
private double _animationLength;
private string _animationPropertyName;
private FrameworkElement _maskElement;
private AdornerLayer _layer;
private System.Windows.Window _window;
private UIElement _windowContentElement;
private Point _contentRenderTransformOrigin;
public Drawer()
{
Loaded += Drawer_Loaded;
Unloaded += Drawer_Unloaded;
CommandBindings.Add(new CommandBinding(ControlCommands.Close, (s, e) => SetCurrentValue(IsOpenProperty, ValueBoxes.FalseBox)));
}
private void Drawer_Loaded(object sender, RoutedEventArgs e)
{
if (IsOpen)
{
OnIsOpenChanged(true);
}
}
private void Drawer_Unloaded(object sender, RoutedEventArgs e)
{
Loaded -= Drawer_Loaded;
if (_maskElement != null)
{
_maskElement.PreviewMouseLeftButtonDown -= MaskElement_PreviewMouseLeftButtonDown;
}
if (_storyboard != null)
{
_storyboard.Completed -= Storyboard_Completed;
}
}
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(
"IsOpen", typeof(bool), typeof(Drawer), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsOpenChanged));
private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (Drawer) d;
ctl.OnIsOpenChanged((bool)e.NewValue);
}
public bool IsOpen
{
get => (bool) GetValue(IsOpenProperty);
set => SetValue(IsOpenProperty, value);
}
public static readonly DependencyProperty MaskCanCloseProperty = DependencyProperty.Register(
"MaskCanClose", typeof(bool), typeof(Drawer), new PropertyMetadata(ValueBoxes.TrueBox));
public bool MaskCanClose
{
get => (bool) GetValue(MaskCanCloseProperty);
set => SetValue(MaskCanCloseProperty, value);
}
public static readonly DependencyProperty ShowMaskProperty = DependencyProperty.Register(
"ShowMask", typeof(bool), typeof(Drawer), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowMask
{
get => (bool) GetValue(ShowMaskProperty);
set => SetValue(ShowMaskProperty, value);
}
public static readonly DependencyProperty DockProperty = DependencyProperty.Register(
"Dock", typeof(Dock), typeof(Drawer), new PropertyMetadata(default(Dock)));
public Dock Dock
{
get => (Dock) GetValue(DockProperty);
set => SetValue(DockProperty, value);
}
public static readonly DependencyProperty ShowModeProperty = DependencyProperty.Register(
"ShowMode", typeof(DrawerShowMode), typeof(Drawer), new PropertyMetadata(default(DrawerShowMode)));
public DrawerShowMode ShowMode
{
get => (DrawerShowMode) GetValue(ShowModeProperty);
set => SetValue(ShowModeProperty, value);
}
public static readonly DependencyProperty MaskBrushProperty = DependencyProperty.Register(
"MaskBrush", typeof(Brush), typeof(Drawer), new PropertyMetadata(default(Brush)));
public Brush MaskBrush
{
get => (Brush) GetValue(MaskBrushProperty);
set => SetValue(MaskBrushProperty, value);
}
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
"Content", typeof(object), typeof(Drawer), new PropertyMetadata(default(object)));
public object Content
{
get => GetValue(ContentProperty);
set => SetValue(ContentProperty, value);
}
private void CreateContainer()
{
_storyboard = new Storyboard();
_storyboard.Completed += Storyboard_Completed;
_translateTransform = new TranslateTransform();
_animationControl = new ContentControl
{
Content = Content,
RenderTransform = _translateTransform,
DataContext = this
};
var panel = new SimplePanel
{
ClipToBounds = true
};
if (ShowMask)
{
_maskElement = new Border
{
Background = MaskBrush,
Opacity = 0
};
_maskElement.PreviewMouseLeftButtonDown += MaskElement_PreviewMouseLeftButtonDown;
panel.Children.Add(_maskElement);
}
_animationControl.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
var size = _animationControl.DesiredSize;
switch (Dock)
{
case Dock.Left:
_animationControl.HorizontalAlignment = HorizontalAlignment.Left;
_animationControl.VerticalAlignment = VerticalAlignment.Stretch;
_translateTransform.X = -size.Width;
_animationLength = -size.Width;
_animationPropertyName = "(UIElement.RenderTransform).(TranslateTransform.X)";
break;
case Dock.Top:
_animationControl.HorizontalAlignment = HorizontalAlignment.Stretch;
_animationControl.VerticalAlignment = VerticalAlignment.Top;
_translateTransform.Y = -size.Height;
_animationLength = -size.Height;
_animationPropertyName = "(UIElement.RenderTransform).(TranslateTransform.Y)";
break;
case Dock.Right:
_animationControl.HorizontalAlignment = HorizontalAlignment.Right;
_animationControl.VerticalAlignment = VerticalAlignment.Stretch;
_translateTransform.X = size.Width;
_animationLength = size.Width;
_animationPropertyName = "(UIElement.RenderTransform).(TranslateTransform.X)";
break;
case Dock.Bottom:
_animationControl.HorizontalAlignment = HorizontalAlignment.Stretch;
_animationControl.VerticalAlignment = VerticalAlignment.Bottom;
_translateTransform.Y = size.Height;
_animationLength = size.Height;
_animationPropertyName = "(UIElement.RenderTransform).(TranslateTransform.Y)";
break;
default:
throw new ArgumentOutOfRangeException();
}
panel.Children.Add(_animationControl);
_container = new AdornerContainer(_layer)
{
Child = panel,
ClipToBounds = true
};
}
private void Storyboard_Completed(object sender, EventArgs e)
{
if (!IsOpen)
{
_windowContentElement.SetCurrentValue(RenderTransformOriginProperty, _contentRenderTransformOrigin);
_layer.Remove(_container);
}
}
private void OnIsOpenChanged(bool isOpen)
{
if (Content == null) return;
_window = WindowHelper.GetActiveWindow();
if (_window == null) return;
_windowContentElement = _window.Content as UIElement;
if (_windowContentElement == null) return;
_contentRenderTransformOrigin = _windowContentElement.RenderTransformOrigin;
var decorator = VisualHelper.GetChild<AdornerDecorator>(_window);
_layer = decorator?.AdornerLayer;
if (_layer == null) return;
if (_container == null)
{
CreateContainer();
}
switch (ShowMode)
{
case DrawerShowMode.Push:
ShowByPush(isOpen);
break;
case DrawerShowMode.Press:
_windowContentElement.SetCurrentValue(RenderTransformOriginProperty, new Point(0.5, 0.5));
ShowByPress(isOpen);
break;
}
if (isOpen)
{
if (_maskElement != null)
{
var maskAnimation = AnimationHelper.CreateAnimation(1);
Storyboard.SetTarget(maskAnimation, _maskElement);
Storyboard.SetTargetProperty(maskAnimation, new PropertyPath(OpacityProperty.Name));
_storyboard.Children.Add(maskAnimation);
}
var drawerAnimation = AnimationHelper.CreateAnimation(0);
Storyboard.SetTarget(drawerAnimation, _animationControl);
Storyboard.SetTargetProperty(drawerAnimation, new PropertyPath(_animationPropertyName));
_storyboard.Children.Add(drawerAnimation);
_layer.Remove(_container);
_layer.Add(_container);
}
else
{
if (_maskElement != null)
{
var maskAnimation = AnimationHelper.CreateAnimation(0);
Storyboard.SetTarget(maskAnimation, _maskElement);
Storyboard.SetTargetProperty(maskAnimation, new PropertyPath(OpacityProperty.Name));
_storyboard.Children.Add(maskAnimation);
}
var drawerAnimation = AnimationHelper.CreateAnimation(_animationLength);
Storyboard.SetTarget(drawerAnimation, _animationControl);
Storyboard.SetTargetProperty(drawerAnimation, new PropertyPath(_animationPropertyName));
_storyboard.Children.Add(drawerAnimation);
}
_storyboard.Begin();
}
private void ShowByPush(bool isOpen)
{
string animationPropertyName;
switch (Dock)
{
case Dock.Left:
case Dock.Right:
animationPropertyName = "(UIElement.RenderTransform).(TranslateTransform.X)";
_windowContentElement.RenderTransform = new TranslateTransform
{
X = isOpen ? 0 : -_animationLength
};
break;
case Dock.Top:
case Dock.Bottom:
animationPropertyName = "(UIElement.RenderTransform).(TranslateTransform.Y)";
_windowContentElement.RenderTransform = new TranslateTransform
{
Y = isOpen ? 0 : -_animationLength
};
break;
default:
throw new ArgumentOutOfRangeException();
}
var animation = isOpen
? AnimationHelper.CreateAnimation(-_animationLength)
: AnimationHelper.CreateAnimation(0);
Storyboard.SetTarget(animation, _windowContentElement);
Storyboard.SetTargetProperty(animation, new PropertyPath(animationPropertyName));
_storyboard.Children.Add(animation);
}
private void ShowByPress(bool isOpen)
{
_windowContentElement.RenderTransform = isOpen
? new ScaleTransform()
: new ScaleTransform
{
ScaleX = 0.9,
ScaleY = 0.9
};
var animationX = isOpen
? AnimationHelper.CreateAnimation(.9)
: AnimationHelper.CreateAnimation(1);
Storyboard.SetTarget(animationX, _windowContentElement);
Storyboard.SetTargetProperty(animationX, new PropertyPath("(UIElement.RenderTransform).(ScaleTransform.ScaleX)"));
_storyboard.Children.Add(animationX);
var animationY = isOpen
? AnimationHelper.CreateAnimation(.9)
: AnimationHelper.CreateAnimation(1);
Storyboard.SetTarget(animationY, _windowContentElement);
Storyboard.SetTargetProperty(animationY, new PropertyPath("(UIElement.RenderTransform).(ScaleTransform.ScaleY)"));
_storyboard.Children.Add(animationY);
}
private void MaskElement_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (MaskCanClose)
{
SetCurrentValue(IsOpenProperty, ValueBoxes.FalseBox);
}
}
}
}
@@ -368,7 +368,7 @@ namespace HandyControl.Controls
HeaderPanel.ForceUpdate = true;
HeaderPanel.Measure(new Size(HeaderPanel.DesiredSize.Width, ActualHeight));
HeaderPanel.ForceUpdate = false;
SetCurrentValue(SelectedIndexProperty, 0);
SetCurrentValue(SelectedIndexProperty, ValueBoxes.Int0Box);
}
item.IsSelected = true;
@@ -0,0 +1,9 @@
namespace HandyControl.Data
{
public enum DrawerShowMode
{
Cover,
Push,
Press
}
}
@@ -91,7 +91,7 @@ namespace HandyControl.Expression.Drawing
{
for (var i = list.Count; i < count; i++)
{
list.Add((factory == null) ? default : factory());
list.Add((factory == null) ? default(T) : factory());
}
}
return true;
@@ -26,6 +26,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\Growl\GrowlWindow.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Image\ImageBlock.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Divider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Drawer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Magnifier.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ButtonGroup.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Card.cs" />
@@ -38,6 +39,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeThumb.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\TwoWayRangeBase.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Block\RunningBlock.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\DrawerShowMode.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\HatchStyle.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\HitMode.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\ShowAnimation.cs" />
@@ -386,6 +388,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Drawer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\DrawerBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Poptip.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -1,4 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Border.xaml" />
@@ -0,0 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
<Style x:Key="DrawerBaseStyle" TargetType="controls:Drawer">
<Setter Property="Dock" Value="Right"/>
<Setter Property="MaskBrush" Value="{DynamicResource DarkOpacityBrush}"/>
</Style>
</ResourceDictionary>
@@ -0,0 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Base/DrawerBaseStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource DrawerBaseStyle}" TargetType="controls:Drawer"/>
</ResourceDictionary>
@@ -77,6 +77,7 @@
<ResourceDictionary Source="SplitButton.xaml"/>
<ResourceDictionary Source="Divider.xaml"/>
<ResourceDictionary Source="Poptip.xaml"/>
<ResourceDictionary Source="Drawer.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
@@ -13,7 +13,7 @@ namespace HandyControl.Tools.Extension
}
catch
{
return default;
return default(T);
}
}
@@ -47,7 +47,7 @@ namespace HandyControl.Tools
return resource;
}
return default;
return default(T);
}
/// <summary>
@@ -21,7 +21,7 @@ namespace HandyControl.Tools
{
var typeStr = typeof(T).FullName;
if (string.IsNullOrEmpty(typeStr)) return default;
if (string.IsNullOrEmpty(typeStr)) return default(T);
var temp = new T();
if (!OpenDic.Keys.Contains(typeStr))
@@ -36,7 +36,7 @@ namespace HandyControl.Tools
OpenDic[typeStr] = temp;
return temp;
}
return default;
return default(T);
}
}
}