Growl multi-window support
This commit is contained in:
1 parent
7c331c1e60
commit
0cdb6d7543
14 files changed
+160
-36
No files matched your search
@@ -381,6 +381,9 @@
|
||||
<Compile Include="Window\CustomNonClientAreaWindow.xaml.cs">
|
||||
<DependentUpon>CustomNonClientAreaWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Window\GrowlDemoWindow.xaml.cs">
|
||||
<DependentUpon>GrowlDemoWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Window\NoNonClientAreaDragableWindow.xaml.cs">
|
||||
<DependentUpon>NoNonClientAreaDragableWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -764,6 +767,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Window\GrowlDemoWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Window\NoNonClientAreaDragableWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<userControl:MainContent Grid.Column="1"/>
|
||||
<GridSplitter Grid.Column="1" HorizontalAlignment="Left" Width="4" Background="Transparent" BorderThickness="1,0,0,0" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
<controls:ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Right" IsEnableInertia="True" IsPenetrating="True">
|
||||
<StackPanel controls:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,10"/>
|
||||
<StackPanel Name="GrowlPanel" VerticalAlignment="Top" Margin="0,10,10,10"/>
|
||||
</controls:ScrollViewer>
|
||||
</Grid>
|
||||
</controls:BlurWindow>
|
||||
@@ -1,4 +1,7 @@
|
||||
namespace HandyControlDemo
|
||||
using System;
|
||||
using HandyControl.Controls;
|
||||
|
||||
namespace HandyControlDemo
|
||||
{
|
||||
public partial class MainWindow
|
||||
{
|
||||
@@ -6,5 +9,19 @@
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnActivated(EventArgs e)
|
||||
{
|
||||
base.OnActivated(e);
|
||||
|
||||
Growl.SetGrowlParent(GrowlPanel, true);
|
||||
}
|
||||
|
||||
protected override void OnDeactivated(EventArgs e)
|
||||
{
|
||||
base.OnDeactivated(e);
|
||||
|
||||
Growl.SetGrowlParent(GrowlPanel, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
@@ -519,6 +519,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 消息通知示例 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string GrowlDemo {
|
||||
get {
|
||||
return ResourceManager.GetString("GrowlDemo", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 连接失败,请检查网络! 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -672,6 +681,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 新建窗口 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string NewWindow {
|
||||
get {
|
||||
return ResourceManager.GetString("NewWindow", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 下一步 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -522,4 +522,10 @@
|
||||
<data name="PleaseWait" xml:space="preserve">
|
||||
<value>Please wait...</value>
|
||||
</data>
|
||||
<data name="GrowlDemo" xml:space="preserve">
|
||||
<value>Growl demo</value>
|
||||
</data>
|
||||
<data name="NewWindow" xml:space="preserve">
|
||||
<value>New window</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -522,4 +522,10 @@
|
||||
<data name="PleaseWait" xml:space="preserve">
|
||||
<value>请稍后...</value>
|
||||
</data>
|
||||
<data name="GrowlDemo" xml:space="preserve">
|
||||
<value>消息通知示例</value>
|
||||
</data>
|
||||
<data name="NewWindow" xml:space="preserve">
|
||||
<value>新建窗口</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -6,14 +6,17 @@
|
||||
DataContext="{Binding GrowlDemo,Source={StaticResource Locator}}"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<controls:TransitioningContentControl>
|
||||
<WrapPanel Margin="32" VerticalAlignment="Center">
|
||||
<Button Command="{Binding InfoCmd}" Content="{x:Static langs:Lang.Info}" Margin="0,5,5,5" Style="{StaticResource ButtonInfo}"/>
|
||||
<Button Command="{Binding SuccessCmd}" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ButtonSuccess}"/>
|
||||
<Button Command="{Binding WarningCmd}" Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ButtonWarning}"/>
|
||||
<Button Command="{Binding ErrorCmd}" Content="{x:Static langs:Lang.Error}" Margin="5" Style="{StaticResource ButtonDanger}"/>
|
||||
<Button Command="{Binding AskCmd}" Content="{x:Static langs:Lang.Ask}" Margin="5" Background="BlueViolet" Foreground="White"/>
|
||||
<Button Command="{Binding FatalCmd}" Content="{x:Static langs:Lang.Fatal}" Margin="5,0"/>
|
||||
<Button Command="{Binding ClearCmd}" Content="{x:Static langs:Lang.Clear}" Margin="5,0,0,0" Style="{StaticResource ButtonPrimary}"/>
|
||||
</WrapPanel>
|
||||
<StackPanel Margin="32">
|
||||
<WrapPanel VerticalAlignment="Center">
|
||||
<Button Command="{Binding InfoCmd}" Content="{x:Static langs:Lang.Info}" Margin="0,5,5,5" Style="{StaticResource ButtonInfo}"/>
|
||||
<Button Command="{Binding SuccessCmd}" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ButtonSuccess}"/>
|
||||
<Button Command="{Binding WarningCmd}" Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ButtonWarning}"/>
|
||||
<Button Command="{Binding ErrorCmd}" Content="{x:Static langs:Lang.Error}" Margin="5" Style="{StaticResource ButtonDanger}"/>
|
||||
<Button Command="{Binding AskCmd}" Content="{x:Static langs:Lang.Ask}" Margin="5" Background="BlueViolet" Foreground="White"/>
|
||||
<Button Command="{Binding FatalCmd}" Content="{x:Static langs:Lang.Fatal}" Margin="5,0"/>
|
||||
<Button Command="{Binding ClearCmd}" Content="{x:Static langs:Lang.Clear}" Margin="5,0,0,0" Style="{StaticResource ButtonPrimary}"/>
|
||||
</WrapPanel>
|
||||
<Button Command="{Binding NewWindowCmd}" Content="{x:Static langs:Lang.NewWindow}" Margin="0,5,0,0" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
</controls:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -2,6 +2,7 @@
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
@@ -44,5 +45,8 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public RelayCommand ClearCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(Growl.Clear)).Value;
|
||||
|
||||
public RelayCommand NewWindowCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => new GrowlDemoWindow().Show())).Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<Window x:Class="HandyControlDemo.Window.GrowlDemoWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
DataContext="{Binding GrowlDemo,Source={StaticResource Locator}}"
|
||||
Title="{x:Static langs:Lang.GrowlDemo}"
|
||||
Width="800"
|
||||
Height="500">
|
||||
<controls:TransitioningContentControl>
|
||||
<controls:SimplePanel>
|
||||
<StackPanel Margin="32">
|
||||
<WrapPanel HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<Button Command="{Binding InfoCmd}" Content="{x:Static langs:Lang.Info}" Margin="0,5,5,5" Style="{StaticResource ButtonInfo}"/>
|
||||
<Button Command="{Binding SuccessCmd}" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ButtonSuccess}"/>
|
||||
<Button Command="{Binding WarningCmd}" Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ButtonWarning}"/>
|
||||
<Button Command="{Binding ErrorCmd}" Content="{x:Static langs:Lang.Error}" Margin="5" Style="{StaticResource ButtonDanger}"/>
|
||||
<Button Command="{Binding AskCmd}" Content="{x:Static langs:Lang.Ask}" Margin="5" Background="BlueViolet" Foreground="White"/>
|
||||
<Button Command="{Binding FatalCmd}" Content="{x:Static langs:Lang.Fatal}" Margin="5,0"/>
|
||||
<Button Command="{Binding ClearCmd}" Content="{x:Static langs:Lang.Clear}" Margin="5,0,0,0" Style="{StaticResource ButtonPrimary}"/>
|
||||
</WrapPanel>
|
||||
<Button Command="{Binding NewWindowCmd}" Content="{x:Static langs:Lang.NewWindow}" HorizontalAlignment="Left" Margin="0,5,0,0"/>
|
||||
</StackPanel>
|
||||
<controls:ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Right" IsEnableInertia="True" IsPenetrating="True">
|
||||
<StackPanel Name="GrowlPanel" VerticalAlignment="Top" Margin="0,10,10,10"/>
|
||||
</controls:ScrollViewer>
|
||||
</controls:SimplePanel>
|
||||
</controls:TransitioningContentControl>
|
||||
</Window>
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using HandyControl.Controls;
|
||||
|
||||
namespace HandyControlDemo.Window
|
||||
{
|
||||
public partial class GrowlDemoWindow
|
||||
{
|
||||
public GrowlDemoWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnActivated(EventArgs e)
|
||||
{
|
||||
base.OnActivated(e);
|
||||
|
||||
Growl.SetGrowlParent(GrowlPanel, true);
|
||||
}
|
||||
|
||||
protected override void OnDeactivated(EventArgs e)
|
||||
{
|
||||
base.OnDeactivated(e);
|
||||
|
||||
Growl.SetGrowlParent(GrowlPanel, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user