1.写了一个简单的换肤功能,暂时先记下,留着以后进行扩展。 界面定义
View Code
后台界面
View Code using System;
using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows;
using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes;
namespace WpfApplication6 {
public partial class Window1 : Window {
public Window1()
{
InitializeComponent(); }
private void Button_Click(object sender, RoutedEventArgs e) {
Application.Current.Resources.MergedDictionaries[0] = new ResourceDictionary() { Source = new Uri(\"RedCorlor.xaml\", UriKind.Relative) }; }
private void Button_Click_1(object sender, RoutedEventArgs e) {
Application.Current.Resources.MergedDictionaries[0] = new ResourceDictionary() { Source = new Uri(\"GreenCorlor.xaml\", UriKind.Relative) }; } } }
RedCorlor.xaml
View Code
GreenCorlor.xaml
View Code
APP.XAML
View Code
其实这个方法,不是特别好。是我随便写的。也不知道 WPF最佳换肤应该怎么来写。希望能给予建议和支持。
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- yrrf.cn 版权所有 赣ICP备2024042794号-2
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务