diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs index 4aade2297f..3c8e3ea27d 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs @@ -55,7 +55,7 @@ private async Task Initialize() // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "editor01"; string sampleServer7Pass = "S7#i2LWmYH75"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Layers/DisplayFeatureLayers/DisplayFeatureLayers.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Layers/DisplayFeatureLayers/DisplayFeatureLayers.xaml.cs index 054b6736d7..7094ddf37c 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Layers/DisplayFeatureLayers/DisplayFeatureLayers.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Layers/DisplayFeatureLayers/DisplayFeatureLayers.xaml.cs @@ -107,7 +107,7 @@ private async Task SetServiceFeatureTableFeatureLayer() // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "viewer01"; string sampleServer7Pass = "I68VGU^nMurF"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs index fe59965021..48bb24cf08 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs @@ -51,7 +51,7 @@ private async Task Initialize() // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "viewer01"; string sampleServer7Pass = "I68VGU^nMurF"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Scene/FilterFeaturesInScene/FilterFeaturesInScene.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Scene/FilterFeaturesInScene/FilterFeaturesInScene.xaml.cs index cf9194121e..cebb06bc73 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Scene/FilterFeaturesInScene/FilterFeaturesInScene.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Scene/FilterFeaturesInScene/FilterFeaturesInScene.xaml.cs @@ -13,6 +13,7 @@ using Esri.ArcGISRuntime.UI; using Microsoft.UI.Xaml; using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Geometry = Esri.ArcGISRuntime.Geometry.Geometry; @@ -76,11 +77,7 @@ private async Task Initialize() _sceneLayerExtentPolygon = builder.ToGeometry(); // Create the SceneLayerPolygonFilter to later apply to the OSM buildings layer. - _sceneLayerPolygonFilter = new SceneLayerPolygonFilter() - { - SpatialRelationship = SceneLayerPolygonFilterSpatialRelationship.Disjoint - }; - _sceneLayerPolygonFilter.Polygons.Add(builder.ToGeometry()); + _sceneLayerPolygonFilter = new SceneLayerPolygonFilter(new List() { builder.ToGeometry() }, SceneLayerPolygonFilterSpatialRelationship.Disjoint); // Create the extent graphic so we can add it later with the detailed buildings scene layer. var simpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Red, 5.0f); diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs index b94b0cbc78..d04f993a8d 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs @@ -157,11 +157,10 @@ private async void LoginButtonClick(object sender, RoutedEventArgs e) try { // Create a token credential using the provided username and password. - TokenCredential userCredentials = await AuthenticationManager.Current.GenerateCredentialAsync + Credential userCredentials = await AccessTokenCredential.CreateAsync (new Uri(loginEntry.ServiceUrl), loginEntry.UserName, - loginEntry.Password, - loginEntry.RequestInfo.GenerateTokenOptions); + loginEntry.Password); // Set the result on the task completion source. _loginTaskCompletionSource.TrySetResult(userCredentials); diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs index a5bfdf3313..30cd24b3f3 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs @@ -66,7 +66,7 @@ private async Task Initialize() // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "viewer01"; string sampleServer7Pass = "I68VGU^nMurF"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/CreateLoadReport/CreateLoadReport.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/CreateLoadReport/CreateLoadReport.xaml.cs index 5c54704a13..63eabec18b 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/CreateLoadReport/CreateLoadReport.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/CreateLoadReport/CreateLoadReport.xaml.cs @@ -84,7 +84,7 @@ private async Task Initialize() // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "editor01"; string sampleServer7Pass = "S7#i2LWmYH75"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs index 09ee5a22f7..d30eec1402 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs @@ -63,7 +63,7 @@ private async Task Initialize() // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "viewer01"; string sampleServer7Pass = "I68VGU^nMurF"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/DisplayUtilityNetworkContainer/DisplayUtilityNetworkContainer.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/DisplayUtilityNetworkContainer/DisplayUtilityNetworkContainer.xaml.cs index edf34bb7c7..0788503abd 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/DisplayUtilityNetworkContainer/DisplayUtilityNetworkContainer.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/DisplayUtilityNetworkContainer/DisplayUtilityNetworkContainer.xaml.cs @@ -59,7 +59,7 @@ private async Task Initialize() string sampleServer7User = "viewer01"; string sampleServer7Pass = "I68VGU^nMurF"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs index 7f4a3aa0c8..ec92e88e71 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs @@ -72,7 +72,7 @@ private async Task Initialize() string sampleServer7User = "viewer01"; string sampleServer7Pass = "I68VGU^nMurF"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs index a6ab816fee..4314d3c86c 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs @@ -72,7 +72,7 @@ private async Task Initialize() // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "viewer01"; string sampleServer7Pass = "I68VGU^nMurF"; - return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + return await AccessTokenCredential.CreateAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/ValidateUtilityNetworkTopology/ValidateUtilityNetworkTopology.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/ValidateUtilityNetworkTopology/ValidateUtilityNetworkTopology.xaml.cs index e43bd837d5..eb86b23d36 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/ValidateUtilityNetworkTopology/ValidateUtilityNetworkTopology.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/UtilityNetwork/ValidateUtilityNetworkTopology/ValidateUtilityNetworkTopology.xaml.cs @@ -114,9 +114,7 @@ private async Task Initialize() "https://sampleserver7.arcgisonline.com/portal/sharing/rest"; string sampleServer7User = "editor01"; string sampleServer7Pass = "S7#i2LWmYH75"; - var credential = await AuthenticationManager - .Current - .GenerateCredentialAsync( + var credential = await AccessTokenCredential.CreateAsync( new Uri(sampleServerPortalUrl), sampleServer7User, sampleServer7Pass