refactor(app): split dashboard settings and layout into partial classes
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
@inherits LayoutComponentBase
|
||||
@using System.Reflection
|
||||
|
||||
<div class="d-flex flex-column vh-100">
|
||||
<nav class="app-navbar d-flex justify-content-between align-items-center">
|
||||
@@ -33,28 +32,3 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
private bool showAboutDialog;
|
||||
|
||||
private void OpenAboutDialog() => showAboutDialog = true;
|
||||
|
||||
private void CloseAboutDialog() => showAboutDialog = false;
|
||||
|
||||
private static string AppVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
var entryAssembly = Assembly.GetEntryAssembly();
|
||||
var infoVersion = entryAssembly?
|
||||
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
|
||||
.InformationalVersion;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(infoVersion))
|
||||
{
|
||||
return infoVersion.Split('+')[0];
|
||||
}
|
||||
|
||||
return entryAssembly?.GetName().Version?.ToString(2) ?? "1.0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace Duempelkas.App.Components.Layout;
|
||||
|
||||
public partial class MainLayout
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private bool showAboutDialog;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
private static string AppVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
var entryAssembly = Assembly.GetEntryAssembly();
|
||||
var infoVersion = entryAssembly?
|
||||
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
|
||||
.InformationalVersion;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(infoVersion))
|
||||
{
|
||||
return infoVersion.Split('+')[0];
|
||||
}
|
||||
|
||||
return entryAssembly?.GetName().Version?.ToString(2) ?? "1.0";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
private void OpenAboutDialog() => showAboutDialog = true;
|
||||
|
||||
private void CloseAboutDialog() => showAboutDialog = false;
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user