Ejemplo n.º 1
0
 public ShiftWindow()
 {
     // Load language
     if (Depot.Language != null && Depot.Language != "")
     {
         try
         {
             ResourceDictionary lang = (ResourceDictionary)Application.LoadComponent(new Uri(@"assets/lang/" + Depot.Language + ".xaml", UriKind.Relative));
             if (Resources.MergedDictionaries.Count > 0)
             {
                 Resources.MergedDictionaries.Clear();
             }
             Resources.MergedDictionaries.Add(lang);
         }
         catch { }
     }
     // Initialize component
     InitializeComponent();
     // Set properties for controls
     RenderOptions.SetBitmapScalingMode(imgMode, BitmapScalingMode.HighQuality);
     RenderOptions.SetBitmapScalingMode(stg1, BitmapScalingMode.HighQuality);
     RenderOptions.SetBitmapScalingMode(stg2, BitmapScalingMode.HighQuality);
     // Add handler for global member
     Depot.LanguageChanged += new LanguageChangedEventHandler(LanguageChanged);
     // Prepare weapon window
     weaponWindow = new WeaponWindow();
     weaponWindow.KeepAliveWindow = this;
     weaponWindow.Opacity         = 0;
     weaponWindow.Visibility      = Visibility.Hidden;
     // Rotate loading
     ((Storyboard)FindResource("image_rotate")).Begin(imgLoading);
 }