-
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.
- Loading branch information
Showing
7 changed files
with
104 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Page | ||
x:Class="Exo.Settings.Ui.ImagesPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Exo.Settings.Ui" | ||
xmlns:lconverters="using:Exo.Settings.Ui.Converters" | ||
xmlns:vm="using:Exo.Settings.Ui.ViewModels" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DataContext="{d:DesignInstance vm:SettingsViewModel, IsDesignTimeCreatable=False}"> | ||
|
||
<Grid> | ||
<ItemsView ItemsSource="{Binding Images.Images}"> | ||
<ItemsView.ItemTemplate> | ||
<DataTemplate x:DataType="vm:ImageViewModel"> | ||
<ItemContainer AutomationProperties.Name="{Binding Name}"> | ||
<TextBox Text="{Binding Name}" /> | ||
</ItemContainer> | ||
</DataTemplate> | ||
</ItemsView.ItemTemplate> | ||
<ItemsView.Layout> | ||
<UniformGridLayout /> | ||
</ItemsView.Layout> | ||
</ItemsView> | ||
</Grid> | ||
</Page> |
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,17 @@ | ||
using Exo.Settings.Ui.ViewModels; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Exo.Settings.Ui; | ||
|
||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public sealed partial class ImagesPage : Page | ||
{ | ||
public ImagesPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private SettingsViewModel ViewModel => (SettingsViewModel)DataContext; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Collections.ObjectModel; | ||
using Exo.Ui; | ||
|
||
namespace Exo.Settings.Ui.ViewModels; | ||
|
||
internal sealed class ImagesViewModel : BindableObject | ||
{ | ||
private readonly ObservableCollection<ImageViewModel> _images; | ||
private readonly ReadOnlyObservableCollection<ImageViewModel> _readOnlyImages; | ||
|
||
public ImagesViewModel() | ||
{ | ||
_images = new(); | ||
_readOnlyImages = new(_images); | ||
} | ||
|
||
public ReadOnlyObservableCollection<ImageViewModel> Images => _readOnlyImages; | ||
|
||
protected void UploadImage() { } | ||
} | ||
|
||
internal sealed partial class ImageViewModel : ApplicableResettableBindableObject | ||
{ | ||
private string _name; | ||
|
||
public override bool IsChanged => false; | ||
|
||
public ImageViewModel(string name) | ||
{ | ||
_name = name; | ||
} | ||
|
||
public string Name | ||
{ | ||
get => _name; | ||
set => SetValue(ref _name, value); | ||
} | ||
|
||
protected override Task ApplyChangesAsync(CancellationToken cancellationToken) => throw new NotImplementedException(); | ||
protected override void Reset() => throw new NotImplementedException(); | ||
|
||
} |
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