一个很好的列子:

http://www.codeproject.com/Articles/254506/XAMLFinance-A-Cross-platform-WPF-Silverlight-WP7-A

使用MVVM

The WPF solution has much the same structure as the Silverlight one; however, all of the ViewModel, View and Resource files are included as links, as per the steps described above.

Resolution Techniques

1.Conditional compilation (#if)

  private string ReadFileToString(string filename)
{ #if !SILVERLIGHT using (var stream = this.GetType().Assembly.GetManifestResourceStream(
"SLUGUK.ViewModel." + filename))
{
StreamReader reader = new StreamReader(stream);
string xml = reader.ReadToEnd();
return xml;
} #else string path = "/SilverlightTwitterApp;component/ViewModel/" + filename;
Uri uri = new Uri(path, UriKind.Relative);
StreamResourceInfo sri = Application.GetResourceStream(uri);
StreamReader reader = new StreamReader(sri.Stream);
string xml = reader.ReadToEnd();
return xml; #endif
}

2.Partial classes

3.Design Patterns

使用 适配器模式

对于新的系统,会有多点触控技术。能把任务分解为两个方面的工作,一是同时采集多点信号,二是对每路信号的意义进行判断,也就是所谓的手势识别,从而实现屏幕识别人的五个手指同时做的点击、触控动作。

Sharing Code Between Silverlight and WPF的更多相关文章

  1. Sharing Code Between Silverlight and Win8 app metro

    这里讲得很详细了: Sharing Code between Windows Phone 8 and Windows 8 Applications http://msdn.microsoft.com/ ...

  2. Prism 4 文档 ---第10章 Silverlight和WPF之间共享代码

        本主题帮助你理解来自Prism的多目标和它的优缺点.多目标的代码针对两个不同的平台有大致相同的代码库.这允许同时保持代码尽可能多一样能够产生针对两种不同技术的二进制文件.在这种情况下,本节介绍 ...

  3. Silverlight及WPF中实现自定义BusyIndicator

    在开发Silverlight或者WPF项目时,当我们调用Web服务来加载一些数据时,由于数据量比较大需要较长的时间,需要用户等待,为了给用户友好的提示和避免用户在加载数据过程中进行重复操作,我们通常使 ...

  4. Silverlight或WPF动态绑定图片路径问题,不用Converter完美解决

    关于Silverlight或WPF动态绑定图片路径问题,不用Converter完美解决, 可想,一个固定的字符串MS都能找到,按常理动态绑定也应该没问题的,只需在前面标记它是一个Path类型的值它就能 ...

  5. silverlight,WPF动画终极攻略之番外 3D切换导航篇(Blend 4开发)

    原文:silverlight,WPF动画终极攻略之番外 3D切换导航篇(Blend 4开发) 这篇介绍的是3D导航,点击图标,页面360°翻转的效果!有什么不足的欢迎大家指出来. 1.新建一个user ...

  6. silverlight,WPF动画终极攻略之白云飘,坐车去旅游篇(Blend 4开发)

    原文:silverlight,WPF动画终极攻略之白云飘,坐车去旅游篇(Blend 4开发) 这章有点长,所以我分成了两章.这一章主要是准备工作,差不多算美工篇吧,这章基本不会介绍多少动画效果,主要讲 ...

  7. silverlight,WPF动画终极攻略之迟来的第三章 动画整合篇(Blend 4开发)

    原文:silverlight,WPF动画终极攻略之迟来的第三章 动画整合篇(Blend 4开发) 有个问题想请教下大家,我仿了腾讯的SL版QQ,相似度95%以上.我想写成教程教大家怎么开发出来,会不会 ...

  8. silverlight,WPF动画终极攻略之会飞的小鸟篇(Blend 4开发)

    原文:silverlight,WPF动画终极攻略之会飞的小鸟篇(Blend 4开发) 本教程基本涵盖了WPF和silverlight中的各种动画.先上张效果图. 声明下,这个做的不是让大家照搬的,只是 ...

  9. silverlight,WPF动画终极攻略之阳光灿烂篇(Blend 4开发)

    原文:silverlight,WPF动画终极攻略之阳光灿烂篇(Blend 4开发) 前面我们画了一只会飞动的小鸟,今天我们在目标是一个会发光的太阳.本章节的动画虽然简单,但是实现的效果可是一点也不打折 ...

随机推荐

  1. vmware 共享文件夹

    参考 https://jingyan.baidu.com/article/7f766daf7866be4101e1d0ed.html 只是设置共享文件夹选项还不行,需要从安装vmware的安装路径中找 ...

  2. gitlab-ce 安装、汉化与阿里邮箱配置(注意是CE)

    环境准备 yum install curl openssh-server openssh-clients postfix cronie policycoreutils-python –y curl h ...

  3. centos 7.2 安装域名服务器(bind9.9 集群--主从架构),私有域名服务器+缓存

    1.安装组件 yum install bind bind-utils -y 2.启动域名服务 service named start chkconfig named on ss -unlt |grep ...

  4. HDU-1074.DoingHomework(撞鸭dp二进制压缩版)

    之前做过一道二进制压缩的题目,感觉也不是很难吧,但是由于见少识窄,这道题一看就知道是撞鸭dp,却总是无从下手....最后看了一眼博客,才顿悟,本次做这道题的作用知识让自己更多的认识二进制压缩,并无其它 ...

  5. Date 时间 日期 常用方法函数

    转载自https://www.cnblogs.com/lcngu/p/5154834.html 一.java.util.Date对象用来表示时间,基本方法如下: Date mDate = new Da ...

  6. jQuery之禁止Get请求缓存

    如果两次Get请求的URL完全一样,则IE浏览器会调用上次缓存的结果,不会发起新的Http请求. 解决办法:在URL最后面加上时间戳. jQuery全局设置禁止缓存 $.ajaxSetup({ cac ...

  7. ssh免密登陆权限问题

    问题: 添加了authorized_keys还是不能免密登陆. 思路: 检查端口是否开放,是否允许root用户登录,尝试重启ssh服务... 最有可能的还是权限问题,出现Permission deni ...

  8. TZOJ 1937 Hie with the Pie(floyd+状压dp)

    描述 The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfo ...

  9. Android Studio 检查Top Activity

    public void CheckTop(String packagename,int casenum) { Context context = getBaseContext(); ActivityM ...

  10. mysql decimal(10,2)对应java类型

    下面我给出MYSQL类型与JAVA类型对应表,希望能够帮到您: 类型名称 显示长度 数据库类型 JAVA类型 JDBC类型索引(int) VARCHAR L+N VARCHAR java.lang.S ...