-
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.
✨ UI: Add the built-in graphics switch for embedded monitors.
NExt step will be to implement the configuration within the service.
- Loading branch information
Showing
11 changed files
with
272 additions
and
47 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
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
12 changes: 12 additions & 0 deletions
12
src/Exo/Ui/Exo.Contracts.Ui.Settings/EmbeddedMonitorGraphicsDescription.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,12 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Exo.Contracts.Ui.Settings; | ||
|
||
[DataContract] | ||
public readonly struct EmbeddedMonitorGraphicsDescription | ||
{ | ||
[DataMember(Order = 1)] | ||
public Guid GraphicsId { get; init; } | ||
[DataMember(Order = 2)] | ||
public Guid NameStringId { get; init; } | ||
} |
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
19 changes: 19 additions & 0 deletions
19
...i/Exo.Settings.Ui/DataTemplateSelectors/EmbeddedMonitorGraphicsSettingTemplateSelector.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,19 @@ | ||
using Exo.Settings.Ui.ViewModels; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Exo.Settings.Ui.DataTemplateSelectors; | ||
|
||
internal sealed class EmbeddedMonitorGraphicsSettingTemplateSelector : DataTemplateSelector | ||
{ | ||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. | ||
public DataTemplate ImageTemplate { get; set; } | ||
public DataTemplate BuiltInTemplate { get; set; } | ||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. | ||
|
||
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container) | ||
=> SelectTemplateCore(item); | ||
|
||
protected override DataTemplate SelectTemplateCore(object item) | ||
=> item is EmbeddedMonitorImageGraphicsViewModel s ? ImageTemplate : BuiltInTemplate; | ||
} |
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
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.