Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup/prepare xaml pages for additional changes #3910

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<converters:DoubleToVisibilityConverter x:Key="CountToVisibilityConverter" GreaterThan="0" FalseValue="Visible" TrueValue="Collapsed" />
</Page.Resources>

<ScrollViewer VerticalAlignment="Top" VerticalScrollBarVisibility="Auto">
<ScrollViewer
VerticalAlignment="Top">
<Grid MaxWidth="{ThemeResource MaxPageContentWidth}" Margin="{ThemeResource ContentPageMargin}">
<StackPanel>
<ItemsRepeater ItemsSource="{x:Bind ViewModel.ExperimentalFeatures}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ public void Initialize(StackedNotificationsBehavior notificationQueue)
_notificationsHelper = new(notificationQueue);
}

[RelayCommand]
private async Task OnLoadedAsync()
{
await LoadModelAsync();
}

[RelayCommand]
public async Task SyncButton()
{
Expand Down
25 changes: 19 additions & 6 deletions tools/Environments/DevHome.Environments/Views/LandingPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
xmlns:winUIBehaviors="using:CommunityToolkit.WinUI.Behaviors"
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
xmlns:views="using:DevHome.Common.Views"
behaviors:NavigationViewHeaderBehavior.HeaderMode="Never"
Loaded="OnLoaded">
behaviors:NavigationViewHeaderBehavior.HeaderMode="Never">

<commonviews:ToolPage.Resources>
<ResourceDictionary Source="ms-appx:///DevHome.Common/Environments/Templates/EnvironmentsTemplates.xaml" />
</commonviews:ToolPage.Resources>

<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="Loaded">
<ic:InvokeCommandAction Command="{x:Bind ViewModel.LoadedCommand}" />
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
Expand All @@ -31,7 +37,6 @@
<!-- Adding unshared resources/templates here-->
<Grid.Resources>

<converters:EmptyCollectionToObjectConverter x:Key="EmptyCollectionVisibilityConverter" EmptyValue="Collapsed" NotEmptyValue="Visible"/>
<converters:BoolToVisibilityConverter x:Key="NegatedBoolToVisibilityConverter" TrueValue="Collapsed" FalseValue="Visible" />

<!-- Launch Button template -->
Expand Down Expand Up @@ -196,7 +201,8 @@
</Grid>
</DataTemplate>

<selectors:CardItemTemplateSelector x:Key="CardItemTemplateSelector"
<selectors:CardItemTemplateSelector
x:Key="CardItemTemplateSelector"
ComputeSystemTemplate="{StaticResource ComputeSystemTemplate}"
CreateComputeSystemOperationTemplate="{StaticResource CreateComputeSystemOperationTemplate}"/>

Expand Down Expand Up @@ -235,7 +241,13 @@
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<!-- Search field -->
<AutoSuggestBox Grid.Column="0" x:Uid="SearchTextBox" x:Name="SearchTextBox" Width="230" HorizontalAlignment="Left" VerticalAlignment="Center">
<AutoSuggestBox
Grid.Column="0"
x:Uid="SearchTextBox"
x:Name="SearchTextBox"
Width="230"
HorizontalAlignment="Left"
VerticalAlignment="Center">
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="TextChanged">
<ic:InvokeCommandAction
Expand Down Expand Up @@ -305,7 +317,8 @@
</Grid>

<!-- Per VM/Compute System card -->
<ScrollViewer Grid.Row="3" Style="{StaticResource EnvironmentScrollViewerStyle}" MaxWidth="{ThemeResource MaxPageContentWidth}" Margin="{ThemeResource ContentPageMargin}">
<ScrollViewer Grid.Row="3" Style="{StaticResource EnvironmentScrollViewerStyle}"
MaxWidth="{ThemeResource MaxPageContentWidth}" Margin="{ThemeResource ContentPageMargin}">
<Grid>
<StackPanel>
<ListView
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Threading.Tasks;
using CommunityToolkit.Mvvm.Input;
using DevHome.Common.Extensions;
using DevHome.Common.Views;
using DevHome.Environments.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace DevHome.Environments.Views;

Expand All @@ -21,9 +18,4 @@ public LandingPage()
InitializeComponent();
ViewModel.Initialize(NotificationQueue);
}

private async void OnLoaded(object sender, RoutedEventArgs e)
{
await ViewModel.LoadModelAsync();
}
}
Loading
Loading