SC.UI
IController
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity; namespace SC.UI
{
public interface IController : ISingletonDependency
{
void SubscribeEvents(); void UnsubscribeEvents(); IUnityContainer UnityContainer { get; set; } IRegionManager RegionManager { get; set; } IEventAggregator EventAggregator { get; set; } void AttachView(IViewModel viewModel); void RemoveView(IViewModel viewModel); void AttachView(string zoneName, IViewModel viewModel); void RemoveView(string zoneName, IViewModel viewModel);
}
}
Controller
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity; namespace SC.UI
{
public abstract class Controller : NotificationObject, IController
{
public Controller(
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
{
RegionManager = regionManager;
EventAggregator = eventAggregator;
UnityContainer = unityContainer;
} public IUnityContainer UnityContainer { get; set; } public IRegionManager RegionManager { get; set; } public IEventAggregator EventAggregator { get; set; } public virtual void SubscribeEvents() { } public virtual void UnsubscribeEvents() { } public void AttachView(IViewModel viewModel)
{
AttachView(RegionNames.MainRegion, viewModel);
} public void AttachView(string regionName, IViewModel viewModel)
{
var zone = RegionManager.Regions[regionName]; if (null != zone && !zone.Views.Contains(viewModel))
{
zone.Add(viewModel);
}
} public void RemoveView(IViewModel viewModel)
{
RemoveView(RegionNames.MainRegion, viewModel);
} public void RemoveView(string regionName, IViewModel viewModel)
{
var region = RegionManager.Regions[regionName]; if (null != region && region.Views.Contains(viewModel))
{
region.Remove(viewModel);
}
}
}
}
ModuleBase
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity; namespace SC.UI
{
public class ModuleBase : IModule
{
protected IUnityContainer UnityContainer { get; private set; }
protected IEventAggregator EventAggregator { get; private set; }
protected IRegionManager RegionManager { get; private set; } public ModuleBase(
IUnityContainer unityContainer,
IEventAggregator eventAggregator,
IRegionManager regionManager)
{
UnityContainer = unityContainer;
EventAggregator = eventAggregator;
RegionManager = regionManager;
} public void Initialize()
{
ConfigureContainer();
InitializeModule();
SubscribeEvents();
} protected virtual void ConfigureContainer() { } protected virtual void InitializeModule() { } protected virtual void SubscribeEvents() { } protected virtual void UnSubscribeEvents() { }
}
}
IViewModel
using System.ComponentModel; namespace SC.UI
{
public interface IViewModel : INotifyPropertyChanged, ISingletonDependency
{ }
}
ViewModelBase
namespace SC.UI
{
public class ViewModelBase : NotificationObject, IViewModel
{
public ViewModelBase()
{ }
}
}
ISingletonDependency
namespace SC.UI
{
public interface ISingletonDependency
{
}
}
http://files.cnblogs.com/files/zisezhixin/SC.UI.zip
SC.UI的更多相关文章
- Spark UI (基于Yarn) 分析与定制
转载自:https://yq.aliyun.com/articles/60194 摘要: 这篇文章的主旨在于让你了解Spark UI体系,并且能够让你有能力对UI进行一些定制化增强.在分析过程中,你也 ...
- Spark源码系列(四)图解作业生命周期
这一章我们探索了Spark作业的运行过程,但是没把整个过程描绘出来,好,跟着我走吧,let you know! 我们先回顾一下这个图,Driver Program是我们写的那个程序,它的核心是Spar ...
- 【Spark Core】任务运行机制和Task源代码浅析1
引言 上一小节<TaskScheduler源代码与任务提交原理浅析2>介绍了Driver側将Stage进行划分.依据Executor闲置情况分发任务,终于通过DriverActor向exe ...
- Spark里面的任务调度:离SparkContext开始
SparkContext这是发达国家Spark入学申请,它负责的相互作用和整个集群,它涉及到创建RDD.accumulators and broadcast variables.理解力Spark架构, ...
- Spark Scheduler模块源码分析之TaskScheduler和SchedulerBackend
本文是Scheduler模块源码分析的第二篇,第一篇Spark Scheduler模块源码分析之DAGScheduler主要分析了DAGScheduler.本文接下来结合Spark-1.6.0的源码继 ...
- Spark技术内幕:Executor分配详解
当用户应用new SparkContext后,集群就会为在Worker上分配executor,那么这个过程是什么呢?本文以Standalone的Cluster为例,详细的阐述这个过程.序列图如下: 1 ...
- Spark技术内幕之任务调度:从SparkContext开始
SparkContext是开发Spark应用的入口,它负责和整个集群的交互,包括创建RDD,accumulators and broadcast variables.理解Spark的架构,需要从这个入 ...
- Spark分析之SparkContext启动过程分析
SparkContext作为整个Spark的入口,不管是spark.sparkstreaming.spark sql都需要首先创建一个SparkContext对象,然后基于这个SparkContext ...
- cocos代码研究(23)Widget子类ScrollView学习笔记
基础理论 一个能够被用户触摸滚动的一个层次型布局容器视图,允许其尺寸大于屏幕显示的物理尺寸,其内部维护有一个布局用于水平的或垂直的存放子节点.继承自 Layout,被 ListView 继承. 代码实 ...
随机推荐
- 流式布局&固定宽度&响应式&rem
我们现在在切页面布局的使用常用的单位是px,这是一个绝对单位,web app的屏幕适配有很多中做法,例如:流式布局.限死宽度,还有就是通过响应式来做,但是这些方案都不是最佳的解决方法. 1.流式布局: ...
- Codeforces Round #192 (Div. 2)
吐槽一下,这次的CF好简单啊. 可是我为什么这么粗心这么大意这么弱.把心沉下来,想想你到底想做什么! A 题意:O(-1) 思路:O(-1) #include <iostream> #in ...
- Nginx localtion匹配规则
mark:2016年05月25日13:20:54 (存手打,拒绝转载) 一.location分为 普通location 和 正则location 只有带有 "~" 或者" ...
- Harris角点检测算法优化
Harris角点检测算法优化 一.综述 用 Harris 算法进行检测,有三点不足:(1 )该算法不具有尺度不变性:(2 )该算法提取的角点是像素级的:(3 )该算法检测时间不是很令人满意. 基于以上 ...
- Total Commander 常用快捷键(并附快捷键大全)
Total Commander 常用快捷键 喜欢用Total Commander的人,都会记住它的一些快捷键,这会给你的操作带来很大的方便,以下是经常会用到的快捷键,大家可以记住一些自己用得最多的操作 ...
- 【转】Spring 获取web根目录 (Spring线程获取web目录/路径/根目录,普通类获取web目录)
不使用Spring,怎样能在Listener启动的Thread中获取web目录,还真不完全确定.其实我觉得实际代码也很简单.就是基于普通的listener,然后在listener中获取web目录并放到 ...
- 网页FLASH幻灯片播放带链接源代码 pixviewer.swf使用(转)
<script type="text/javascript"> <!-- var focus_width=360 var focus_height=270 ...
- Larbin初试
前阵子找工作的时候经常会看到epoll多路复用的知识点,无奈自己一点都不懂.慌忙之际也只能去了解个大概.所以最近闲下来之后想要基于epoll机制实现一个比较有用的东西,刚好最近又想爬些东西,希望这次能 ...
- 【iCore3 双核心板】例程二十:LAN_TCPC实验——以太网数据传输
实验指导书及代码包下载: http://pan.baidu.com/s/1pJY5uXH iCore3 购买链接: https://item.taobao.com/item.htm?id=524229 ...
- C#常用命名空间
MSDN上的C#.NET Framework类库文档目录树,本人觉得有点不得要领,于是参考搜到的结果简单整理如下: 一.基础命名空间 System 处理内建数据.数学计算.随机数的产生.环境变量.垃圾 ...