-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multi user extension login for setup environment and create envir…
…onment flows (#3907) * Fix multi user login for setup target and create environment flows * update based on comments. Removes Add/Remove event handlers and instead used the weak event listener
- Loading branch information
Showing
11 changed files
with
304 additions
and
128 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
57 changes: 57 additions & 0 deletions
57
tools/SetupFlow/DevHome.SetupFlow/Converters/CreationStateKindToVisibilityConverter.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,57 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using DevHome.Common.Environments.Models; | ||
using DevHome.SetupFlow.ViewModels.Environments; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Media; | ||
|
||
namespace DevHome.SetupFlow.Converters; | ||
|
||
/// <summary> | ||
/// Converts the state of the EnvironmentCreationOptions page to a visibility enum. | ||
/// </summary> | ||
public class CreationStateKindToVisibilityConverter : IValueConverter | ||
{ | ||
private const string ProgressRingGridName = "ProgressRingGrid"; | ||
|
||
private const string AdaptiveCardGridName = "AdaptiveCardGrid"; | ||
|
||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
var parameterString = (string)parameter; | ||
var creationStateKind = (CreationPageStateKind)value; | ||
|
||
if (parameterString.Equals(AdaptiveCardGridName, StringComparison.Ordinal)) | ||
{ | ||
return creationStateKind switch | ||
{ | ||
CreationPageStateKind.InitialPageAdaptiveCardLoaded => Visibility.Visible, | ||
_ => Visibility.Collapsed, | ||
}; | ||
} | ||
|
||
if (parameterString.Equals(ProgressRingGridName, StringComparison.Ordinal)) | ||
{ | ||
return creationStateKind switch | ||
{ | ||
CreationPageStateKind.InitialPageAdaptiveCardLoading => Visibility.Visible, | ||
CreationPageStateKind.OtherPageAdaptiveCardLoading => Visibility.Visible, | ||
_ => Visibility.Collapsed, | ||
}; | ||
} | ||
|
||
return Visibility.Collapsed; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
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
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.