-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor updates to settings app. Nothing yet complete.
- Loading branch information
1 parent
c7ddc7e
commit 305dcd1
Showing
13 changed files
with
298 additions
and
35 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
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
31 changes: 31 additions & 0 deletions
31
...user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/BooleanToFluentCheckConverter.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,31 @@ | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Data; | ||
|
||
namespace Microsoft.Midi.Settings.Helpers; | ||
|
||
public partial class BooleanToFluentCheckConverter : IValueConverter | ||
{ | ||
public BooleanToFluentCheckConverter() | ||
{ | ||
} | ||
|
||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
if (value is bool val) | ||
{ | ||
if (val) | ||
{ | ||
return "\uf16c"; | ||
} | ||
|
||
return "\uf16b"; | ||
} | ||
|
||
throw new ArgumentException("BooleanToFluentCheckConverter object must be a bool"); | ||
} | ||
|
||
public object? ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
return null; | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...ools/midi-settings/Microsoft.Midi.Settings/Sections/Endpoints/DIAG/EndpointsDiagPage.xaml
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,65 @@ | ||
<Page | ||
x:Class="Microsoft.Midi.Settings.Views.EndpointsDiagPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:views="using:Microsoft.Midi.Settings.Views" | ||
xmlns:local="using:Microsoft.Midi.Settings.ViewModels" | ||
xmlns:midi2="using:Microsoft.Windows.Devices.Midi2" | ||
xmlns:helpers="using:Microsoft.Midi.Settings.Helpers" | ||
xmlns:controls="using:CommunityToolkit.WinUI.Controls" | ||
xmlns:midicontrols="using:Microsoft.Midi.Settings.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
> | ||
|
||
<Page.Resources> | ||
<ResourceDictionary> | ||
<helpers:HasUniqueIdToVisibilityConverter x:Key="HasUniqueIdToVisibilityConverter" /> | ||
<helpers:HasUniqueIdToInverseVisibilityConverter x:Key="HasUniqueIdToInverseVisibilityConverter" /> | ||
<helpers:MidiEndpointNativeDataFormatConverter x:Key="MidiEndpointNativeDataFormatConverter" /> | ||
<helpers:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> | ||
<helpers:BooleanToEmojiCheckConverter x:Key="BooleanToEmojiCheckConverter" /> | ||
</ResourceDictionary> | ||
</Page.Resources> | ||
|
||
<Grid x:Name="ContentArea"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
|
||
<TextBlock Grid.Row="0" x:Uid="DevicesPage_Description" Margin="0,0,0,8" /> | ||
|
||
<ScrollViewer Grid.Row="1"> | ||
<StackPanel Margin="0,0,8,0" HorizontalAlignment="Stretch"> | ||
|
||
<!-- Transport --> | ||
|
||
|
||
<!-- If this transport supports runtime creation, have create button at this level --> | ||
|
||
|
||
<TextBlock Text="{x:Bind ViewModel.Transport.Name, Mode=OneWay}" Style="{StaticResource SmallEmphasizedPropertyValue}"/> | ||
<TextBlock Text="{x:Bind ViewModel.Transport.Description, Mode=OneWay}" Style="{StaticResource SmallPlainPropertyValue}"/> | ||
|
||
|
||
<ItemsControl ItemsSource="{x:Bind ViewModel.MidiEndpointDevices}"> | ||
<ItemsControl.ItemTemplate> | ||
<DataTemplate x:DataType="local:MidiEndpointDeviceListItem"> | ||
<midicontrols:MidiEndpointDeviceListItemControl EndpointItem="{x:Bind}" | ||
Loaded="MidiEndpointDeviceListItemControl_Loaded" | ||
Margin="3"/> | ||
</DataTemplate> | ||
|
||
</ItemsControl.ItemTemplate> | ||
|
||
</ItemsControl> | ||
|
||
</StackPanel> | ||
|
||
</ScrollViewer> | ||
|
||
</Grid> | ||
|
||
</Page> |
63 changes: 63 additions & 0 deletions
63
...s/midi-settings/Microsoft.Midi.Settings/Sections/Endpoints/DIAG/EndpointsDiagPage.xaml.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,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Input; | ||
using Microsoft.UI.Xaml.Media; | ||
using Microsoft.UI.Xaml.Navigation; | ||
using Microsoft.Midi.Settings.Contracts.Services; | ||
using Microsoft.Midi.Settings.Controls; | ||
using Microsoft.Midi.Settings.ViewModels; | ||
|
||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
namespace Microsoft.Midi.Settings.Views | ||
{ | ||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public sealed partial class EndpointsDiagPage : Page | ||
{ | ||
private ILoggingService _loggingService; | ||
|
||
|
||
public EndpointsDiagViewModel ViewModel | ||
{ | ||
get; | ||
} | ||
|
||
|
||
public EndpointsDiagPage() | ||
{ | ||
ViewModel = App.GetService<EndpointsDiagViewModel>(); | ||
_loggingService = App.GetService<ILoggingService>(); | ||
|
||
Loaded += DevicesPage_Loaded; | ||
|
||
InitializeComponent(); | ||
} | ||
|
||
private void DevicesPage_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
ViewModel.DispatcherQueue = this.DispatcherQueue; | ||
|
||
ViewModel.RefreshDeviceCollection(); | ||
} | ||
|
||
|
||
// work around WinUI binding bug | ||
private void MidiEndpointDeviceListItemControl_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
((MidiEndpointDeviceListItemControl)sender).ViewDeviceDetailsCommand = ViewModel.ViewDeviceDetailsCommand; | ||
} | ||
} | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
...s/midi-settings/Microsoft.Midi.Settings/Sections/Endpoints/DIAG/EndpointsDiagViewModel.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,25 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.Mvvm.Input; | ||
using Microsoft.Midi.Settings.Contracts.Services; | ||
using Microsoft.Midi.Settings.Contracts.ViewModels; | ||
using Microsoft.Midi.Settings.Models; | ||
using Microsoft.Midi.Settings.Services; | ||
using Microsoft.UI.Dispatching; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Input; | ||
|
||
namespace Microsoft.Midi.Settings.ViewModels | ||
{ | ||
public partial class EndpointsDiagViewModel : SingleTransportEndpointViewModelBase, INavigationAware | ||
{ | ||
public EndpointsDiagViewModel(INavigationService navigationService) : base("DIAG", navigationService) | ||
{ | ||
} | ||
|
||
} | ||
} |
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.