private void OnLoaded(object sender, RoutedEventArgs e) {
if (_loaded) return;
_loaded = true;
AboutHelper.Instance.PropertyChanged += About_PropertyChanged;
UpdateAboutIsNew();
var background = AppArguments.Get(AppFlag.Background);
if (string.IsNullOrWhiteSpace(background)) {
FancyBackgroundManager.Instance.AddListener(this);
} else {
if (background.ElementAt(1) != ':') {
background = System.IO.Path.Combine(FilesStorage.Instance.GetDirectory("Themes", "Backgrounds"), background);
}
var animatedBackground = Regex.IsMatch(background, @"\.(?:avi|flv|gif|m(?:4[pv]|kv|ov|p[4g])|og[vg]|qt|webm|wmv)$", RegexOptions.IgnoreCase) ?
background : null;
var staticBackground = animatedBackground == null ? background : Regex.Replace(background, @"\.\w+$", @".jpg");
BackgroundContent = new Viewbox {
Stretch = Stretch.UniformToFill,
Opacity = AppArguments.GetDouble(AppFlag.BackgroundOpacity, 0.5),
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
Child = new DynamicBackground {
Width = 1280,
Height = 720,
Animated = animatedBackground,
Static = staticBackground
}
};
}
}