add Watermark

This commit is contained in:
NaBian committed 2020-04-30 01:22:27 +08:00
1 parent 507a80a3ee
commit 2ced600571
42 files changed
+357 -269

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@
</ResourceDictionary.MergedDictionaries>
<langs:LangProvider x:Key="DemoLangs"/>
<viewModel:ViewModelLocator x:Key="Locator" d:IsDataSource="True"/>
<hc:EnumDataProvider x:Key="DemoTypes" Type="data:DemoType" MethodName=""/>
<hc:EnumDataProvider x:Key="DemoTypes" Type="data:DemoType"/>
<hc:EnumDataProvider x:Key="ShowAnimations" Type="hc:ShowAnimation"/>
<hc:EnumDataProvider x:Key="HatchStyles" Type="hc:HatchStyle"/>
</ResourceDictionary>
@@ -92,8 +92,7 @@ namespace HandyControlDemo
skins0.MergedDictionaries.Clear();
skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(skin));
skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(typeof(App).Assembly, "Resources/Themes", skin));
var skins1 = Resources.MergedDictionaries[1];
skins1.MergedDictionaries.Clear();
skins1.MergedDictionaries.Add(new ResourceDictionary
@@ -1,3 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Langs"/>
</assemblyBinding>
</runtime>
</configuration>
@@ -8,121 +8,19 @@
<DrawingBrush o:Freeze="True" Opacity=".1" x:Key="CloudDrawingBrush" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" RenderOptions.CachingHint="Cache" Viewport="0,0,314,157" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup o:Freeze="True">
<ImageDrawing ImageSource="/HandyControlDemo;component/Resources/Img/cloud.png" Rect="0,0,314,157"/>
</DrawingGroup>
<ImageDrawing o:Freeze="True" ImageSource="/HandyControlDemo;component/Resources/Img/cloud.png" Rect="0,0,314,157"/>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush o:Freeze="True" x:Key="MainContentForegroundDrawingBrush" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" RenderOptions.CachingHint="Cache" Viewport="0,0,16,16" ViewportUnits="Absolute" Stretch="None" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup o:Freeze="True">
<GeometryDrawing o:Freeze="True" Brush="{DynamicResource MainContentForegroundBrush}">
<GeometryDrawing.Geometry>
<GeometryGroup o:Freeze="True">
<RectangleGeometry o:Freeze="True" Rect="0,0,8,8" />
<RectangleGeometry o:Freeze="True" Rect="8,8,8,8" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush o:Freeze="True" x:Key="GitHubDrawingBrush" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" RenderOptions.CachingHint="Cache" Viewport="0,0,200,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Transform>
<TransformGroup o:Freeze="True">
<RotateTransform o:Freeze="True" Angle="20"/>
</TransformGroup>
</DrawingBrush.Transform>
<DrawingBrush.Drawing>
<DrawingGroup o:Freeze="True">
<GeometryDrawing o:Freeze="True" Brush="{DynamicResource DarkMaskBrush}" Geometry="{StaticResource GitHubStrGeometry}"/>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush o:Freeze="True" x:Key="QqDrawingBrush" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" RenderOptions.CachingHint="Cache" Viewport="0,0,100,200" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Transform>
<TransformGroup o:Freeze="True">
<RotateTransform o:Freeze="True" Angle="20"/>
</TransformGroup>
</DrawingBrush.Transform>
<DrawingBrush.Drawing>
<DrawingGroup o:Freeze="True">
<GeometryDrawing o:Freeze="True" Brush="{DynamicResource DarkMaskBrush}" Geometry="{StaticResource QqGeometry}"/>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush o:Freeze="True" x:Key="BlogDrawingBrush" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" RenderOptions.CachingHint="Cache" Viewport="0,0,160,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Transform>
<TransformGroup o:Freeze="True">
<RotateTransform o:Freeze="True" Angle="20"/>
</TransformGroup>
</DrawingBrush.Transform>
<DrawingBrush.Drawing>
<GeometryDrawing o:Freeze="True">
<GeometryDrawing o:Freeze="True" Brush="{DynamicResource MainContentForegroundBrush}">
<GeometryDrawing.Geometry>
<RectangleGeometry o:Freeze="True" Rect="0,0,160,100"></RectangleGeometry>
<GeometryGroup o:Freeze="True">
<RectangleGeometry o:Freeze="True" Rect="0,0,8,8" />
<RectangleGeometry o:Freeze="True" Rect="8,8,8,8" />
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<VisualBrush o:Freeze="True" RenderOptions.CachingHint="Cache" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" >
<VisualBrush.Visual>
<StackPanel>
<TextBlock Text="Blog" Foreground="{DynamicResource DarkMaskBrush}"/>
</StackPanel>
</VisualBrush.Visual>
</VisualBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush o:Freeze="True" x:Key="WebsiteDrawingBrush" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" RenderOptions.CachingHint="Cache" Viewport="0,0,320,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Transform>
<TransformGroup o:Freeze="True">
<RotateTransform o:Freeze="True" Angle="20"/>
</TransformGroup>
</DrawingBrush.Transform>
<DrawingBrush.Drawing>
<GeometryDrawing o:Freeze="True">
<GeometryDrawing.Geometry>
<RectangleGeometry o:Freeze="True" Rect="0,0,320,100"></RectangleGeometry>
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<VisualBrush o:Freeze="True" RenderOptions.CachingHint="Cache" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0">
<VisualBrush.Visual>
<StackPanel>
<TextBlock Text="Website" Foreground="{DynamicResource DarkMaskBrush}"/>
</StackPanel>
</VisualBrush.Visual>
</VisualBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush o:Freeze="True" x:Key="ProjectDrawingBrush" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" RenderOptions.CachingHint="Cache" Viewport="0,0,240,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Transform>
<TransformGroup o:Freeze="True">
<RotateTransform o:Freeze="True" Angle="20"/>
</TransformGroup>
</DrawingBrush.Transform>
<DrawingBrush.Drawing>
<GeometryDrawing o:Freeze="True">
<GeometryDrawing.Geometry>
<RectangleGeometry o:Freeze="True" Rect="0,0,240,100"></RectangleGeometry>
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<VisualBrush o:Freeze="True" RenderOptions.CachingHint="Cache" RenderOptions.CacheInvalidationThresholdMinimum="0.5" RenderOptions.CacheInvalidationThresholdMaximum="2.0" >
<VisualBrush.Visual>
<StackPanel>
<TextBlock Text="Project" Foreground="{DynamicResource DarkMaskBrush}"/>
</StackPanel>
</VisualBrush.Visual>
</VisualBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
@@ -16,7 +16,7 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="{Binding Source,RelativeSource={RelativeSource AncestorType=UserControl}}" Height="120" Width="120" Stretch="Uniform" Margin="10"/>
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,0,10" Grid.Row="1" Style="{StaticResource TextBlockDefault}" Text="{Binding DisplayName,RelativeSource={RelativeSource AncestorType=UserControl}}"></TextBlock>
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,0,10" Grid.Row="1" Style="{StaticResource TextBlockDefault}" Text="{Binding DisplayName,RelativeSource={RelativeSource AncestorType=UserControl}}"/>
</Grid>
</Border>
</Button>
@@ -2,13 +2,16 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
xmlns:hc="https://handyorg.github.io/handycontrol"
DataContext="{Binding BlogsView,Source={StaticResource Locator}}"
Background="{DynamicResource SecondaryRegionBrush}">
<ListBox Background="{DynamicResource BlogDrawingBrush}" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<hc:Watermark Mark="Blog" FontSize="80" MarkMargin="30,0">
<ListBox Background="Transparent" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</hc:Watermark>
</UserControl>
@@ -2,13 +2,16 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
xmlns:hc="https://handyorg.github.io/handycontrol"
DataContext="{Binding ContributorsView,Source={StaticResource Locator}}"
Background="{DynamicResource SecondaryRegionBrush}">
<ListBox Background="{DynamicResource GitHubDrawingBrush}" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<hc:Watermark Mark="{StaticResource GitHubStrGeometry}" MarkMargin="30,0" MarkWidth="200" MarkHeight="100">
<ListBox Background="Transparent" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</hc:Watermark>
</UserControl>
@@ -19,15 +19,15 @@ namespace HandyControlDemo.UserControl
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is Button button && button.Tag is string tag)
if (e.OriginalSource is Button button && button.Tag is string langName)
{
PopupConfig.IsOpen = false;
if (tag.Equals(GlobalData.Config.Lang)) return;
ConfigHelper.Instance.SetLang(tag);
LangProvider.Culture = new CultureInfo(tag);
if (langName.Equals(GlobalData.Config.Lang)) return;
ConfigHelper.Instance.SetLang(langName);
LangProvider.Culture = new CultureInfo(langName);
Messenger.Default.Send<object>(null, "LangUpdated");
GlobalData.Config.Lang = tag;
GlobalData.Config.Lang = langName;
GlobalData.Save();
}
}
@@ -2,13 +2,16 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
xmlns:hc="https://handyorg.github.io/handycontrol"
DataContext="{Binding ProjectsView,Source={StaticResource Locator}}"
Background="{DynamicResource SecondaryRegionBrush}">
<ListBox Background="{DynamicResource ProjectDrawingBrush}" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<hc:Watermark Mark="Project" FontSize="80" MarkMargin="30,0">
<ListBox Background="Transparent" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</hc:Watermark>
</UserControl>
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource SecondaryRegionBrush}">
<Border Background="{DynamicResource QqDrawingBrush}">
<hc:Watermark Mark="{StaticResource QqGeometry}" MarkWidth="200" MarkHeight="200" MarkMargin="30">
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}">
<Border Margin="16" Height="274" Effect="{StaticResource EffectShadow5}" Width="200" CornerRadius="10">
<Border.Background>
@@ -16,5 +16,5 @@
</Border.Background>
</Border>
</WrapPanel>
</Border>
</hc:Watermark>
</UserControl>
@@ -2,13 +2,16 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
xmlns:hc="https://handyorg.github.io/handycontrol"
DataContext="{Binding WebsitesView,Source={StaticResource Locator}}"
Background="{DynamicResource SecondaryRegionBrush}">
<ListBox Background="{DynamicResource WebsiteDrawingBrush}" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<hc:Watermark Mark="Website" FontSize="80" MarkMargin="30,0">
<ListBox Background="Transparent" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</hc:Watermark>
</UserControl>
@@ -7,11 +7,7 @@ using System.Windows;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using GalaSoft.MvvmLight;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
#endif
using GalaSoft.MvvmLight.Messaging;
using HandyControl.Controls;
using HandyControl.Data;
@@ -1,10 +1,6 @@
using System;
using GalaSoft.MvvmLight;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
#endif
using HandyControl.Tools.Extension;
namespace HandyControlDemo.ViewModel
@@ -1,10 +1,6 @@
using System;
using GalaSoft.MvvmLight;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
#endif
namespace HandyControlDemo.ViewModel
{
@@ -1,9 +1,5 @@
using System;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
#endif
using HandyControlDemo.Data;
using HandyControlDemo.Service;
@@ -1,11 +1,9 @@
using System;
using System.Windows;
using GalaSoft.MvvmLight;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
#if !netle40
using System.Threading.Tasks;
using GalaSoft.MvvmLight.CommandWpf;
#endif
using HandyControl.Controls;
using HandyControl.Tools.Extension;
@@ -1,10 +1,6 @@
using System;
using System.Windows;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
using HandyControl.Controls;
using HandyControl.Data;
using HandyControlDemo.Window;
@@ -1,9 +1,5 @@
using System;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
using HandyControl.Controls;
namespace HandyControlDemo.ViewModel
@@ -1,8 +1,4 @@
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
using GalaSoft.MvvmLight.Command;
using System;
using GalaSoft.MvvmLight;
using HandyControl.Controls;
@@ -1,10 +1,6 @@
using System;
using GalaSoft.MvvmLight;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
using HandyControl.Controls;
using HandyControl.Data;
using HandyControlDemo.Data;
@@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
using HandyControl.Data;
using HandyControlDemo.Data;
using HandyControlDemo.Service;
@@ -1,10 +1,6 @@
using System;
using GalaSoft.MvvmLight;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
using HandyControl.Controls;
namespace HandyControlDemo.ViewModel
@@ -2,11 +2,7 @@
using GalaSoft.MvvmLight;
using HandyControl.Controls;
using HandyControl.Data;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
namespace HandyControlDemo.ViewModel
{
@@ -1,11 +1,7 @@
using System;
using GalaSoft.MvvmLight;
using HandyControl.Controls;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
namespace HandyControlDemo.ViewModel
{
@@ -1,11 +1,7 @@
using System;
using HandyControl.Controls;
using HandyControlDemo.UserControl;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
namespace HandyControlDemo.ViewModel
{
@@ -1,11 +1,7 @@
using System;
using System.Linq;
using System.Windows.Controls;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
using HandyControl.Controls;
using HandyControlDemo.Data;
using HandyControlDemo.Service;
@@ -4,11 +4,7 @@ using HandyControl.Controls;
using HandyControl.Data;
using HandyControlDemo.Data;
using HandyControlDemo.Service;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
#endif
namespace HandyControlDemo.ViewModel
{
@@ -1,10 +1,6 @@
using System;
using System.Windows;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
# endif
using HandyControlDemo.Tools;
namespace HandyControlDemo.ViewModel
@@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Windows.Controls;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
#endif
using GalaSoft.MvvmLight.Messaging;
using HandyControl.Controls;
using HandyControlDemo.Data;
@@ -1,10 +1,6 @@
using System;
using GalaSoft.MvvmLight;
#if netle40
using GalaSoft.MvvmLight.Command;
#else
using GalaSoft.MvvmLight.CommandWpf;
#endif
using GalaSoft.MvvmLight.Messaging;
using HandyControlDemo.Data;
using HandyControlDemo.Tools;
@@ -1,6 +1,5 @@
using System;
using System.Windows;
using CommonServiceLocator;
using GalaSoft.MvvmLight.Ioc;
using HandyControlDemo.Data;
using HandyControlDemo.Service;
@@ -11,10 +10,8 @@ namespace HandyControlDemo.ViewModel
{
public ViewModelLocator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
SimpleIoc.Default.Register<DataService>();
var dataService = ServiceLocator.Current.GetInstance<DataService>();
var dataService = SimpleIoc.Default.GetInstance<DataService>();
SimpleIoc.Default.Register<MainViewModel>();
SimpleIoc.Default.Register(() => new GrowlDemoViewModel(), "GrowlDemo");
@@ -49,57 +46,57 @@ namespace HandyControlDemo.ViewModel
#region Vm
public MainViewModel Main => ServiceLocator.Current.GetInstance<MainViewModel>();
public MainViewModel Main => SimpleIoc.Default.GetInstance<MainViewModel>();
public GrowlDemoViewModel GrowlDemo => ServiceLocator.Current.GetInstance<GrowlDemoViewModel>("GrowlDemo");
public GrowlDemoViewModel GrowlDemo => SimpleIoc.Default.GetInstance<GrowlDemoViewModel>("GrowlDemo");
public GrowlDemoViewModel GrowlDemoWithToken => ServiceLocator.Current.GetInstance<GrowlDemoViewModel>("GrowlDemoWithToken");
public GrowlDemoViewModel GrowlDemoWithToken => SimpleIoc.Default.GetInstance<GrowlDemoViewModel>("GrowlDemoWithToken");
public ImageBrowserDemoViewModel ImageBrowserDemo => ServiceLocator.Current.GetInstance<ImageBrowserDemoViewModel>();
public ImageBrowserDemoViewModel ImageBrowserDemo => SimpleIoc.Default.GetInstance<ImageBrowserDemoViewModel>();
public ComboBoxDemoViewModel ComboBoxDemo => ServiceLocator.Current.GetInstance<ComboBoxDemoViewModel>();
public ComboBoxDemoViewModel ComboBoxDemo => SimpleIoc.Default.GetInstance<ComboBoxDemoViewModel>();
public WindowDemoViewModel WindowDemo => ServiceLocator.Current.GetInstance<WindowDemoViewModel>();
public WindowDemoViewModel WindowDemo => SimpleIoc.Default.GetInstance<WindowDemoViewModel>();
public ItemsDisplayViewModel ContributorsView => ServiceLocator.Current.GetInstance<ItemsDisplayViewModel>("Contributors");
public ItemsDisplayViewModel ContributorsView => SimpleIoc.Default.GetInstance<ItemsDisplayViewModel>("Contributors");
public ItemsDisplayViewModel BlogsView => ServiceLocator.Current.GetInstance<ItemsDisplayViewModel>("Blogs");
public ItemsDisplayViewModel BlogsView => SimpleIoc.Default.GetInstance<ItemsDisplayViewModel>("Blogs");
public ItemsDisplayViewModel ProjectsView => ServiceLocator.Current.GetInstance<ItemsDisplayViewModel>("Projects");
public ItemsDisplayViewModel ProjectsView => SimpleIoc.Default.GetInstance<ItemsDisplayViewModel>("Projects");
public ItemsDisplayViewModel WebsitesView => ServiceLocator.Current.GetInstance<ItemsDisplayViewModel>("Websites");
public ItemsDisplayViewModel WebsitesView => SimpleIoc.Default.GetInstance<ItemsDisplayViewModel>("Websites");
public StepBarDemoViewModel StepBarDemo => ServiceLocator.Current.GetInstance<StepBarDemoViewModel>();
public StepBarDemoViewModel StepBarDemo => SimpleIoc.Default.GetInstance<StepBarDemoViewModel>();
public PaginationDemoViewModel PaginationDemo => ServiceLocator.Current.GetInstance<PaginationDemoViewModel>();
public PaginationDemoViewModel PaginationDemo => SimpleIoc.Default.GetInstance<PaginationDemoViewModel>();
public ChatBoxViewModel ChatBox => new ChatBoxViewModel();
public CoverViewModel CoverView => ServiceLocator.Current.GetInstance<CoverViewModel>();
public CoverViewModel CoverView => SimpleIoc.Default.GetInstance<CoverViewModel>();
public DialogDemoViewModel DialogDemo => ServiceLocator.Current.GetInstance<DialogDemoViewModel>();
public DialogDemoViewModel DialogDemo => SimpleIoc.Default.GetInstance<DialogDemoViewModel>();
public SearchBarDemoViewModel SearchBarDemo => ServiceLocator.Current.GetInstance<SearchBarDemoViewModel>();
public SearchBarDemoViewModel SearchBarDemo => SimpleIoc.Default.GetInstance<SearchBarDemoViewModel>();
public NotifyIconDemoViewModel NotifyIconDemo => ServiceLocator.Current.GetInstance<NotifyIconDemoViewModel>();
public NotifyIconDemoViewModel NotifyIconDemo => SimpleIoc.Default.GetInstance<NotifyIconDemoViewModel>();
public InteractiveDialogViewModel InteractiveDialog => ServiceLocator.Current.GetInstance<InteractiveDialogViewModel>();
public InteractiveDialogViewModel InteractiveDialog => SimpleIoc.Default.GetInstance<InteractiveDialogViewModel>();
public BadgeDemoViewModel BadgeDemo => ServiceLocator.Current.GetInstance<BadgeDemoViewModel>();
public BadgeDemoViewModel BadgeDemo => SimpleIoc.Default.GetInstance<BadgeDemoViewModel>();
public SideMenuDemoViewModel SideMenuDemo => ServiceLocator.Current.GetInstance<SideMenuDemoViewModel>();
public SideMenuDemoViewModel SideMenuDemo => SimpleIoc.Default.GetInstance<SideMenuDemoViewModel>();
public TabControlDemoViewModel TabControlDemo => new TabControlDemoViewModel(ServiceLocator.Current.GetInstance<DataService>());
public TabControlDemoViewModel TabControlDemo => new TabControlDemoViewModel(SimpleIoc.Default.GetInstance<DataService>());
public NoUserViewModel NoUser => ServiceLocator.Current.GetInstance<NoUserViewModel>();
public NoUserViewModel NoUser => SimpleIoc.Default.GetInstance<NoUserViewModel>();
public CardDemoViewModel CardDemo => new CardDemoViewModel(ServiceLocator.Current.GetInstance<DataService>());
public CardDemoViewModel CardDemo => new CardDemoViewModel(SimpleIoc.Default.GetInstance<DataService>());
public SpriteDemoViewModel SpriteDemo => ServiceLocator.Current.GetInstance<SpriteDemoViewModel>();
public SpriteDemoViewModel SpriteDemo => SimpleIoc.Default.GetInstance<SpriteDemoViewModel>();
public NotificationDemoViewModel NotificationDemo => ServiceLocator.Current.GetInstance<NotificationDemoViewModel>();
public NotificationDemoViewModel NotificationDemo => SimpleIoc.Default.GetInstance<NotificationDemoViewModel>();
public SplitButtonDemoViewModel SplitButtonDemo => ServiceLocator.Current.GetInstance<SplitButtonDemoViewModel>();
public SplitButtonDemoViewModel SplitButtonDemo => SimpleIoc.Default.GetInstance<SplitButtonDemoViewModel>();
#endregion
}
@@ -19,40 +19,40 @@
Width="800">
<hc:Window.NonClientAreaContent>
<StackPanel Orientation="Horizontal" Height="69">
<Path Data="{StaticResource LogoGeometry}" Width="40" Height="40" Stretch="Uniform" Fill="#F76B1C" Margin="20,0,0,0"></Path>
<Path Data="{StaticResource LogoGeometry}" Width="40" Height="40" Stretch="Uniform" Fill="#F76B1C" Margin="20,0,0,0"/>
<Button Style="{StaticResource ButtonCustom}" Margin="32,0,0,0">
<Border Width="30" Height="30" BorderThickness="1" CornerRadius="6" BorderBrush="#B7B5B7" Background="{StaticResource MenuButtonBorderBrush}">
<Path Margin="5" Fill="#ED41FF" Stretch="Uniform" Data="{StaticResource ErrorGeometry}"></Path>
<Path Margin="5" Fill="#ED41FF" Stretch="Uniform" Data="{StaticResource ErrorGeometry}"/>
</Border>
</Button>
<Button Style="{StaticResource ButtonCustom}" Margin="10,0,0,0">
<Border Width="30" Height="30" BorderThickness="1" CornerRadius="6" BorderBrush="#B7B5B7" Background="{DynamicResource MenuButtonBorderBrush}">
<Path Margin="6" Fill="#ED41FF" Stretch="Uniform" Data="{StaticResource AskGeometry}"></Path>
<Path Margin="6" Fill="#ED41FF" Stretch="Uniform" Data="{StaticResource AskGeometry}"/>
</Border>
</Button>
<Button Style="{StaticResource ButtonCustom}" Margin="10,0,0,0">
<Border Width="30" Height="30" BorderThickness="1" CornerRadius="6" BorderBrush="#B7B5B7" Background="{DynamicResource MenuButtonBorderBrush}">
<Path Margin="6" Fill="#ED41FF" Stretch="Uniform" Data="{StaticResource InfoGeometry}"></Path>
<Path Margin="6" Fill="#ED41FF" Stretch="Uniform" Data="{StaticResource InfoGeometry}"/>
</Border>
</Button>
<Button Style="{StaticResource ButtonCustom}" Margin="32,0,0,0">
<Border Width="30" Height="30" BorderThickness="1" CornerRadius="6" BorderBrush="#B7B5B7" Background="{DynamicResource MenuButtonBorderBrush}">
<Path Margin="5" Fill="#8EC915" Stretch="Uniform" Data="{StaticResource ErrorGeometry}"></Path>
<Path Margin="5" Fill="#8EC915" Stretch="Uniform" Data="{StaticResource ErrorGeometry}"/>
</Border>
</Button>
<Button Style="{StaticResource ButtonCustom}" Margin="10,0,0,0">
<Border Width="30" Height="30" BorderThickness="1" CornerRadius="6" BorderBrush="#B7B5B7" Background="{DynamicResource MenuButtonBorderBrush}">
<Path Margin="6" Fill="#8EC915" Stretch="Uniform" Data="{StaticResource AskGeometry}"></Path>
<Path Margin="6" Fill="#8EC915" Stretch="Uniform" Data="{StaticResource AskGeometry}"/>
</Border>
</Button>
<Button Style="{StaticResource ButtonCustom}" Margin="10,0,0,0">
<Border Width="30" Height="30" BorderThickness="1" CornerRadius="6" BorderBrush="#B7B5B7" Background="{DynamicResource MenuButtonBorderBrush}">
<Path Margin="6" Fill="#8EC915" Stretch="Uniform" Data="{StaticResource AllGeometry}"></Path>
<Path Margin="6" Fill="#8EC915" Stretch="Uniform" Data="{StaticResource AllGeometry}"/>
</Border>
</Button>
<Button Style="{StaticResource ButtonCustom}" Margin="10,0,0,0">
<Border Width="30" Height="30" BorderThickness="1" CornerRadius="6" BorderBrush="#B7B5B7" Background="{DynamicResource MenuButtonBorderBrush}">
<Path Margin="6" Fill="#8EC915" Stretch="Uniform" Data="{StaticResource InfoGeometry}"></Path>
<Path Margin="6" Fill="#8EC915" Stretch="Uniform" Data="{StaticResource InfoGeometry}"/>
</Border>
</Button>
</StackPanel>