Prism View loading in StockTrader sample - prism

I have been looking through the code and the pdf documentation and I can't find anything that indicates how the StockTrader sample application decides which view (PositionSummary or WatchList) should be displayed by default.
Can anyone explain how this is determined?

If I remember correctly, the stock trader RI uses its own custom behavior named AutoPopulateExportedViewsBehavior. This behavior is different from the one used by Prism as out of the box and is designed to work specifically with MEF. Along with the ViewExportAttribute it register the view in the container while also adding in to the corresponding region at start-up. You can find both of them in the StockTraderRI.Infrastructure project inside the Behaviors folder.
Edit:
Maybe I misread the question. If you are asking how it's determined which view between the PositionSummary and WatchList views is shown first, there is no specific configuration for this. The order is related to what module is initialized first. If you were to move the PositionModule after the WatchModule in the bootstrapper, the WatchList would be the one being shown by default.

Related

What is imgMain control in visual Basic 6?

I'm using a VB6 application as a reference and have come across imgMain. I'm assuming its an image control, however, I cannot find the object on any of the forms. It's used to load the image. I'm just not sure what's going on with this. I'm assuming its an IMAGE CONTROL, but I cannot find this on any of the forms? it's mentioned a lot of times in teh application as it lets you view incoming faxes and stuff.
Without having a look on source code i assume It might be custom user control that was created for some reasons probably to extend basic picturebox control.
One thing i can advise you is to further inspect code and dig to code of this custom control. If code for this control is not available then see what methods and properties instances of that particular control uses and compare them with regular picturebox.

Drupal Display Suite Custom View Modes stopped appearing

I have recently noticed something odd with Display Suite. I am rather new to Drupal so if its something on my mistake please do not make fun of me.
But I have noticed that no new custom display settings (view nodes are being added to either node or field collection) previously it worked perfectly but now if I create a new view mode and attaching it to the node / field collection it seems it does not apply to it.
See the photos attached. Any suggestion?
http://oi59.tinypic.com/727fqp.jpg
http://oi59.tinypic.com/jb44cj.jpg
P.S. I have cleared drupal cache but it still keeps not working.
Thanks in advance
Fist I'd say that if you're a new user to Drupal, using Display Suite is really jumping into the deep end. It's a really powerful module and creating View Modes is just the tip of the iceberg of what it can do. Second, when you create a new View Mode, you're doing it for an Entity (such as Content Types, Users, Comments, File - but not so much a single node, nor a field). You can find more info on what View Modes and entities are here. You don't need Display Suite to activate other View Modes but if all you're wanting to do is create a custom view mode, the lightweight module to use for that is Entity View Mode. Lullabot does a nice job of explaining this module here.
Anyhow, modules aside, note that the controls for turning View Modes on and off are only found on the 'Default' view mode for a given content type, ie: when on the Manage Display page of whatever content type you're working with, at the top right under the main tabs, you'll see your activated view modes. If you select 'Default' then you will see the control to turn on/off other view modes.
Now, maybe you're wondering how do you see what a particular View Mode looks. To do this, you're best off using Views as it ties in nicely with View Modes.
Hope that helps.

Programatically setting control properties vs. using designer

Often, when I'm looking for information of how to set certain properties of controls (I'm using Visual Studio primarily, but this question does apply to any IDE), the examples I find normally involve programatically setting said properties.
Here's an example, using the DataGridView.DefaultCellStyle property on MSDN:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.defaultcellstyle(v=vs.110).aspx
So my question is: is it better for a programmer to modify these properties by code, or is it better to use the IDE itself to change them via the properties pane? I realize that doing it the latter way will result in auto-generated code anyway, but it will be "somewhere else" in relation to the main bulk of user-generated code.
It depends on your requirements. If the app you are developing is planned to be dynamic, then it is a good idea to do it the way it is described in the reference you provided. For example, you may create a class containing the method which will set the basic settings of the gridview, so on every page you may just call this method and pass to it the gridview as a parameter instead of repeating setting the grid properties on every page.

Different types of Xcode applications

I am new to Xcode development. When I first opened Xcode 4.2, there were different types of applications we can build (Master Detail, Page Based, Single View, Tabbed, Utility, Empty Application) using Xcode.
I am somewhat confused about how different they are from each other. I did some search but so far I am not able to understand their basic difference. How would I know which application to select to start developing my own application.
If someone can explain their difference and usage to me in layman terms.
Thanks.
Those are different starter template's provided along with Xcode. You may decide not to you use any of the templates and go with an empty project.
Below is the brief overview of each of the templates.
Master Detail - Template which has pre-created Parent-child views with navigation controller, typically for iPad for different orientation.
Page based - Similar to iBooks app.
Single View - Starter template with a single view. you can add multiple view whenever required.
Tabbed application - View controller with tab bar at the bottom of the screen.
I hope you got the idea. In my opinion, as a starter, you should go with creating a single view based application.
Good luck.

Changing Views Within a Prism Module?

So I have a PRISM v2 (M-V-VM) application up and running. It's 4 modules that load into a tab control. Great.
Now my question is - where to go from here? Most tutorials seem to stop at this point.
Maybe I'm overthinking this, but it almost seems like I'd need each module to be its own PRISM application, but that can't be right.
Please help a PRISM n00b figure out where to go from here.
What I'm looking to do next: Each tab (module) has its own toolbar with buttons, etc. Clicking a button should change the content (view) below the toolbar.
How to achieve this (correctly) with PRISM? Each module (tab) should have control over its content, however, clicking cetain buttons in one tab may trigger an event in another tab (hence the use of PRISM).
So what's the correct-PRISM way to change views within a module?
I think you are thinking about this a bit hard. I'll explain.
What is commonly referred to as the "Shell" should contain all of your navigation controls. For example, if I wanted a tabbed UI, my Shell would contain a tab control (usually you'd decorate that TabControl with a RegionName, like "ShellTabs").
Your Modules will contribute views to these shell elements. So let's say you have the email module, it will contribute an inbox view to your collection of tabs. It could contribute these views by registering them with the RegionManager for the app (like registering your view with the Region called "ShellTabs").
Modules don't have to contribute anything visual. I have one module in our app that takes care of logging and other background processes.
Hopefully this clears up some of the nomenclature and helps you know what the responsibility of each part is.

Resources