reusability

Theme/style Angular 2 reusable component libraries

邮差的信 提交于 2019-12-03 09:15:19
General problem I want to style reusable Angular components to match the style of the specific client project. I maintain the reusable components in a separate project and generate an npm package out of it. That package is published to a private NPM repository (Sinopia) and then installed into multiple client projects. The general styling is - of course - specific to the component, but color and font - for example - should match the client project. How can I best apply styles such as color and font, defined in the client project, to the reusable components? Current implementation At the moment

Fragment - should I reuse view in onCreateView and how should I do that?

て烟熏妆下的殇ゞ 提交于 2019-12-03 09:08:36
问题 Actually, I always reused my view in my fragments like the following: private View mView = null; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (mView == null) mView = inflater.inflate(R.layout.view); return mView; } That worked, with viewpager and so on. Now I started using my fragments in simple activities as well and if, and only if, I add the fragment to the backstack, this will fail because of java.lang

Reusing 3 views on UIScrollView's Paging

时间秒杀一切 提交于 2019-12-03 09:01:56
I did the following code where three views can be reused during Pagination in UIScrollView in order to save live memory--> #pragma mark - UIScrollView Delegates - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ CGFloat pageWidth = self.view.frame.size.width; CGPoint aContentOffSet = [[self scrollView] contentOffset] ; float currPos = aContentOffSet.x; int selectedPage = roundf(currPos/pageWidth); [[self pageControl] setCurrentPage:selectedPage]; [self update:selectedPage]; } #pragma mark - Custom methods -(void)update:(int) selectedPage{ BOOL view1FrameShallBeUnchanged = false; BOOL

How to create an ASP.NET MVC 3 control/component that can be reused by other applications

送分小仙女□ 提交于 2019-12-03 07:40:28
问题 I am required to deliver a component, inlcuding business logic and UI, to be used on a ASP.NET MVC 3 web site that is being developed by other company. I know my way around ASP.NET WebForms server controls and how to package and distribute them to be reused across projects. I also have experience with MVC approach in general and some ASP.NET MVC experience. I did read over materials recommending use of HTML helpers and similar, but most of this deals with only UI reusability or reusability

define animations and triggers as reusable resource?

青春壹個敷衍的年華 提交于 2019-12-03 07:22:41
问题 Is there a way to define an animation somewhere in xaml (eg. as a resource) once and then reuse it multiple times? I have a lot of independent brushes across differnt datatemplates that independently need to start the same kind of animation based on a datatrigger. Now since it seems that an animation has to define an Storyboard.TargetName and Storyboard.TargetProperty. This pretty much defeats the purpose of reusability. I would somehow like to declare "use this animation form the resource

Reuse MVC arhitecture; Have two layers of UI : ASP.NET MVC and .NET Winforms

自闭症网瘾萝莉.ら 提交于 2019-12-03 06:57:14
Although my question might seem abstract I hope it's not. Suppose I develop an application, an ASP.NET MVC site and later I am tasked to build an Winforms client for this application how much and how can I reuse from the existing application? I defined the models, I defined controllers and views. They all work well. Now the boss comes asking for a Winforms client and I am hoping I can reuse the models and the controllers (provided I put them in different assemblies) and not reuse just the views (ASPX views). Can this be done? How? I have done this previously, not with asp.net MVC but with pure

Reuse of a LINQ query

一曲冷凌霜 提交于 2019-12-03 06:32:51
问题 This is not about the reuse of a result but more the statement itself. Nor is it about an error when using var as mentioned in: LINQ to SQL: Reuse lambda expression Out of sheer curiosity I was wondering if it is possible to reuse a single LINQ statement. Lets say I have the following LINQ statement: .Where(x => x.Contains("")); Is it possible to extract the statement x => x.Contains("") and use some kind of reference to this for later usage in, lets say, another class? So I can call it like:

JSF 1.2: ui:include with parameters

时光总嘲笑我的痴心妄想 提交于 2019-12-03 05:35:56
问题 Have JSF 1.2 two pages(one.xhtml and other.xhtml), that are included to the current page by following rule: ... <c:if test="#{flowScope.Bean.param1}"> <ui:include src="one.xhtml"/> </c:if> <c:if test="#{!flowScope.Bean.param1}"> <ui:include src="other.xhtml"/> </c:if> ... As far one.xhtml differs from other.xhtml only by action parameters: one.xhtml: <h:commandLink action="actionOne"> other.xhtml: <h:commandLink action="actionTwo"> Is it possible to use some general xhtml? Instead of one

No index path for table cell being reused

风格不统一 提交于 2019-12-02 22:53:46
This started to happen out of the blue. Any ideas: Code: CUSTOMCLASSNAME (I have replaced the actual class name as it contains the name of the client.) Initialising my tableView: [self.tableView registerClass:[CUSTOMCLASSNAME class] forCellReuseIdentifier:[self reuseIdentifier]]; In cell for row: Hi, the title is being printed in the console. This is my cellForRow: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { AVTCheckListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[self reuseIdentifier] forIndexPath:indexPath];

How to create an ASP.NET MVC 3 control/component that can be reused by other applications

点点圈 提交于 2019-12-02 21:06:07
I am required to deliver a component, inlcuding business logic and UI, to be used on a ASP.NET MVC 3 web site that is being developed by other company. I know my way around ASP.NET WebForms server controls and how to package and distribute them to be reused across projects. I also have experience with MVC approach in general and some ASP.NET MVC experience. I did read over materials recommending use of HTML helpers and similar, but most of this deals with only UI reusability or reusability inside a single ASP.NET MVC project. I did not find any mentions of how to package and distribute such