Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dictionary in GrowlNotifications.xaml & resources relative path #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions WPFGrowlNotification/App.xaml

This file was deleted.

15 changes: 0 additions & 15 deletions WPFGrowlNotification/App.xaml.cs

This file was deleted.

29 changes: 16 additions & 13 deletions WPFGrowlNotification/GrowlNotifiactions.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,34 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Model="clr-namespace:WPFGrowlNotification"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
Title="GrowlNotifiactions" Height="530" Width="300" ShowActivated="False" AllowsTransparency="True" WindowStyle="None" ShowInTaskbar="False" Background="Transparent" Topmost="True" UseLayoutRounding="True">
Title="GrowlNotifiactions" Height="265" Width="300" ShowActivated="False" AllowsTransparency="True" WindowStyle="None" ShowInTaskbar="False" Background="Transparent" Topmost="True" UseLayoutRounding="True">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources\ButtonStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Storyboard x:Key="CollapseStoryboard">
<DoubleAnimation From="100" To="0" Storyboard.TargetProperty="Height" Duration="0:0:1"/>
</Storyboard>
<DataTemplate x:Key="MessageTemplate" DataType="Model:Notification">
<Grid x:Name="NotificationWindow" Tag="{Binding Path=Id}" Background="Transparent" SizeChanged="NotificationWindowSizeChanged">
<Border Name="border" Background="#2a3345" BorderThickness="0" CornerRadius="10" Margin="10">
<Border.Effect>
<DropShadowEffect ShadowDepth="0" Opacity="0.8" BlurRadius="10"/>
</Border.Effect>
<Grid Height="100" Width="280" Margin="6">
<Border Name="border" Background="#FFB4B4B4" BorderBrush="{Binding Path=BorderColor,FallbackValue=#FF00D1FF}" BorderThickness="6,1,1,1" Margin="1">
<!--<Border.Effect>
<DropShadowEffect ShadowDepth="0" Opacity="0.8" BlurRadius="10"/>
</Border.Effect>-->
<Grid Height="60" Width="280" Margin="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Grid.RowSpan="2" Source="{Binding Path=ImageUrl}" Margin="4" Width="80"></Image>
<TextBlock Grid.Column="1" Text="{Binding Path=Title}" TextOptions.TextRenderingMode="ClearType" TextOptions.TextFormattingMode="Display" Foreground="White"
<TextBlock Text="{Binding Path=Title}" TextOptions.TextRenderingMode="ClearType" TextOptions.TextFormattingMode="Display" Foreground="White"
FontFamily="Arial" FontSize="14" FontWeight="Bold" VerticalAlignment="Center" Margin="2,4,4,2" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" />
<Button x:Name="CloseButton" Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,0,12,0" Style="{StaticResource CloseButton}" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=Message}" TextOptions.TextRenderingMode="ClearType" TextOptions.TextFormattingMode="Display" Foreground="White"
FontFamily="Arial" VerticalAlignment="Center" Margin="2,2,4,4" TextWrapping="Wrap" TextTrimming="CharacterEllipsis"/>
<Button x:Name="CloseButton" Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Style="{StaticResource CloseButton}" />
<TextBlock Grid.Row="1" Text="{Binding Path=Message}" TextOptions.TextRenderingMode="ClearType" TextOptions.TextFormattingMode="Display" Foreground="White"
FontFamily="Arial" VerticalAlignment="Center" Margin="1,2,2,1" TextWrapping="Wrap" TextTrimming="CharacterEllipsis"/>
</Grid>
</Border>
</Grid>
Expand Down Expand Up @@ -66,6 +68,7 @@
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ResourceDictionary>
</Window.Resources>
<ItemsControl x:Name="NotificationsControl" FocusVisualStyle="{x:Null}" d:DataContext="{d:DesignData Source=DesignTimeNotificationData.xaml}" ItemsSource="{Binding .}" ItemTemplate="{StaticResource MessageTemplate}" />
<ItemsControl VerticalAlignment="Bottom" x:Name="NotificationsControl" FocusVisualStyle="{x:Null}" d:DataContext="{d:DesignData Source=DesignTimeNotificationData.xaml}" ItemsSource="{Binding .}" ItemTemplate="{StaticResource MessageTemplate}" />
</Window>
11 changes: 0 additions & 11 deletions WPFGrowlNotification/MainWindow.xaml

This file was deleted.

53 changes: 0 additions & 53 deletions WPFGrowlNotification/MainWindow.xaml.cs

This file was deleted.

24 changes: 12 additions & 12 deletions WPFGrowlNotification/Notification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@ public string Message
}
}

private int id;
public int Id
private string borderColor;
public string BorderColor
{
get { return id; }
get { return borderColor; }

set
{
if (id == value) return;
id = value;
OnPropertyChanged("Id");
if (borderColor == value) return;
borderColor = value;
OnPropertyChanged("BorderColor");
}
}

private string imageUrl;
public string ImageUrl
private int id;
public int Id
{
get { return imageUrl; }
get { return id; }

set
{
if (imageUrl == value) return;
imageUrl = value;
OnPropertyChanged("ImageUrl");
if (id == value) return;
id = value;
OnPropertyChanged("Id");
}
}

Expand Down
24 changes: 9 additions & 15 deletions WPFGrowlNotification/Resources/ButtonStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,9 @@
</Setter>
</Style>

<LinearGradientBrush x:Key="CloseNormal" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#394452" Offset="0.0"/>
<GradientStop Color="#343e4a" Offset="1.0"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="CloseOver" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#515a6b" Offset="0.0"/>
<GradientStop Color="#474f5d" Offset="1.0"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ClosePressed" Color="#090909" />
<SolidColorBrush x:Key="CloseNormal" Color="#c5c5c5" />
<SolidColorBrush x:Key="CloseOver" Color="#c0c0c0" />
<SolidColorBrush x:Key="ClosePressed" Color="#b6b6b6" />

<Style x:Key="CloseButton" TargetType="{x:Type Button}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
Expand All @@ -51,15 +45,15 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Border x:Name="Border" CornerRadius="3" BorderThickness="0" ClipToBounds="False" Background="{StaticResource CloseNormal}" BorderBrush="{StaticResource NormalBorderBrush}">
<Border.Effect>
<Border x:Name="Border" Opacity=".50" BorderThickness="0" ClipToBounds="False" Background="{StaticResource CloseNormal}" BorderBrush="{StaticResource NormalBorderBrush}">
<!--<Border.Effect>
<DropShadowEffect ShadowDepth="0" Opacity=".4" BlurRadius="5" Color="Black"/>
</Border.Effect>
</Border.Effect>-->
<Grid>
<Image Source="pack://application:,,,/Resources/close.png" IsHitTestVisible="False" Margin="2">
<Image.Effect>
<Image Source="close.png" IsHitTestVisible="False" Margin="1">
<!--<Image.Effect>
<DropShadowEffect Direction="90" ShadowDepth="1" BlurRadius="1"/>
</Image.Effect>
</Image.Effect>-->
</Image>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True"/>
</Grid>
Expand Down
Binary file not shown.
Binary file removed WPFGrowlNotification/Resources/facebook-button.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
27 changes: 4 additions & 23 deletions WPFGrowlNotification/WPFGrowlNotification.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6995ABFD-720F-41E7-BE8B-38F23BA4BB57}</ProjectGuid>
<OutputType>WinExe</OutputType>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WPFGrowlNotification</RootNamespace>
<AssemblyName>WPFGrowlNotification</AssemblyName>
Expand Down Expand Up @@ -33,6 +33,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
Expand All @@ -45,10 +48,6 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<DesignData Include="DesignTimeNotificationData.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand All @@ -57,22 +56,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="GrowlNotifiactions.xaml.cs">
<DependentUpon>GrowlNotifiactions.xaml</DependentUpon>
</Compile>
<Compile Include="Notification.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Resources\ButtonStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -102,12 +89,6 @@
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\facebook-button.png" />
<Resource Include="Resources\microsoft-windows-8-logo.png" />
<Resource Include="Resources\notification-icon.png" />
<Resource Include="Resources\Radiation_warning_symbol.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\close.png" />
</ItemGroup>
Expand Down