White window C# visual 2019 and sdk 100.7

445
3
02-18-2020 07:44 AM
CavronJeremy
New Contributor III

Hi. I work with Visual Studio 2019.  I have installed ArcGIS sdk to .NET and WPF. I mount references ArcGIS in my C# WPF Desktop project. I write map code. But when I execute my program, I have a white window with "powered ArcGIS" text on Bottom. But I Don't have map.

 

If I make GIS project is ok. But I would like create a WFP desktop project.

 

Have you got solution?

 

thank

0 Kudos
3 Replies
JoeHershman
MVP Regular Contributor

Could you post or attach the rest of the code.  What is shown is not enough to determine the problem.

Thanks,
-Joe
0 Kudos
CavronJeremy
New Contributor III

Hi and thank you for your help.

I've solved my problem. It was my firewall that was blocking the map from loading.

On the other hand I want to load a local map. a tpk file. But I have a blank page and no error messages with WPF project with C#.

in my cs file :

Map map = new Map();

Uri uri = new Uri(@"My_Absolute_tpk_file_path");

ArcGISTiledLayer tilLayer = new ArcGISTiledLayer(uri);

map.Basemap.BaseLayers.Add(tilLayer);

MyMapView.Map = map;

in my XAML file

 <esri:MapView x:Name="MyMapView">
            <esri:Map/>
        </esri:MapView>

I'm with Visual Studio 2019 and ArcGIS Runtime 100.7 Thank

0 Kudos
CavronJeremy
New Contributor III

Problem is solved. It was my tpk file who was protected.

I post code to load tpk file in WPF project

 TileCache cache = new TileCache("absolute_tpk_file_path");
// Use the tile cache to create an ArcGISTiledLayer.
ArcGISTiledLayer tiledLayer = new ArcGISTiledLayer(cache);
// Display the tiled layer as a basemap.
MyMapView.Map = new Map(new Basemap(tiledLayer));

thank. subject solved

0 Kudos