generated from stho32/BP001-ProjectTemplate-CSharp
-
Notifications
You must be signed in to change notification settings - Fork 1
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
103 additions
and
2 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
Source/VisualPairCoding/VisualPairCoding.AvaloniaUI/AboutForm.axaml
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,40 @@ | ||
<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="550" d:DesignHeight="330" | ||
SizeToContent="WidthAndHeight" | ||
x:Class="VisualPairCoding.AvaloniaUI.AboutForm" | ||
Title="About"> | ||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10"> | ||
<TextBlock Text="Welcome to Visual Pair Coding!" FontSize="20"/> | ||
|
||
<TextBlock FontSize="16" Margin="0,10,0,5"> | ||
This project is a collaboration by | ||
</TextBlock> | ||
|
||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock FontSize="16"> | ||
<TextBlock Name="NaseifsUrl" Foreground="Blue">Naseif</TextBlock> | ||
</TextBlock> | ||
<TextBlock FontSize="16" Margin="5,0,5,0">and</TextBlock> | ||
<TextBlock FontSize="16"> | ||
<Run Text="stho32" Foreground="Blue"/> | ||
<TextBlock Text="'s GitHub" Foreground="Blue" /> | ||
</TextBlock> | ||
</StackPanel> | ||
|
||
<TextBlock FontSize="16" Margin="0,10,0,5"> | ||
This is a Clever Code Cravers project. | ||
</TextBlock> | ||
|
||
<TextBlock FontSize="16" Margin="0,10,0,5"> | ||
You can find the source code on GitHub: | ||
<TextBlock Text="GitHub Repository" Foreground="Blue" /> | ||
</TextBlock> | ||
|
||
<TextBlock FontSize="16" Margin="0,10,0,5"> | ||
Version: <Run Text="{Binding Version}" Foreground="Green"/> | ||
</TextBlock> | ||
</StackPanel> | ||
</Window> |
56 changes: 56 additions & 0 deletions
56
Source/VisualPairCoding/VisualPairCoding.AvaloniaUI/AboutForm.axaml.cs
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,56 @@ | ||
using Avalonia.Controls; | ||
using Avalonia.Interactivity; | ||
using System; | ||
|
||
namespace VisualPairCoding.AvaloniaUI | ||
{ | ||
public partial class AboutForm : Window | ||
{ | ||
public AboutForm() | ||
{ | ||
InitializeComponent(); | ||
|
||
NaseifsUrl.Tapped += NaseifsUrl_Tapped; | ||
} | ||
|
||
private void NaseifsUrl_Tapped(object? sender, Avalonia.Input.TappedEventArgs e) | ||
{ | ||
OpenUrlInBrowser("https://github.com/naseif"); | ||
} | ||
|
||
private void Naseif_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
// Open Naseif's GitHub page | ||
} | ||
|
||
private void Stho32_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
// Open stho32's GitHub page | ||
OpenUrlInBrowser("https://github.com/stho32"); | ||
} | ||
|
||
private void GitHubRepo_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
// Open your GitHub repository page | ||
OpenUrlInBrowser("https://github.com/yourrepository"); | ||
} | ||
|
||
private void OpenUrlInBrowser(string url) | ||
{ | ||
try | ||
{ | ||
// Use the default web browser to open the URL. | ||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(url) | ||
{ | ||
UseShellExecute = true | ||
}); | ||
} | ||
catch (Exception ex) | ||
{ | ||
// Handle any exceptions that may occur when opening the URL. | ||
// You can add your error handling logic here. | ||
Console.WriteLine($"Error opening URL: {ex.Message}"); | ||
} | ||
} | ||
} | ||
} |
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