Android Development 

Wednesday, October 12, 2011 4:12:00 PM

I'm finally getting around to delving into Android development. After so many years in Microsoft's Visual Studio and MS SQL world, its nice to step out side of that and get my feet wet in some new and interesting territory. I'm excited about learning something new.

Free Website Design and Development Quote 

Monday, October 03, 2011 4:51:00 PM

We've added a new form to allow our potential clients to get free website design quotes.  If you need a website designed and built, give us your basic information at http://aquestit.com/website-design-quote.aspx, and we'll work with you to come up with an affordable and effective website. Don't forget that we can also help you with your social media plans.

Another website design Remodel - www.TennisPulse.org 

Monday, October 03, 2011 12:24:00 AM

www.TennisPulse.org has been updated. We built the original www.TennisPulse.org website in 2008 and it has grown to have 1000's of users. We've recently updated the website to use the MojoPortal framework. This will allow the features of MojoPortal to facilitate communication with end users. This was a pretty cool project. We built custom modules for MojoPortal to integrate the TennisPulse features into the MojoPortal solution.

TennisPulse.org Website Design  

 

Aquest IT mentioned by MojoPortal 

Monday, October 03, 2011 12:22:00 AM

We like MojoPortal and use it for our websites  when it fits the need, which is often. We got a brief mention on the MojoPortal website at http://www.mojoportal.com/mojoportal-sightings-for-september-2011 .

The Adaptables Website 

Friday, August 26, 2011 2:18:00 AM

The Adaptables website has been released and we are working with them to make sure the site is updated regularly to reflect the activity of their organization. Check them out at http://www.theadaptables.com

Racquets For The Cure Website Upgraded to MojoPortal 

Thursday, July 28, 2011 5:23:00 PM

We've recently completed an upgrade of the Racquets For The Cure website to MojoPortal with some custom development. MojoPortal is a great starting point for websites and we were able to add some custom programming to extend it and allow or online tournament registrations.

 

 

www.RacquetsForTheCure.org

Sign up for the tennis tournament or check out the registration page to see an example of custom development in a MojoPortal website application.

To hire us for MojoPortal customization, please contact us.

Imported MEF objects are null in ViewModel 

Sunday, April 24, 2011 10:35:00 PM

So I'm using MVVM pattern with Prism and MEF in the sample application that I'm currently working on. My practice when not using PRISM and MEF was to wire up the ViewModel to the View by putting markup in the View's xaml to specify the ViewModel class. An example would be

<UserControl.DataContext>

<vm:CustomerHomeViewModel/>

</UserControl.DataContext/>

Now let's say that in the ViewModel class we need to use something that is imported from MEF. This could be the IRegionManager, or one of my own classes that I'm importing. In this example I'm importing a SampleData class, and using the SampleData.Name value as DisplayName property that I've wired up on my View. I set a breakpoint in 'get' statement and I see that when this line is hit, that SampleData is null. The Import is not working. Why? Because MEF didn't create this ViewModel. I created it in xaml rather than letting MEF create it.

 

[Import]

        CustomerSampleData SampleData;

      

        public string DisplayName

        {

            get{

stringit = SampleData.Name;

                     return it;

            }

            set {

                q    _displayName = value;

            }

        }

To fix this I need to let MEF create the ViewModel. I can do this 2 ways that I know of. First, I could put a ViewModel property into the codebehind of the View file as follows (and remove the xaml that creates the ViewModel):

[Import]

Customers.ViewModels.CustomerHomeViewModelViewModel

{

set{ this.DataContext = value; }

}

Or I found that Jeremy Likness has create is using Markup Extensions in a sample show here: http://www.wintellect.com/CS/blogs/jlikness/archive/2011/04/14/creating-a-markup-extension-for-mef-with-silverlight-5.aspx so that you can still create the ViewModel in xaml. I haven't tried this yes, but its worth a look especially if you prefer not to have code behind in your Views.

MEF Modules not initializing 

Thursday, April 21, 2011 10:37:00 PM

After lots of wasted time trying to figure out why my MEF module in a new WPF application was not loading, I've found that if there is not a constructor that can be used, then there is a silent failure, with no errors.  I had a single constructor in my MEF module which was relying on 2 items to be imported (it is an Importing Constructor). Since one of the items I wanted to import was not created properly by the main application prior to calling this constructor, the constructor was never called.

If you have a MEF module that should load but setting a breakpoint in your constructor reveals that it is never called, then change the module to have a parameterless default constructor and see if that is called. If it is, then you can narrow down which of the Imported parameters in your real constructor is causing the problem.

 

MVVM - Ways to assign ViewModels 

Thursday, March 10, 2011 10:38:00 PM

MVVM is quite a shift from the Windows Forms and ASP.net paradigms I've used for years. One thing I find confusing is setting up the pages by assigning ViewModels to pages and controls. These notes are more for my personal use, but you are welcome to read if it helps you.

 

Method1:

In a resource file or within the page xaml, we define a DataTemplate that specifies that a ViewModel ( named TestContactViewModel) will be displayed using a View (named TestContactView).

<DataTemplate DataType="{x:Type vm:TestContactViewModel}">

<vw:TestContactView />

</DataTemplate>

 

Now when we bind a 'TestContactViewModel', the software knows to use a 'TestContactView' to display that ViewModel.

In the same page xaml, we have a Tab Control, and you can see here that on the 3rd tab we  bind the 'TestContactViewModel'. The DataTemplate above makes sure that it will be displayed with the desired View.

 

<Grid>

   <TabControl Margin="20">

   <TabItem Header="_Home">

   </TabItem>

   <TabItem Header="_Vendor">

   </TabItem>

   <TabItem Header="_Clients" Content="{Binding Path=TestContactViewModel}" >

   </TabItem>

   ...

 

 

Method 2:

 

In this example, a Collection<T> or ReadOnlyCollection<T> is bound as the content of a control. This is different because a ViewModel was not bound as the Content. But this 'Commands' collection is actually a collection of ViewModels.

<HeaderedContentControl

  Content="{Binding Path=Commands}"

  ContentTemplate="{StaticResource CommandsTemplate}"

  Header="Menu" Style="{StaticResource MainHCCStyle}" />

The 'Commands' this code in the ViewModel tied to the above View:

public ReadOnlyCollection<CommandViewModel> Commands{

   get{...}

}

To keep this simple just know that a CommandViewModels have 2 properties: DisplayName (string) and Command(RelayCommand).

There is no CommandView. Instead, the control above said to use a ContentTemplate named CommandsTemplate. In the xaml of the page displaying the Control bound to 'Commands', there is this DataTemplate to show how to display the Commands:

<DataTemplate x:Key="CommandsTemplate">

  <ItemsControl IsTabStop="False" ItemsSource="{Binding}" Margin="6,2">

  <ItemsControl.ItemTemplate>

    <DataTemplate>

      <TextBlock Margin="2,6">

        <Hyperlink Command="{Binding Path=Command}">

          <TextBlock Text="{Binding Path=DisplayName}" />

        </Hyperlink>

     </TextBlock>

   </DataTemplate>

  </ItemsControl.ItemTemplate>

  </ItemsControl>

</DataTemplate>

Method 3:

 

Now we're going to combine methods 1 and 2 and have a Collection of ViewModels that will be displayed according to DataTemplate, like Method 2, however these ViewModels have Views that dictate how to display each ViewModel in the collection.

<HeaderedContentControl

  Content="{Binding Path=Workspaces}"

  ContentTemplate="{StaticResource WorkspacesTemplate}"

  Header="Workspaces" Style="{StaticResource MainHCCStyle}"  />

 

The path Workspaces is an Observable collection of 'WorkspaceViewModels'.

public ObservableCollection<WorkspaceViewModel> Workspaces{

   get{ ...}

}

The DataTemplate that was specified to shows these Workspaces:

<DataTemplate x:Key="WorkspacesTemplate">

  <TabControl 

  IsSynchronizedWithCurrentItem="True"

  ItemsSource="{Binding}"

  ItemTemplate="{StaticResource ClosableTabItemTemplate}" Margin="4" />

That took care of some important details but didn't tell how to display a Workspace. 

There are 2 classes types that derive from 'WorkspaceViewModels':   AllContactsViewModel, and ContactViewModel.

These data templates in the same xaml file tell the page which view to use to display these WorkspaceViewModels depending on which type they are:

<DataTemplate DataType="{x:Type vm:AllContactsViewModel}">

  <vw:AllContactsView />

</DataTemplate>

And

<DataTemplate DataType="{x:Type vm:ContactViewModel}">

<vw:ContactView />

</DataTemplate>

There is more than one way to get your ViewModel assigned to be displayed. You can hard code a ViewModel as the Content of a control. Make sure that there is a DataTemplate that specifies either the info from the ViewModel to show, or tells the View to use to display that ViewModel. Another option is to bind a Collection to the Content of a control. If the Collection contains ViewModels, then they will be displayed according to the DataTemplate that either tells which View to use for that ViewModel or tells specifically how to display the ViewModel without the use of a View.

Theres a start on how ViewModels are bound and displayed with Views or DataTemplates.