mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-02 21:06:34 +03:00
Create RepositoryWindow
This commit is contained in:
@@ -25,4 +25,10 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="RepositoryWindow.axaml.cs">
|
||||||
|
<DependentUpon>RepositoryWindow.axaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
9
src/KeyKeeper/RepositoryWindow.axaml
Normal file
9
src/KeyKeeper/RepositoryWindow.axaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<Window xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="KeyKeeper.RepositoryWindow"
|
||||||
|
Title="Window1">
|
||||||
|
Welcome to Avalonia!
|
||||||
|
</Window>
|
||||||
13
src/KeyKeeper/RepositoryWindow.axaml.cs
Normal file
13
src/KeyKeeper/RepositoryWindow.axaml.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace KeyKeeper;
|
||||||
|
|
||||||
|
public partial class RepositoryWindow: Window
|
||||||
|
{
|
||||||
|
public RepositoryWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,6 +40,7 @@ namespace KeyKeeper.Views
|
|||||||
{
|
{
|
||||||
ShowMessage($"Создание нового хранилища: {path}");
|
ShowMessage($"Создание нового хранилища: {path}");
|
||||||
(DataContext as MainWindowViewModel)!.CreateVault(path);
|
(DataContext as MainWindowViewModel)!.CreateVault(path);
|
||||||
|
OpenRepositoryWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,6 +72,7 @@ namespace KeyKeeper.Views
|
|||||||
{
|
{
|
||||||
ShowMessage($"Открытие хранилища: {path}");
|
ShowMessage($"Открытие хранилища: {path}");
|
||||||
(DataContext as MainWindowViewModel)!.OpenVault(path);
|
(DataContext as MainWindowViewModel)!.OpenVault(path);
|
||||||
|
OpenRepositoryWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,5 +89,16 @@ namespace KeyKeeper.Views
|
|||||||
};
|
};
|
||||||
messageBox.ShowDialog(this);
|
messageBox.ShowDialog(this);
|
||||||
}
|
}
|
||||||
|
private void OpenRepositoryWindow()
|
||||||
|
{
|
||||||
|
var repositoryWindow = new RepositoryWindow()
|
||||||
|
{
|
||||||
|
DataContext = this.DataContext,
|
||||||
|
WindowStartupLocation = WindowStartupLocation.CenterScreen
|
||||||
|
};
|
||||||
|
repositoryWindow.Closed += (s, e) => this.Show();
|
||||||
|
repositoryWindow.Show();
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user