update pr/59

This commit is contained in:
NaBian committed 2019-04-04 23:51:42 +08:00
1 parent 0fb520bf8d
commit ada85bb59d
13 files changed
+230 -236

No files matched your search

+1 -1
View File
@@ -364,7 +364,7 @@
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
<Compile Include="ViewModel\Basic\InteractiveDialogViewModel.cs" />
<Compile Include="ViewModel\Common\ComboBoxDemoViewModel.cs" />
<Compile Include="ViewModel\Controls\BadgeDemoCtlViewModel.cs" />
<Compile Include="ViewModel\Controls\BadgeDemoViewModel.cs" />
<Compile Include="ViewModel\Controls\CoverViewModel.cs" />
<Compile Include="ViewModel\Controls\DialogDemoViewModel.cs" />
<Compile Include="ViewModel\Controls\NotifyIconDemoViewModel.cs" />
File diff suppressed because it is too large. Load diff
@@ -561,7 +561,7 @@
<data name="PleaseInput" xml:space="preserve">
<value>Please input...</value>
</data>
<data name="Count" xml:space="preserve">
<value>Count</value>
<data name="Click2Count" xml:space="preserve">
<value>Click to count</value>
</data>
</root>
+1 -1
View File
@@ -561,7 +561,7 @@
<data name="PleaseInput" xml:space="preserve">
<value>请输入...</value>
</data>
<data name="Count" xml:space="preserve">
<data name="Click2Count" xml:space="preserve">
<value>点击计数</value>
</data>
</root>
@@ -4,7 +4,7 @@
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="{DynamicResource RegionBrush}"
DataContext="{Binding Path=BadgeDemoCtl, Source={StaticResource Locator}}">
DataContext="{Binding BadgeDemo, Source={StaticResource Locator}}">
<controls:TransitioningContentControl>
<StackPanel Margin="32" Orientation="Horizontal">
<controls:Badge Text="New" BadgeMargin="0,-14,-20,0" Height="30">
@@ -13,8 +13,8 @@
<controls:Badge Text="New" BadgeMargin="0,-14,-20,0" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgeDanger}">
<Button Content="{x:Static langs:Lang.Comment}"/>
</controls:Badge>
<controls:Badge Value="{Binding Count}" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgePrimary}">
<Button Content="{x:Static langs:Lang.Count}" Command="{Binding CountCommand}"/>
<controls:Badge Value="{Binding Count}" BadgeMargin="0,-14,-10,0" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgePrimary}">
<Button Content="{x:Static langs:Lang.Click2Count}" Command="{Binding CountCmd}"/>
</controls:Badge>
<controls:Badge Value="100" BadgeMargin="0,-14,-20,0" Height="30" Margin="32,0,0,0" Style="{StaticResource BadgeDanger}">
<Button Content="{x:Static langs:Lang.Comment}"/>
@@ -1,25 +0,0 @@
using System.Windows.Input;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
namespace HandyControlDemo.ViewModel.Controls
{
public class BadgeDemoCtlViewModel : ViewModelBase
{
private int _count;
public int Count
{
get => _count;
set => Set(ref _count, value);
}
public ICommand CountCommand { get; }
public BadgeDemoCtlViewModel()
{
Count = 1;
CountCommand = new RelayCommand(() => Count++);
}
}
}
@@ -0,0 +1,20 @@
using System;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
namespace HandyControlDemo.ViewModel.Controls
{
public class BadgeDemoViewModel : ViewModelBase
{
private int _count = 1;
public int Count
{
get => _count;
set => Set(ref _count, value);
}
public RelayCommand CountCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(() => Count++)).Value;
}
}
@@ -32,7 +32,7 @@ namespace HandyControlDemo.ViewModel
SimpleIoc.Default.Register<SearchBarDemoViewModel>();
SimpleIoc.Default.Register<NotifyIconDemoViewModel>();
SimpleIoc.Default.Register<InteractiveDialogViewModel>();
SimpleIoc.Default.Register<BadgeDemoCtlViewModel>();
SimpleIoc.Default.Register<BadgeDemoViewModel>();
}
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
@@ -70,7 +70,7 @@ namespace HandyControlDemo.ViewModel
public InteractiveDialogViewModel InteractiveDialog => ServiceLocator.Current.GetInstance<InteractiveDialogViewModel>();
public BadgeDemoCtlViewModel BadgeDemoCtl => ServiceLocator.Current.GetInstance<BadgeDemoCtlViewModel>();
public BadgeDemoViewModel BadgeDemo => ServiceLocator.Current.GetInstance<BadgeDemoViewModel>();
#endregion
}
}