-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support stacked content and answer options in question play
- Loading branch information
1 parent
bc8f27e
commit 1e40455
Showing
6 changed files
with
212 additions
and
92 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/Play/AnswerOptionViewModel.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,36 @@ | ||
using SIEngine.Core; | ||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace SIQuester.ViewModel.Workspaces.Dialogs.Play; | ||
|
||
/// <summary> | ||
/// Defines answer option view model. | ||
/// </summary> | ||
/// <param name="Label">Option label.</param> | ||
/// <param name="Content">Option content.</param> | ||
public sealed record AnswerOptionViewModel(string Label, ContentInfo Content) : INotifyPropertyChanged | ||
{ | ||
private bool _isSelected; | ||
|
||
/// <summary> | ||
/// Is option selected. | ||
/// </summary> | ||
public bool IsSelected | ||
{ | ||
get => _isSelected; | ||
set | ||
{ | ||
if (_isSelected != value) | ||
{ | ||
_isSelected = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
public event PropertyChangedEventHandler? PropertyChanged; | ||
|
||
private void OnPropertyChanged([CallerMemberName] string? propertyName = null) => | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} |
8 changes: 8 additions & 0 deletions
8
src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/Play/ContentInfo.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,8 @@ | ||
namespace SIQuester.ViewModel.Workspaces.Dialogs.Play; | ||
|
||
/// <summary> | ||
/// Defines content info. | ||
/// </summary> | ||
/// <param name="Type">Content type.</param> | ||
/// <param name="Value">Content value.</param> | ||
public sealed record ContentInfo(ContentType Type, string Value); |
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
Oops, something went wrong.