simplify new expression
This commit is contained in:
1 parent
42b2cb3033
commit
193090da43
59 files changed
+149
-149
No files matched your search
@@ -26,8 +26,8 @@ namespace HandyControlDemo
|
||||
|
||||
GlobalShortcut.Init(new List<KeyBinding>
|
||||
{
|
||||
new KeyBinding(ViewModelLocator.Instance.Main.GlobalShortcutInfoCmd, Key.I, ModifierKeys.Control | ModifierKeys.Alt),
|
||||
new KeyBinding(ViewModelLocator.Instance.Main.GlobalShortcutWarningCmd, Key.E, ModifierKeys.Control | ModifierKeys.Alt)
|
||||
new(ViewModelLocator.Instance.Main.GlobalShortcutInfoCmd, Key.I, ModifierKeys.Control | ModifierKeys.Alt),
|
||||
new(ViewModelLocator.Instance.Main.GlobalShortcutWarningCmd, Key.E, ModifierKeys.Control | ModifierKeys.Alt)
|
||||
});
|
||||
|
||||
Dialog.SetToken(this, MessageToken.MainWindow);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace HandyControlDemo.Service
|
||||
{
|
||||
internal ObservableCollection<TabControlDemoModel> GetTabControlDemoDataList()
|
||||
{
|
||||
return new ObservableCollection<TabControlDemoModel>
|
||||
return new()
|
||||
{
|
||||
new TabControlDemoModel
|
||||
{
|
||||
@@ -139,7 +139,7 @@ namespace HandyControlDemo.Service
|
||||
|
||||
internal List<AvatarModel> GetBlogDataList()
|
||||
{
|
||||
return new List<AvatarModel>
|
||||
return new()
|
||||
{
|
||||
new AvatarModel
|
||||
{
|
||||
@@ -170,7 +170,7 @@ namespace HandyControlDemo.Service
|
||||
|
||||
internal List<AvatarModel> GetProjectDataList()
|
||||
{
|
||||
return new List<AvatarModel>
|
||||
return new()
|
||||
{
|
||||
new AvatarModel
|
||||
{
|
||||
@@ -195,7 +195,7 @@ namespace HandyControlDemo.Service
|
||||
|
||||
internal List<AvatarModel> GetWebsiteDataList()
|
||||
{
|
||||
return new List<AvatarModel>
|
||||
return new()
|
||||
{
|
||||
new AvatarModel
|
||||
{
|
||||
@@ -208,7 +208,7 @@ namespace HandyControlDemo.Service
|
||||
|
||||
internal ObservableCollection<CardModel> GetCardDataList()
|
||||
{
|
||||
return new ObservableCollection<CardModel>
|
||||
return new()
|
||||
{
|
||||
new CardModel
|
||||
{
|
||||
@@ -275,7 +275,7 @@ namespace HandyControlDemo.Service
|
||||
|
||||
internal CardModel GetCardData()
|
||||
{
|
||||
return new CardModel
|
||||
return new()
|
||||
{
|
||||
Content = $"/HandyControlDemo;component/Resources/Img/Album/{DateTime.Now.Second % 10 + 1}.jpg"
|
||||
};
|
||||
@@ -283,7 +283,7 @@ namespace HandyControlDemo.Service
|
||||
|
||||
internal List<StepBarDemoModel> GetStepBarDemoDataList()
|
||||
{
|
||||
return new List<StepBarDemoModel>
|
||||
return new()
|
||||
{
|
||||
new StepBarDemoModel
|
||||
{
|
||||
@@ -310,7 +310,7 @@ namespace HandyControlDemo.Service
|
||||
|
||||
internal ObservableCollection<CoverViewDemoModel> GetCoverViewDemoDataList()
|
||||
{
|
||||
return new ObservableCollection<CoverViewDemoModel>
|
||||
return new()
|
||||
{
|
||||
new CoverViewDemoModel
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace HandyControlDemo.Tools
|
||||
{
|
||||
private static readonly string NameSpaceStr = typeof(AssemblyHelper).Assembly.GetName().Name;
|
||||
|
||||
private static readonly Dictionary<string, object> CacheDic = new Dictionary<string, object>();
|
||||
private static readonly Dictionary<string, object> CacheDic = new();
|
||||
|
||||
public static void Register(string name, object instance) => CacheDic[name] = instance;
|
||||
|
||||
|
||||
@@ -67,17 +67,17 @@ namespace HandyControlDemo.UserControl
|
||||
var textEditorCustomStyle = ResourceHelper.GetResource<Style>("TextEditorCustom");
|
||||
_textEditor = new Dictionary<string, TextEditor>
|
||||
{
|
||||
["XAML"] = new TextEditor
|
||||
["XAML"] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("XML")
|
||||
},
|
||||
["C#"] = new TextEditor
|
||||
["C#"] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("C#")
|
||||
},
|
||||
["VM"] = new TextEditor
|
||||
["VM"] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("C#")
|
||||
|
||||
@@ -10,13 +10,13 @@ namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class GeometryDemoCtl
|
||||
{
|
||||
private readonly HashSet<string> _lineSet = new HashSet<string>
|
||||
private readonly HashSet<string> _lineSet = new()
|
||||
{
|
||||
"CheckedGeometry"
|
||||
};
|
||||
|
||||
public ObservableCollection<GeometryItemModel> GeometryItems { get; set; } =
|
||||
new ObservableCollection<GeometryItemModel>();
|
||||
new();
|
||||
|
||||
public GeometryDemoCtl()
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace HandyControlDemo.ViewModel
|
||||
#endif
|
||||
}
|
||||
|
||||
public ObservableCollection<ChatInfoModel> ChatInfos { get; set; } = new ObservableCollection<ChatInfoModel>();
|
||||
public ObservableCollection<ChatInfoModel> ChatInfos { get; set; } = new();
|
||||
|
||||
public RelayCommand<KeyEventArgs> SendStringCmd => new Lazy<RelayCommand<KeyEventArgs>>(() =>
|
||||
new RelayCommand<KeyEventArgs>(SendString)).Value;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public WindowDemoViewModel WindowDemo => SimpleIoc.Default.GetInstance<WindowDemoViewModel>();
|
||||
|
||||
public ItemsDisplayViewModel ContributorsView => new ItemsDisplayViewModel(SimpleIoc.Default.GetInstance<DataService>().GetContributorDataList);
|
||||
public ItemsDisplayViewModel ContributorsView => new(SimpleIoc.Default.GetInstance<DataService>().GetContributorDataList);
|
||||
|
||||
public ItemsDisplayViewModel BlogsView => SimpleIoc.Default.GetInstance<ItemsDisplayViewModel>("Blogs");
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public PaginationDemoViewModel PaginationDemo => SimpleIoc.Default.GetInstance<PaginationDemoViewModel>();
|
||||
|
||||
public ChatBoxViewModel ChatBox => new ChatBoxViewModel();
|
||||
public ChatBoxViewModel ChatBox => new();
|
||||
|
||||
public CoverViewModel CoverView => SimpleIoc.Default.GetInstance<CoverViewModel>();
|
||||
|
||||
@@ -86,11 +86,11 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public SideMenuDemoViewModel SideMenuDemo => SimpleIoc.Default.GetInstance<SideMenuDemoViewModel>();
|
||||
|
||||
public TabControlDemoViewModel TabControlDemo => new TabControlDemoViewModel(SimpleIoc.Default.GetInstance<DataService>());
|
||||
public TabControlDemoViewModel TabControlDemo => new(SimpleIoc.Default.GetInstance<DataService>());
|
||||
|
||||
public NonClientAreaViewModel NoUser => SimpleIoc.Default.GetInstance<NonClientAreaViewModel>();
|
||||
|
||||
public CardDemoViewModel CardDemo => new CardDemoViewModel(SimpleIoc.Default.GetInstance<DataService>());
|
||||
public CardDemoViewModel CardDemo => new(SimpleIoc.Default.GetInstance<DataService>());
|
||||
|
||||
public SpriteDemoViewModel SpriteDemo => SimpleIoc.Default.GetInstance<SpriteDemoViewModel>();
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public SplitButtonDemoViewModel SplitButtonDemo => SimpleIoc.Default.GetInstance<SplitButtonDemoViewModel>();
|
||||
|
||||
public TagDemoViewModel TagDemo => new TagDemoViewModel(SimpleIoc.Default.GetInstance<DataService>());
|
||||
public TagDemoViewModel TagDemo => new(SimpleIoc.Default.GetInstance<DataService>());
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user