-
Notifications
You must be signed in to change notification settings - Fork 0
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
35 changed files
with
1,644 additions
and
101 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
<Application xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:themes="clr-namespace:Material.Styles.Themes;assembly=Material.Styles" | ||
xmlns:sty="using:FluentAvalonia.Styling" | ||
x:Class="AvaloniaMisterDoctor.App"> | ||
<Application.Styles> | ||
<FluentTheme Mode="Light"/> | ||
<themes:MaterialTheme BaseTheme="Dark" PrimaryColor="Purple" SecondaryColor="Lime" /> | ||
<StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml"></StyleInclude> | ||
<sty:FluentAvaloniaTheme /> | ||
|
||
</Application.Styles> | ||
</Application> |
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
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 @@ | ||
using System; | ||
using System.Windows.Input; | ||
|
||
namespace AvaloniaMisterDoctor.Classes; | ||
|
||
public class FACommand: ICommand | ||
{ | ||
public FACommand(Action<object> executeMethod) | ||
{ | ||
_executeMethod = executeMethod; | ||
} | ||
|
||
public event EventHandler CanExecuteChanged; | ||
|
||
public bool CanExecute(object parameter) => true; | ||
|
||
public void Execute(object parameter) | ||
{ | ||
_executeMethod.Invoke(parameter); | ||
} | ||
|
||
private Action<object> _executeMethod; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
using System; | ||
using Avalonia.Controls; | ||
using FluentAvalonia.UI.Controls; | ||
|
||
namespace AvaloniaMisterDoctor.Services; | ||
|
||
public class NavigationService | ||
{ | ||
public static NavigationService Instance { get; } = new NavigationService(); | ||
|
||
public void SetFrame(Frame f) | ||
{ | ||
_frame = f; | ||
} | ||
|
||
public void SetOverlayHost(Panel p) | ||
{ | ||
_overlayHost = p; | ||
} | ||
|
||
public void Navigate(Type t) | ||
{ | ||
_frame.Navigate(t); | ||
} | ||
|
||
public void ShowControlDefinitionOverlay(Type targetType) | ||
{ | ||
if (_overlayHost != null) | ||
{ | ||
// (_overlayHost.Children[0] as ControlDefinitionOverlay).TargetType = targetType; | ||
// (_overlayHost.Children[0] as ControlDefinitionOverlay).Show(); | ||
} | ||
} | ||
|
||
public void ClearOverlay() | ||
{ | ||
_overlayHost?.Children.Clear(); | ||
|
||
} | ||
|
||
private Frame _frame; | ||
private Panel _overlayHost; | ||
} |
105 changes: 105 additions & 0 deletions
105
AvaloniaMisterDoctor/ViewModels/CredentialsViewViewModel.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,105 @@ | ||
using System; | ||
using EngineDoctor; | ||
using FluentAvalonia.UI.Controls; | ||
|
||
namespace AvaloniaMisterDoctor.ViewModels; | ||
|
||
public class CredentialsViewViewModel : ViewModelBase | ||
{ | ||
private readonly ContentDialog dialog; | ||
|
||
public CredentialsViewViewModel(ContentDialog dialog) | ||
{ | ||
if (dialog is null) | ||
{ | ||
throw new ArgumentNullException(nameof(dialog)); | ||
} | ||
|
||
this.dialog = dialog; | ||
dialog.Closed += DialogOnClosed; | ||
} | ||
private void DialogOnClosed(ContentDialog sender, ContentDialogClosedEventArgs args) | ||
{ | ||
dialog.Closed -= DialogOnClosed; | ||
|
||
if (!Engine.IsConnected) return; | ||
|
||
var resultHint = new ContentDialog | ||
{ | ||
Content = $"Successfully connected the Twitch Bot", | ||
Title = "Connected", | ||
PrimaryButtonText = "Awesome" | ||
}; | ||
|
||
_ = resultHint.ShowAsync(); | ||
|
||
} | ||
|
||
private string _username; | ||
|
||
/// <summary> | ||
/// Gets or sets the user input to check | ||
/// </summary> | ||
public string Username | ||
{ | ||
get => _username; | ||
set | ||
{ | ||
if (RaiseAndSetIfChanged(ref _username, value)) | ||
{ | ||
//HandleUserInput(); | ||
} | ||
} | ||
} | ||
|
||
private string _oauthToken; | ||
|
||
/// <summary> | ||
/// Gets or sets the user input to check | ||
/// </summary> | ||
public string OAuthToken | ||
{ | ||
get => _oauthToken; | ||
set | ||
{ | ||
if (RaiseAndSetIfChanged(ref _oauthToken, value)) | ||
{ | ||
//HandleUserInput(); | ||
} | ||
} | ||
} | ||
|
||
private string _channelName; | ||
|
||
/// <summary> | ||
/// Gets or sets the user input to check | ||
/// </summary> | ||
public string ChannelName | ||
{ | ||
get => _channelName; | ||
set | ||
{ | ||
if (RaiseAndSetIfChanged(ref _channelName, value)) | ||
{ | ||
//HandleUserInput(); | ||
} | ||
} | ||
} | ||
|
||
private string _botClientId; | ||
|
||
/// <summary> | ||
/// Gets or sets the user input to check | ||
/// </summary> | ||
public string BotClientId | ||
{ | ||
get => _botClientId; | ||
set | ||
{ | ||
if (RaiseAndSetIfChanged(ref _botClientId, value)) | ||
{ | ||
//HandleUserInput(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.