private void ResetMap() { this.roomDisplay.Text = ""; funkyKids.Children.Clear(); var t = getTransform(funky); t.CenterX = 0; t.CenterY = 0; t.ScaleX = 0.2; t.ScaleY = 0.2; t.TranslateX = 0; t.TranslateY = 0; map = null; }
private async Task<object> ShowMap(RoomInfo location) { if (location == null) return null; string svgDocContent = await CloudAccesser.LoadMapSvg(location, Waiter); UpdateLoginLogoutUI(); if (svgDocContent == null) return null; ResetMap(); this.roomDisplay.Text = location.ToString(); roomDisplay.Visibility = Visibility.Visible; ContentPanel.Visibility = Visibility.Collapsed; funky.Visibility = Visibility.Visible; Foo.Visibility = Visibility.Visible; funkyKids.Children.Clear(); var f = this.funky; var fk = this.funkyKids; var resources = this.Resources; var textRotation = (CompositeTransform)this.Resources["antiRotation"]; var dispatcher = this.Dispatcher; var tcs = new TaskCompletionSource<object>(); System.Threading.Thread t = new System.Threading.Thread(() => { map = new XamlMapInfo(location, svgDocContent); map.Render(f, fk, Foo, textRotation, (x) => dispatcher.BeginInvoke(x), location); tcs.SetResult(null); }); t.Start(); return tcs.Task; }
private async Task ShowMap(RoomInfo location, GeoCoord? loc = null) { if (location == null) return; string content = await CloudAccesser.LoadMapSvg(location, Waiter); MapMetadata mapMetadata = await CloudAccesser.LoadMapMetadata(location); #if NETFX_CORE || WINDOWS_PHONE UpdateLoginLogoutUI(); #endif if (content == null) return; this.roomDisplay.Text = ""; view.ResetMap(); this.roomDisplay.Text = location.ToString(); roomDisplay.Visibility = Visibility.Visible; ContentPanel.Visibility = Visibility.Collapsed; view.Visibility = Visibility.Visible; overlay.Visibility = Visibility.Visible; var resources = this.Resources; var dispatcher = this.Dispatcher; var map = new XamlMapInfo(location, content, mapScaleFactor); this.view.MapMetadata = mapMetadata; await map.Render(view.LiveChildCollection, view.TextRotation, (a, b, c) => { this.view.SetViewForMap(a, b, c); if (loc.HasValue) { view.ShowScanLoc(loc.Value); } }, RunOnUIThread, location, overlay); }