From 4e28b086d250f0cca0ae18afe56daa55bb09f7a7 Mon Sep 17 00:00:00 2001 From: timunie Date: Sun, 3 Dec 2023 19:55:25 +0100 Subject: [PATCH] Workaround for TabControl issue upstream --- .../ViewModels/CustomInteractionViewModel.cs | 2 ++ .../ViewModels/InteractionViewModel.cs | 2 ++ .../ViewModels/MainWindowViewModel.cs | 17 ++++++++++---- .../MvvmDialogSample/Views/MainWindow.axaml | 23 +++++++++++++------ 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/CustomInteractionViewModel.cs b/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/CustomInteractionViewModel.cs index 6799568..c7121c1 100644 --- a/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/CustomInteractionViewModel.cs +++ b/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/CustomInteractionViewModel.cs @@ -33,5 +33,7 @@ private async Task SelectFilesAsync() { SelectedFiles = await SelectFilesInteraction.HandleAsync("Hello from Avalonia"); } + + public override string ToString() => "Custom Interaction Sample"; } } diff --git a/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/InteractionViewModel.cs b/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/InteractionViewModel.cs index baf59f7..c2b2adb 100644 --- a/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/InteractionViewModel.cs +++ b/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/InteractionViewModel.cs @@ -43,5 +43,7 @@ private async Task SelectFiles() { SelectedFiles = await _SelectFilesInteraction.Handle("Hello from Avalonia"); } + + public override string ToString() => "ReactiveUI Interaction Sample"; } } diff --git a/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/MainWindowViewModel.cs b/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/MainWindowViewModel.cs index 6139ed7..69ae7ee 100644 --- a/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/MainWindowViewModel.cs +++ b/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/ViewModels/MainWindowViewModel.cs @@ -1,10 +1,17 @@ -namespace MvvmDialogSample.ViewModels +using System; +using System.Collections.Generic; + +namespace MvvmDialogSample.ViewModels { public class MainWindowViewModel : ViewModelBase { - public InteractionViewModel InteractionSample { get; } = new InteractionViewModel(); - - public CustomInteractionViewModel CustomInteractionViewModel { get; } = new CustomInteractionViewModel(); - + /// + /// Gets a list of available tabs + /// + public object[] Samples { get; } = + { + new InteractionViewModel(), + new CustomInteractionViewModel() + }; } } diff --git a/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/Views/MainWindow.axaml b/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/Views/MainWindow.axaml index 43542a8..f56e9f2 100644 --- a/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/Views/MainWindow.axaml +++ b/src/Avalonia.Samples/ViewInteraction/MvvmDialogSample/Views/MainWindow.axaml @@ -4,6 +4,7 @@ xmlns:vm="using:MvvmDialogSample.ViewModels" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:system="clr-namespace:System;assembly=System.Runtime" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="MvvmDialogSample.Views.MainWindow" Icon="/Assets/avalonia-logo.ico" @@ -15,12 +16,20 @@ - - - - - - - + + + + + + + + + + + + + + +