feat: Refactor project structure and add core library
- Migrate shared components from WPF to a new Core library. - Introduce GroupInfo, M3UInfo, and ObservableViewModelBase classes. - Implement M3UParser for downloading and parsing M3U files. - Add ProgramsData for managing program lists and guides. - Create SettingsModel for application settings management. - Update project references in solution files.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace TV_Player
|
||||
{
|
||||
public abstract class ObservableViewModelBase : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected void RaisePropertyChanged(string propertyName)
|
||||
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
|
||||
/// <summary>
|
||||
/// Set a property and raise a property changed event if it has changed
|
||||
/// </summary>
|
||||
protected bool SetProperty<T>(ref T property, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(property, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
property = value;
|
||||
RaisePropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user