mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Consolidate NotifyPropertyChanged ViewModels
This commit is contained in:
parent
eeeb33fed2
commit
77725ea5d7
@ -9,11 +9,8 @@ using Bloxstrap.Extensions;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Bootstrapper
|
namespace Bloxstrap.UI.ViewModels.Bootstrapper
|
||||||
{
|
{
|
||||||
public class BootstrapperDialogViewModel : INotifyPropertyChanged
|
public class BootstrapperDialogViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
|
|
||||||
private readonly IBootstrapperDialog _dialog;
|
private readonly IBootstrapperDialog _dialog;
|
||||||
|
|
||||||
public ICommand CancelInstallCommand => new RelayCommand(CancelInstall);
|
public ICommand CancelInstallCommand => new RelayCommand(CancelInstall);
|
||||||
|
@ -8,7 +8,7 @@ using System.Windows.Media.Imaging;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Bootstrapper
|
namespace Bloxstrap.UI.ViewModels.Bootstrapper
|
||||||
{
|
{
|
||||||
public class ByfronDialogViewModel : BootstrapperDialogViewModel, INotifyPropertyChanged
|
public class ByfronDialogViewModel : BootstrapperDialogViewModel
|
||||||
{
|
{
|
||||||
// Using dark theme for default values.
|
// Using dark theme for default values.
|
||||||
public ImageSource ByfronLogoLocation { get; set; } = new BitmapImage(new Uri("pack://application:,,,/Resources/BootstrapperStyles/ByfronDialog/ByfronLogoDark.jpg"));
|
public ImageSource ByfronLogoLocation { get; set; } = new BitmapImage(new Uri("pack://application:,,,/Resources/BootstrapperStyles/ByfronDialog/ByfronLogoDark.jpg"));
|
||||||
|
@ -15,11 +15,8 @@ using Bloxstrap.UI.Menu;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Menu
|
namespace Bloxstrap.UI.ViewModels.Menu
|
||||||
{
|
{
|
||||||
public class AppearanceViewModel : INotifyPropertyChanged
|
public class AppearanceViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
|
|
||||||
private readonly Page _page;
|
private readonly Page _page;
|
||||||
|
|
||||||
public ICommand PreviewBootstrapperCommand => new RelayCommand(PreviewBootstrapper);
|
public ICommand PreviewBootstrapperCommand => new RelayCommand(PreviewBootstrapper);
|
||||||
|
@ -12,11 +12,8 @@ using Bloxstrap.Models;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Menu
|
namespace Bloxstrap.UI.ViewModels.Menu
|
||||||
{
|
{
|
||||||
public class BehaviourViewModel : INotifyPropertyChanged
|
public class BehaviourViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
|
|
||||||
private bool _manualChannelEntry = !RobloxDeployment.SelectableChannels.Contains(App.Settings.Prop.Channel);
|
private bool _manualChannelEntry = !RobloxDeployment.SelectableChannels.Contains(App.Settings.Prop.Channel);
|
||||||
|
|
||||||
public BehaviourViewModel()
|
public BehaviourViewModel()
|
||||||
|
@ -10,11 +10,8 @@ using CommunityToolkit.Mvvm.Input;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Menu
|
namespace Bloxstrap.UI.ViewModels.Menu
|
||||||
{
|
{
|
||||||
public class FastFlagsViewModel : INotifyPropertyChanged
|
public class FastFlagsViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
|
|
||||||
public ICommand OpenClientSettingsCommand => new RelayCommand(OpenClientSettings);
|
public ICommand OpenClientSettingsCommand => new RelayCommand(OpenClientSettings);
|
||||||
|
|
||||||
private void OpenClientSettings() => Utilities.ShellExecute(Path.Combine(Directories.Modifications, "ClientSettings\\ClientAppSettings.json"));
|
private void OpenClientSettings() => Utilities.ShellExecute(Path.Combine(Directories.Modifications, "ClientSettings\\ClientAppSettings.json"));
|
||||||
|
@ -6,11 +6,8 @@ using CommunityToolkit.Mvvm.Input;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Menu
|
namespace Bloxstrap.UI.ViewModels.Menu
|
||||||
{
|
{
|
||||||
public class InstallationViewModel : INotifyPropertyChanged
|
public class InstallationViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
|
|
||||||
private string _originalInstallLocation = App.BaseDirectory;
|
private string _originalInstallLocation = App.BaseDirectory;
|
||||||
|
|
||||||
public ICommand BrowseInstallLocationCommand => new RelayCommand(BrowseInstallLocation);
|
public ICommand BrowseInstallLocationCommand => new RelayCommand(BrowseInstallLocation);
|
||||||
|
@ -8,11 +8,8 @@ using Bloxstrap.Models;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Menu
|
namespace Bloxstrap.UI.ViewModels.Menu
|
||||||
{
|
{
|
||||||
public class IntegrationsViewModel : INotifyPropertyChanged
|
public class IntegrationsViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
|
|
||||||
public ICommand AddIntegrationCommand => new RelayCommand(AddIntegration);
|
public ICommand AddIntegrationCommand => new RelayCommand(AddIntegration);
|
||||||
public ICommand DeleteIntegrationCommand => new RelayCommand(DeleteIntegration);
|
public ICommand DeleteIntegrationCommand => new RelayCommand(DeleteIntegration);
|
||||||
|
|
||||||
|
@ -16,11 +16,8 @@ using Bloxstrap.UI.Menu.Pages;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Menu
|
namespace Bloxstrap.UI.ViewModels.Menu
|
||||||
{
|
{
|
||||||
public class MainWindowViewModel : INotifyPropertyChanged
|
public class MainWindowViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
|
|
||||||
private readonly Window _window;
|
private readonly Window _window;
|
||||||
private readonly IDialogService _dialogService;
|
private readonly IDialogService _dialogService;
|
||||||
private readonly string _originalBaseDirectory = App.BaseDirectory; // we need this to check if the basedirectory changes
|
private readonly string _originalBaseDirectory = App.BaseDirectory; // we need this to check if the basedirectory changes
|
||||||
|
@ -15,11 +15,8 @@ using CommunityToolkit.Mvvm.Input;
|
|||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Menu
|
namespace Bloxstrap.UI.ViewModels.Menu
|
||||||
{
|
{
|
||||||
public class ModsViewModel : INotifyPropertyChanged
|
public class ModsViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
|
|
||||||
private void OpenModsFolder() => Process.Start("explorer.exe", Directories.Modifications);
|
private void OpenModsFolder() => Process.Start("explorer.exe", Directories.Modifications);
|
||||||
|
|
||||||
private string _customFontLocation = Path.Combine(Directories.Modifications, "content\\fonts\\CustomFont.ttf");
|
private string _customFontLocation = Path.Combine(Directories.Modifications, "content\\fonts\\CustomFont.ttf");
|
||||||
|
15
Bloxstrap/UI/ViewModels/NotifyPropertyChangedViewModel.cs
Normal file
15
Bloxstrap/UI/ViewModels/NotifyPropertyChangedViewModel.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Bloxstrap.UI.ViewModels
|
||||||
|
{
|
||||||
|
public class NotifyPropertyChangedViewModel : INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
|
public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user