Add ribbon, AboutViewModel and AboutView.
This commit is contained in:
116
zaaReloaded2/ViewModels/AboutViewModel.cs
Executable file
116
zaaReloaded2/ViewModels/AboutViewModel.cs
Executable file
@ -0,0 +1,116 @@
|
||||
/* AboutViewModel.cs
|
||||
* part of zaaReloaded2
|
||||
*
|
||||
* Copyright 2015 Daniel Kraus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Bovender.Mvvm.ViewModels;
|
||||
using Bovender.Mvvm;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace zaaReloaded2.ViewModels
|
||||
{
|
||||
class AboutViewModel : ViewModelBase
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public string AddinName
|
||||
{
|
||||
get
|
||||
{
|
||||
return Properties.Settings.Default.AddinName;
|
||||
}
|
||||
}
|
||||
|
||||
public string PubYear
|
||||
{
|
||||
get
|
||||
{
|
||||
string year = Properties.Settings.Default.PubYear;
|
||||
if (year == "2015")
|
||||
{
|
||||
return year;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "2015-" + year;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string CopyrightString
|
||||
{
|
||||
get
|
||||
{
|
||||
return String.Format("(c) Copyright {0} {1}",
|
||||
PubYear,
|
||||
Properties.Settings.Default.Authors);
|
||||
}
|
||||
}
|
||||
|
||||
public string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
return zaaReloaded2.Updater.Version.CurrentVersion().ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public string Homepage
|
||||
{
|
||||
get
|
||||
{
|
||||
return Properties.Settings.Default.Homepage.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Commands
|
||||
|
||||
public DelegatingCommand GotoHomepageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_gotoHomepageCommand == null)
|
||||
{
|
||||
_gotoHomepageCommand = new DelegatingCommand(
|
||||
param => { Process.Start(new ProcessStartInfo(Homepage)); });
|
||||
}
|
||||
return _gotoHomepageCommand;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ViewModelBase implementation
|
||||
|
||||
public override object RevealModelObject()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
||||
DelegatingCommand _gotoHomepageCommand;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user