//Constructor public Maps(string MapsPath) { InitializeComponent(); //Load Map Data & Binding MyMap = new MapPointViewModel(MapsPath, SystemParameters.PrimaryScreenWidth); DataContext = MyMap; //Set Canvas Size Cnv_Map.Width = System.Windows.SystemParameters.PrimaryScreenWidth; Cnv_Map.Height = System.Windows.SystemParameters.PrimaryScreenHeight; //Set List Size Lbx_Points.Height = System.Windows.SystemParameters.PrimaryScreenHeight - 280; //Load Skins Obj Cnv_Map.Background = ImgManger.LoadImageFromFile(GlobalVar.ImgBackground_A, ConfigVariable.UserSkin); this.Btn_Close.Source = ImgManger.LoadImageFromFile(ConfigVariable.UserSkin + GlobalVar.ImgClose); //Calc Aspecratio double AratCanvas = Cnv_Map.Width / Cnv_Map.Height; //Set Image Properties if (AratCanvas > MyMap.Aspectratio) { BorderImg.Height = Cnv_Map.Height; BorderImg.Width = BorderImg.Height * MyMap.Aspectratio; } else { BorderImg.Width = Cnv_Map.Width; BorderImg.Height = BorderImg.Width / MyMap.Aspectratio; } if (MyMap.ExistInfo) //If there are Points Information in the Map { InfoLabel = GUIMgr.CreateTextWithBorder("", "Calibri", 20); GridImg.Children.Add(InfoLabel); //Set Timer for List Close system ListTimer = new DispatcherTimer(); ListTimer.Interval = TimeSpan.FromSeconds(50); ListTimer.Tick += ListAnimation; ListTimer.Start(); } //Start Timer TimeOut CreateTimer(); //Timer for Help Msg TimeCloseInf = new DispatcherTimer(); TimeCloseInf.Interval = TimeSpan.FromSeconds(20); TimeCloseInf.Tick += Cbk_CloseMsg; }
/// <summary> /// Create Label in format (Text with border) /// </summary> public static OutlinedTextBlock CreateTextWithBorder(string Text, string Font, int Size) { OutlinedTextBlock InfoLabel = new OutlinedTextBlock(); InfoLabel.FontFamily = new System.Windows.Media.FontFamily(Font); InfoLabel.FontSize = Size; InfoLabel.FontWeight = FontWeights.Bold; InfoLabel.StrokeThickness = 0.3; InfoLabel.Stroke = new SolidColorBrush(Colors.White); InfoLabel.Fill = new SolidColorBrush(Colors.Black); InfoLabel.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; InfoLabel.VerticalAlignment = System.Windows.VerticalAlignment.Top; InfoLabel.Width = 300; InfoLabel.Height = 30; InfoLabel.TextWrapping = TextWrapping.Wrap; InfoLabel.Margin = new Thickness(10, 40, 0, 0); InfoLabel.Text = Text; return InfoLabel; }