-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<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" | ||
xmlns:dialogs="clr-namespace:Turbulence.Desktop.Dialogs" | ||
mc:Ignorable="d" d:DesignWidth="250" d:DesignHeight="150" | ||
MaxWidth="250" MaxHeight="150" | ||
WindowStartupLocation="CenterOwner" | ||
x:Class="Turbulence.Desktop.Dialogs.OkWindow" | ||
x:DataType="dialogs:OkWindow" | ||
Title="Info"> | ||
<Grid Background="#313338"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="30" /> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="30" /> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="15" /> | ||
</Grid.RowDefinitions> | ||
<TextBlock Grid.Row="1" HorizontalAlignment="Center" Text="{Binding Prompt}" TextWrapping="Wrap">Prompt</TextBlock> | ||
<Button Grid.Row="3" Name="abort" HorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Click="OnClick">OK</Button> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Interactivity; | ||
using Avalonia.Markup.Xaml; | ||
using System; | ||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace Turbulence.Desktop.Dialogs; | ||
|
||
public partial class OkWindow : Window, INotifyPropertyChanged | ||
{ | ||
// Needed to notify the view that a property has changed | ||
public event PropertyChangedEventHandler? PropertyChanged; | ||
Check warning on line 14 in Turbulence.Desktop/Dialogs/OkWindow.axaml.cs GitHub Actions / build
|
||
|
||
// The prompt shown at the top | ||
private string? prompt; | ||
|
||
public string Prompt | ||
{ | ||
get => prompt ?? ""; | ||
|
||
set | ||
{ | ||
if (value != prompt) | ||
{ | ||
prompt = value; | ||
NotifyPropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
private void NotifyPropertyChanged([CallerMemberName] string propertyName = "") | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
public OkWindow() | ||
{ | ||
InitializeComponent(); | ||
DataContext = this; | ||
} | ||
|
||
private void OnClick(object sender, RoutedEventArgs e) => Close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters