Skip to content

Commit

Permalink
Add icon and About dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalmers committed Jul 16, 2018
1 parent e2c97bf commit 145437f
Show file tree
Hide file tree
Showing 13 changed files with 293 additions and 6 deletions.
30 changes: 30 additions & 0 deletions DesktopClock/DesktopClock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>DesktopClock.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down Expand Up @@ -104,12 +107,39 @@
<PackageReference Include="PropertyChanged.Fody">
<Version>2.5.8</Version>
</PackageReference>
<PackageReference Include="WpfAboutView">
<Version>1.2.0</Version>
</PackageReference>
<PackageReference Include="WpfWindowPlacement">
<Version>2.0.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<Resource Include="DesktopClock.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\MVVM Light License.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\PropertyChanged.Fody License.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\WpfAboutView License.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\WpfWindowPlacement License.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Costura.Fody License.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\DesktopClock License.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Json.NET License.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file added DesktopClock/DesktopClock.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions DesktopClock/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@

<Separator />

<MenuItem Click="MenuItemAbout_OnClick"
Header="_About..." />

<MenuItem Click="MenuItemExit_OnClick"
Header="E_xit" />
</ContextMenu>
Expand Down
63 changes: 62 additions & 1 deletion DesktopClock/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Windows;
using System;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Input;
using WpfAboutView;

namespace DesktopClock
{
Expand All @@ -21,6 +24,64 @@ private void Window_MouseDown(object sender, MouseButtonEventArgs e)
}
}

private void MenuItemAbout_OnClick(object sender, RoutedEventArgs e)
{
new AboutDialog
{
Owner = this,
WindowStartupLocation = WindowStartupLocation.CenterOwner,
AboutView = new AboutView
{
AppIconSource = new Uri("pack://application:,,,/DesktopClock.ico"),
CreditColumns = 3,
Credits = new ObservableCollection<Credit> {
new Credit {
Name = "DesktopClock",
Author = "Daniel Chalmers",
Website = new Uri("https://github.com/danielchalmers/DesktopClock"),
LicenseText = Properties.Resources.DesktopClock_License
},
new Credit {
Name = "Costura.Fody",
Author = "Simon Cropp",
Website = new Uri("https://github.com/Fody/Costura"),
LicenseText = Properties.Resources.Costura_Fody_License
},
new Credit {
Name = "MVVM Light",
Author = "Laurent Bugnion",
Website = new Uri("http://mvvmlight.net"),
LicenseText = Properties.Resources.MVVM_Light_License
},
new Credit {
Name = "Json.NET",
Author = "James Newton-King",
Website = new Uri("https://newtonsoft.com/json"),
LicenseText = Properties.Resources.Json_NET_License
},
new Credit {
Name = "PropertyChanged.Fody",
Author = "Simon Cropp",
Website = new Uri("https://github.com/Fody/PropertyChanged"),
LicenseText = Properties.Resources.PropertyChanged_Fody_License
},
new Credit {
Name = "WpfAboutView",
Author = "Daniel Chalmers",
Website = new Uri("https://github.com/danielchalmers/WpfAboutView"),
LicenseText = Properties.Resources.WpfAboutView_License
},
new Credit {
Name = "WpfWindowPlacement",
Author = "Daniel Chalmers",
Website = new Uri("https://github.com/danielchalmers/WpfWindowPlacement"),
LicenseText = Properties.Resources.WpfWindowPlacement_License
},
}
}
}.ShowDialog();
}

private void MenuItemExit_OnClick(object sender, RoutedEventArgs e)
{
Close();
Expand Down
105 changes: 105 additions & 0 deletions DesktopClock/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 30 additions & 5 deletions DesktopClock/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
Expand All @@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
Expand All @@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
Expand All @@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
Expand All @@ -109,9 +112,31 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Costura_Fody_License" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Costura.Fody License.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="DesktopClock_License" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DesktopClock License.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Json_NET_License" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Json.NET License.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="MVVM_Light_License" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MVVM Light License.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="PropertyChanged_Fody_License" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\PropertyChanged.Fody License.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="WpfAboutView_License" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\WpfAboutView License.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="WpfWindowPlacement_License" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\WpfWindowPlacement License.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>
9 changes: 9 additions & 0 deletions DesktopClock/Resources/Costura.Fody License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2012 Simon Cropp and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 9 additions & 0 deletions DesktopClock/Resources/DesktopClock License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2018 Daniel Chalmers

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 9 additions & 0 deletions DesktopClock/Resources/Json.NET License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2007 James Newton-King

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 145437f

Please sign in to comment.