public void GetWindowBackgroundConfig() { string thememode = AyWindowShellConfigSetting.GetXmlValue("themeMode"); var bgFolder = AyWindowShellConfigSetting.GetXmlValue("bgFolder", "value");//图片文件夹 if (thememode == "img") { var path = AyWindowShellConfigSetting.GetXmlValue("skinBg", "value"); if (path.IndexOf(":") < 0) { path = System.IO.Path.Combine(bgFolder, path); } p = new AyTransitionPicture(path); p.Radius = CornerRadius.TopLeft; p.StrokeThickness = BorderThickness.Top; p.Stroke = BorderBrush; this.BgData = p; ReLoadImageBmp(path); } else if (thememode == "color") { var path = AyWindowShellConfigSetting.GetXmlValue("skinColorBg", "value"); p = new AyTransitionColor(path); p.Radius = CornerRadius.TopLeft; p.StrokeThickness = BorderThickness.Top; p.Stroke = BorderBrush; this.BgData = p; } }
private void SetSource(string source) { if (source.IndexOf(":") < 0) { source = System.IO.Directory.GetCurrentDirectory() + source; } if (source.IndexOf("#") > -1) { p = new AyTransitionColor(source); p.Radius = CornerRadius.TopLeft; p.StrokeThickness = BorderThickness.Top; p.Stroke = BorderBrush; this.BgData = p; } else { p = new AyTransitionPicture(source); p.Radius = CornerRadius.TopLeft; p.StrokeThickness = BorderThickness.Top; p.Stroke = BorderBrush; this.BgData = p; ReLoadImageBmp(source); } }